Schedule.php 554 B

12345678910111213141516171819202122232425
  1. <?php
  2. declare (strict_types = 1);
  3. namespace app\command;
  4. use schedule\console\Command;
  5. use think\console\Input;
  6. use think\console\Output;
  7. class Schedule extends Command
  8. {
  9. protected function configure()
  10. {
  11. // 指令配置
  12. $this->setName('schedule:run')
  13. ->setDescription('the schedule:run command');
  14. }
  15. protected function execute(Input $input, Output $output)
  16. {
  17. // 每5分钟执行一次test指令
  18. $this->command('test')->everyFiveMinutes();
  19. parent::execute($input,$output);
  20. }
  21. }