diff --git a/app/command/test.php b/app/command/test.php new file mode 100644 index 00000000..9406e9d4 --- /dev/null +++ b/app/command/test.php @@ -0,0 +1,28 @@ +setName('test') + ->setDescription('测试demo'); + } + + protected function execute(Input $input, Output $output) + { + echo date('Y-m-d H:i:s') . '完成'; + } + + +} diff --git a/config/console.php b/config/console.php index f6008bfe..dbaa6db4 100644 --- a/config/console.php +++ b/config/console.php @@ -7,5 +7,7 @@ return [ 'commands' => [ // 定时任务 'timer' => \app\timer\command\Timer::class, + //test脚本 + 'test' => 'app\command\test', ], ];