Переглянути джерело

Merge pull request #708 from Yurunsoft/fix-argv

Do not modify the global variable $argv
walkor 3 роки тому
батько
коміт
50d0d403ba
1 змінених файлів з 5 додано та 4 видалено
  1. 5 4
      Worker.php

+ 5 - 4
Worker.php

@@ -803,14 +803,15 @@ class Worker
         !empty($content) && static::safeEcho($line_last);
 
         if (static::$daemonize) {
-            foreach ($argv as $index => $value) {
+            $tmpArgv = $argv;
+            foreach ($tmpArgv as $index => $value) {
                 if ($value == '-d') {
-                    unset($argv[$index]);
+                    unset($tmpArgv[$index]);
                 } elseif ($value == 'start' || $value == 'restart') {
-                    $argv[$index] = 'stop';
+                    $tmpArgv[$index] = 'stop';
                 }
             }
-            static::safeEcho("Input \"php ".implode(' ', $argv)."\" to stop. Start success.\n\n");
+            static::safeEcho("Input \"php ".implode(' ', $tmpArgv)."\" to stop. Start success.\n\n");
         } else {
             static::safeEcho("Press Ctrl+C to stop. Start success.\n");
         }