setName('seo:check2') ->addArgument('action', Argument::OPTIONAL, "start|stop|restart|reload|status|connections", 'start') ->addOption('host', 'H', Option::VALUE_OPTIONAL, 'the host of workerman service.', null) ->addOption('port', 'p', Option::VALUE_OPTIONAL, 'the port of workerman service.', null) ->addOption('daemon', 'd', Option::VALUE_NONE, 'Run the workerman service in daemon mode.') ->setDescription('网站诊断服务器'); } protected function execute(Input $input, Output $output) { $action = $input->getArgument('action'); if (DIRECTORY_SEPARATOR !== '\\') { if (!in_array($action, ['start', 'stop', 'reload', 'restart', 'status', 'connections'])) { $output->writeln("Invalid argument action:{$action}, Expected start|stop|restart|reload|status|connections ."); return false; } global $argv; array_shift($argv); array_shift($argv); array_shift($argv); array_unshift($argv, 'think', $action); } $logo = <<writeln($logo . PHP_EOL); TongJiServer::start(); } }