Skip to content

Commit 5ea3300

Browse files
committed
parse command use $argv
1 parent 580c247 commit 5ea3300

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Worker.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Worker
3333
*
3434
* @var string
3535
*/
36-
const VERSION = '4.0.15';
36+
const VERSION = '4.0.16';
3737

3838
/**
3939
* Status starting.
@@ -756,7 +756,7 @@ protected static function getCurrentUser()
756756
*/
757757
protected static function displayUI()
758758
{
759-
$argv = $_SERVER['argv'];
759+
global $argv;
760760
if (\in_array('-q', $argv)) {
761761
return;
762762
}
@@ -867,7 +867,7 @@ protected static function parseCommand()
867867
if (static::$_OS !== \OS_TYPE_LINUX) {
868868
return;
869869
}
870-
$argv = $_SERVER['argv'];
870+
global $argv;
871871
// Check argv;
872872
$start_file = $argv[0];
873873
$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";

0 commit comments

Comments
 (0)