admin 管理员组

文章数量: 1086019


2024年4月29日发(作者:activity怎么读音发音英语)

swoole thinkphp6命令行编码

一、创建thinkphp自定义命令的类文件

php think make:command TaskMysqlBackup task:mysqlbackup

CLI模式下,执行以上命令后会自动创建app/command/文

件,也可以不用命令手动创建。

二、编辑类文件,实现自定义命令:

declare (strict_types = 1);

namespace appcommand;

use thinkconsoleCommand;

use thinkconsoleInput;

use thinkconsoleinputArgument;

use thinkconsoleOutput;

class TaskMysqlBackup extends Command

{

protected $pid_file;

protected $log_file;

protected $after_timer;

protected $tick_timer;

protected $period;

protected $worktime;

protected $bin_dir;

protected $bak_dir;

protected $keep;

protected function configure()

{

// 指令配置


本文标签: 命令 创建 读音 文件 编码