X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fshell%2FCommand.php;h=1154e05886de77ef821233ba3fb591faa2959c2a;hb=ac8d0d9bcda4cf8132e088af2f847c026b9fe1ef;hp=d9fa82dfa3ecf628370b54dc315c44a98f594439;hpb=6e65e0ab0d0dc5e7e0ea000f024a3481da35505b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/shell/Command.php b/includes/shell/Command.php index d9fa82dfa3..1154e05886 100644 --- a/includes/shell/Command.php +++ b/includes/shell/Command.php @@ -429,7 +429,7 @@ class Command { } // clear get_last_error without actually raising an error - // from http://php.net/manual/en/function.error-get-last.php#113518 + // from https://secure.php.net/manual/en/function.error-get-last.php#113518 // TODO replace with clear_last_error when requirements are bumped to PHP7 set_error_handler( function () { }, 0 ); @@ -437,12 +437,12 @@ class Command { @trigger_error( '' ); restore_error_handler(); - $readPipes = wfArrayFilterByKey( $pipes, function ( $fd ) use ( $desc ) { + $readPipes = array_filter( $pipes, function ( $fd ) use ( $desc ) { return $desc[$fd][0] === 'pipe' && $desc[$fd][1] === 'r'; - } ); - $writePipes = wfArrayFilterByKey( $pipes, function ( $fd ) use ( $desc ) { + }, ARRAY_FILTER_USE_KEY ); + $writePipes = array_filter( $pipes, function ( $fd ) use ( $desc ) { return $desc[$fd][0] === 'pipe' && $desc[$fd][1] === 'w'; - } ); + }, ARRAY_FILTER_USE_KEY ); // stream_select parameter names are from the POV of us being able to do the operation; // proc_open desriptor types are from the POV of the process doing it. // So $writePipes is passed as the $read parameter and $readPipes as $write.