Skip to content

Commit

Permalink
parse command use $argv
Browse files Browse the repository at this point in the history
  • Loading branch information
walkor committed Nov 16, 2020
1 parent 580c247 commit 5ea3300
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Worker
*
* @var string
*/
const VERSION = '4.0.15';
const VERSION = '4.0.16';

/**
* Status starting.
Expand Down Expand Up @@ -756,7 +756,7 @@ protected static function getCurrentUser()
*/
protected static function displayUI()
{
$argv = $_SERVER['argv'];
global $argv;
if (\in_array('-q', $argv)) {
return;
}
Expand Down Expand Up @@ -867,7 +867,7 @@ protected static function parseCommand()
if (static::$_OS !== \OS_TYPE_LINUX) {
return;
}
$argv = $_SERVER['argv'];
global $argv;
// Check argv;
$start_file = $argv[0];
$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";
Expand Down

0 comments on commit 5ea3300

Please sign in to comment.