From: Kevin Israel Date: Sat, 13 Feb 2016 00:40:49 +0000 (-0500) Subject: Revert "wfShellExec: Work around PHP 5.3 stream_select() issue" X-Git-Tag: 1.31.0-rc.0~6594^2 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=8175ac82dc972dbca7f975cfa1f7fbfe23057c05;p=lhc%2Fweb%2Fwiklou.git Revert "wfShellExec: Work around PHP 5.3 stream_select() issue" No longer needed. Currently, MediaWiki supports neither PHP 5.3 nor HHVM 3.4 or lower. The minimum HHVM version stated in the Compatibility section of the RELEASE-NOTES file is 3.6.5. This reverts commit 8bd6f698ccb990c9a9d37f495b8b5b7620832018. Change-Id: I2edd25c4ce00eb324f7f6e04b2034ad28f7c6964 --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index d5c6553958..66e244082e 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2499,14 +2499,6 @@ function wfShellExec( $cmd, &$retval = null, $environ = [], $eintr = defined( 'SOCKET_EINTR' ) ? SOCKET_EINTR : 4; $eintrMessage = "stream_select(): unable to select [$eintr]"; - // Build a table mapping resource IDs to pipe FDs to work around a - // PHP 5.3 issue in which stream_select() does not preserve array keys - // . - $fds = []; - foreach ( $pipes as $fd => $pipe ) { - $fds[(int)$pipe] = $fd; - } - $running = true; $timeout = null; $numReadyPipes = 0; @@ -2539,9 +2531,8 @@ function wfShellExec( $cmd, &$retval = null, $environ = [], break; } } - foreach ( $readyPipes as $pipe ) { + foreach ( $readyPipes as $fd => $pipe ) { $block = fread( $pipe, 65536 ); - $fd = $fds[(int)$pipe]; if ( $block === '' ) { // End of file fclose( $pipes[$fd] );