| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace App\Console;
- use Illuminate\Console\Scheduling\Schedule;
- use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
- /**
- * 控制台内核类
- *
- * 负责注册 Artisan 命令和定义命令调度,继承自 Laravel 的控制台内核
- */
- class Kernel extends ConsoleKernel
- {
- /**
- * The Artisan commands provided by your application.
- *
- * @var array
- */
- protected $commands = [
- Commands\DisabledMigrateCommand::class,
- Commands\DisabledBaseMigrateCommand::class,
- Commands\AskAndEchoCommand::class,
- ];
- /**
- * Define the application's command schedule.
- *
- * These schedules are run in a single process, so avoid doing any heavy processing here.
- *
- * @param \Illuminate\Console\Scheduling\Schedule $schedule
- * @return void
- */
- protected function schedule(Schedule $schedule): void
- {
- // 命令调度不是写在这里!
- // 调度写在 routes/console.php 中
- }
- /**
- * Register the commands for the application.
- *
- * @return void
- */
- protected function commands(): void
- {
- $this->load(__DIR__.'/Commands');
- require base_path('routes/console.php');
- }
- }
|