Kernel.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace App\Console;
  3. use Illuminate\Console\Scheduling\Schedule;
  4. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  5. use Illuminate\Support\Facades\Log;
  6. class Kernel extends ConsoleKernel
  7. {
  8. /**
  9. * Define the application's command schedule.
  10. *
  11. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  12. * @return void
  13. */
  14. protected function schedule(Schedule $schedule)
  15. {
  16. $schedule->command('upgrade:daily')
  17. ->dailyAt('00:00')
  18. ->emailOutputTo(config("mint.email.ScheduleEmailOutputTo"))
  19. ->emailOutputOnFailure(config("mint.email.ScheduleEmailOutputOnFailure"));
  20. $schedule->command('upgrade:weekly')
  21. ->weekly()
  22. ->emailOutputOnFailure(config("mint.email.ScheduleEmailOutputOnFailure"));
  23. }
  24. /**
  25. * Register the commands for the application.
  26. *
  27. * @return void
  28. */
  29. protected function commands()
  30. {
  31. $this->load(__DIR__.'/Commands');
  32. require base_path('routes/console.php');
  33. }
  34. /**
  35. * Get the timezone that should be used by default for scheduled events.
  36. *
  37. * @return \DateTimeZone|string|null
  38. */
  39. protected function scheduleTimezone()
  40. {
  41. return 'Asia/Shanghai';
  42. }
  43. }