|
|
@@ -668,7 +668,6 @@ class Worker
|
|
|
|
|
|
/**
|
|
|
* Parse command.
|
|
|
- * php yourfile.php start | stop | restart | reload | status [-d]
|
|
|
*
|
|
|
* @return void
|
|
|
*/
|
|
|
@@ -690,6 +689,7 @@ class Worker
|
|
|
);
|
|
|
$usage = "Usage: php yourfile <command> [mode]\nCommands: \nstart\t\tStart worker in DEBUG mode.\n\t\tUse mode -d to start in DAEMON mode.\nstop\t\tStop worker.\n\t\tUse mode -g to stop gracefully.\nrestart\t\tRestart workers.\n\t\tUse mode -d to start in DAEMON mode.\n\t\tUse mode -g to stop gracefully.\nreload\t\tReload codes.\n\t\tUse mode -g to reload gracefully.\nstatus\t\tGet worker status.\n\t\tUse mode -d to show live status.\nconnections\tGet worker connections.\n";
|
|
|
if (!isset($argv[1]) || !in_array($argv[1], $available_commands)) {
|
|
|
+ if (isset($argv[1])) echo 'Unknown command: ' . $argv[1] . "\n";
|
|
|
exit($usage);
|
|
|
}
|
|
|
|
|
|
@@ -810,6 +810,7 @@ class Worker
|
|
|
posix_kill($master_pid, $sig);
|
|
|
exit;
|
|
|
default :
|
|
|
+ if (isset($command)) echo 'Unknown command: ' . $command . "\n";
|
|
|
exit($usage);
|
|
|
}
|
|
|
}
|