File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -786,13 +786,15 @@ private static function terminate_proc( $master_pid ): void {
786786
787787 $ output = shell_exec ( "ps -o ppid,pid,command | grep $ master_pid " );
788788
789- foreach ( explode ( PHP_EOL , $ output ) as $ line ) {
790- if ( preg_match ( '/^\s*(\d+)\s+(\d+)/ ' , $ line , $ matches ) ) {
791- $ parent = $ matches [1 ];
792- $ child = $ matches [2 ];
793-
794- if ( (int ) $ parent === (int ) $ master_pid ) {
795- self ::terminate_proc ( (int ) $ child );
789+ if ( is_string ( $ output ) ) {
790+ foreach ( explode ( PHP_EOL , $ output ) as $ line ) {
791+ if ( preg_match ( '/^\s*(\d+)\s+(\d+)/ ' , $ line , $ matches ) ) {
792+ $ parent = $ matches [1 ];
793+ $ child = $ matches [2 ];
794+
795+ if ( (int ) $ parent === (int ) $ master_pid ) {
796+ self ::terminate_proc ( (int ) $ child );
797+ }
796798 }
797799 }
798800 }
You can’t perform that action at this time.
0 commit comments