From 72975a1614dd37df6182de3edb4a6d520b1fb2ab Mon Sep 17 00:00:00 2001 From: limu Date: Fri, 2 Feb 2024 15:34:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1demo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/command/test.php | 28 ++++++++++++++++++++++++++++ config/console.php | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 app/command/test.php 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', ], ];