ThinkPhp5.1自动创建commend命令生成文件
php think make:command Deng
以下为自动创建
<?php
namespace app\command;
use think\console\Command;
use think\console\Input;
use think\console\Output;
class Deng extends Command
{
protected function configure()
{
// 指令配置
$this->setName('deng')
->setDescription('deng-测试使用[更新设备绑定信息]');
// 设置参数
}
protected function execute(Input $input, Output $output)
{
// 指令输出
echo 'demo';
// $output->writeln('deng');
}
}
运行文件:
php think deng