使用 thinkphp6 框架中提供的命令行形式实现定时任务
一、创建一个自定义命令类文件
php think make:command Hello
会生成一个 app\command\Hello.php 命令行指令类,我们修改内容如下:
<?php
declare (strict_types=1);
namespace app\command;
use think\console\Command;
use think\console\Input;
use think\console\input\Argu