2017-06-09 02:28:26 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Console;
|
|
|
|
|
2018-03-17 09:12:56 +08:00
|
|
|
use App\Console\Cron\Monthly;
|
|
|
|
use App\Console\Cron\Nightly;
|
|
|
|
use App\Console\Cron\Weekly;
|
2017-06-09 02:28:26 +08:00
|
|
|
use Illuminate\Console\Scheduling\Schedule;
|
|
|
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
|
|
|
|
2018-03-20 09:50:40 +08:00
|
|
|
/**
|
|
|
|
* Class Kernel
|
|
|
|
* @package App\Console
|
|
|
|
*/
|
2017-06-09 02:28:26 +08:00
|
|
|
class Kernel extends ConsoleKernel
|
|
|
|
{
|
|
|
|
protected $commands = [
|
2017-12-30 00:23:42 +08:00
|
|
|
Commands\AcarsReplay::class,
|
2017-07-14 02:45:59 +08:00
|
|
|
Commands\CreateDatabase::class,
|
2017-12-30 00:23:42 +08:00
|
|
|
Commands\DevCommands::class,
|
2018-02-22 23:31:07 +08:00
|
|
|
Commands\YamlImport::class,
|
|
|
|
Commands\ImportFromClassic::class,
|
2017-12-17 12:19:17 +08:00
|
|
|
Commands\Install::class,
|
2018-02-22 23:31:07 +08:00
|
|
|
Commands\NavdataImport::class,
|
2017-12-31 01:56:38 +08:00
|
|
|
Commands\TestApi::class,
|
2017-06-09 02:28:26 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the application's command schedule.
|
2018-03-20 09:50:40 +08:00
|
|
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
2017-06-09 02:28:26 +08:00
|
|
|
* @return void
|
|
|
|
*/
|
2018-03-17 09:12:56 +08:00
|
|
|
protected function schedule(Schedule $schedule): void
|
2017-06-09 02:28:26 +08:00
|
|
|
{
|
2018-03-17 09:12:56 +08:00
|
|
|
$schedule->command(Nightly::class)->dailyAt('01:00');
|
|
|
|
$schedule->command(Weekly::class)->weeklyOn(0);
|
|
|
|
$schedule->command(Monthly::class)->monthlyOn(1);
|
2017-06-09 02:28:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register the Closure based commands for the application.
|
|
|
|
* @return void
|
|
|
|
*/
|
2018-03-17 09:12:56 +08:00
|
|
|
protected function commands(): void
|
2017-06-09 02:28:26 +08:00
|
|
|
{
|
2017-12-15 00:38:10 +08:00
|
|
|
require app_path('Routes/console.php');
|
2018-03-20 09:50:40 +08:00
|
|
|
$this->load(__DIR__.'/Commands');
|
|
|
|
$this->load(__DIR__.'/Cron');
|
2017-06-09 02:28:26 +08:00
|
|
|
}
|
|
|
|
}
|