|
@@ -5,6 +5,7 @@ namespace app\command;
|
|
|
use app\common\server\ShOneanalysis;
|
|
|
use think\console\Command;
|
|
|
use think\console\Input;
|
|
|
+use think\console\input\Argument;
|
|
|
use think\console\Output;
|
|
|
use think\facade\Log;
|
|
|
use Workerman\Lib\Timer;
|
|
@@ -21,16 +22,18 @@ class analysisShoneMsg extends Command
|
|
|
protected function configure()
|
|
|
{
|
|
|
// 指令配置
|
|
|
- $this->setName('analysisShoneMsg')->setDescription('解析手环one接收信息');
|
|
|
+ $this->setName('analysisShoneMsg')
|
|
|
+ ->setDescription('解析手环one接收信息')
|
|
|
+ ->addArgument('action', Argument::OPTIONAL, "start|stop|restart|reload|status|connections", 'start');
|
|
|
// 设置参数
|
|
|
|
|
|
}
|
|
|
|
|
|
protected function execute(Input $input, Output $output)
|
|
|
{
|
|
|
- // 指令输出
|
|
|
- // Log::write([123123, 76868], 'shouhuan');
|
|
|
- // $output->writeln('test');
|
|
|
+ $action = $input->getArgument('action');
|
|
|
+ global $argv;
|
|
|
+ array_shift($argv);
|
|
|
$task = new Worker();
|
|
|
$task->count = 4;
|
|
|
$server_sa = new ShOneanalysis();
|