@@ -57,8 +57,11 @@ protected function parseCommandAndConfig()
57
57
$ this ->initConfigAndProperties ($ this ->config );
58
58
59
59
// Debug option to dump the config and exit
60
- if (isset ($ result ['D ' ]) || isset ($ result ['dump ' ])) {
61
- $ val = isset ($ result ['D ' ]) ? $ result ['D ' ] : (isset ($ result ['dump ' ]) ? $ result ['dump ' ] : '' );
60
+ if (isset ($ this ->cliOpts ['D ' ])) {
61
+ $ val = $ this ->cliOpts ['D ' ];
62
+ $ this ->dumpInfo ($ val === 'all ' );
63
+ } elseif (isset ($ this ->cliOpts ['dump ' ])) {
64
+ $ val = $ this ->cliOpts ['dump ' ];
62
65
$ this ->dumpInfo ($ val === 'all ' );
63
66
}
64
67
}
@@ -73,7 +76,7 @@ protected function parseCliOptions()
73
76
]);
74
77
$ this ->fullScript = implode (' ' , $ GLOBALS ['argv ' ]);
75
78
$ this ->script = strpos ($ result [0 ], '.php ' ) ? "php {$ result [0 ]}" : $ result [0 ];
76
- $ this ->command = $ command = isset ( $ result [1 ]) ? $ result [ 1 ] : 'start ' ;
79
+ $ this ->command = $ result [1 ] ?? 'start ' ;
77
80
78
81
unset($ result [0 ], $ result [1 ]);
79
82
@@ -116,8 +119,8 @@ protected function dispatchCommand($command)
116
119
$ this ->reloadWorkers ($ masterPid );
117
120
break ;
118
121
case 'status ' :
119
- $ cmd = isset ( $ result ['cmd ' ]) ? $ result [ ' cmd ' ] : 'status ' ;
120
- $ this ->showStatus ($ cmd , isset ($ result ['watch-status ' ]));
122
+ $ cmd = $ this -> cliOpts ['cmd ' ] ?? 'status ' ;
123
+ $ this ->showStatus ($ cmd , isset ($ this -> cliOpts ['watch-status ' ]));
121
124
break ;
122
125
default :
123
126
$ this ->showHelp ("The command [ {$ command }] is don't supported! " );
0 commit comments