PleaseStand has uploaded a new change for review.
https://gerrit.wikimedia.org/r/92607
Change subject: wfShellExec: Work around PHP 5.3 stream_select() issue
......................................................................
wfShellExec: Work around PHP 5.3 stream_select() issue
Bug: 56360
Change-Id: I66f2dc8a2f43236799c23f6e25bbbd0a440f4283
---
M includes/GlobalFunctions.php
1 file changed, 9 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/07/92607/1
diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 7547d74..07f9ac1 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -2837,6 +2837,13 @@
$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 (bug
56360).
+ $fds = array();
+ foreach ( $pipes as $fd => $pipe ) {
+ $fds[(int)$pipe] = $fd;
+ }
+
while ( true ) {
$status = proc_get_status( $proc );
if ( !$status['running'] ) {
@@ -2858,8 +2865,9 @@
break;
}
}
- foreach ( $readyPipes as $fd => $pipe ) {
+ foreach ( $readyPipes as $pipe ) {
$block = fread( $pipe, 65536 );
+ $fd = $fds[(int)$pipe];
if ( $block === '' ) {
// End of file
fclose( $pipes[$fd] );
--
To view, visit https://gerrit.wikimedia.org/r/92607
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I66f2dc8a2f43236799c23f6e25bbbd0a440f4283
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: PleaseStand <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits