From: Chad Horohoe Date: Wed, 6 Nov 2013 23:31:25 +0000 (-0800) Subject: Work around HHVM bug with stdin/stdout in proc_open() X-Git-Tag: 1.31.0-rc.0~18227 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=52e546640c5c0c0e817ae1fc5451a934b2c34de9;p=lhc%2Fweb%2Fwiklou.git Work around HHVM bug with stdin/stdout in proc_open() Bug: 56597 Change-Id: I06122d82fce4567be110ca25010c244dd9269c57 --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 93a2b029f0..1eb5c3e62a 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2855,6 +2855,15 @@ function wfShellExec( $cmd, &$retval = null, $environ = array(), if ( $useLogPipe ) { $desc[3] = array( 'pipe', 'w' ); } + + # TODO/FIXME: This is a bad hack to workaround an HHVM bug that prevents + # proc_open() from opening stdin/stdout, so use /dev/null *for now* + # See bug 56597 / https://github.com/facebook/hhvm/issues/1247 for more info + if ( wfIsHHVM() ) { + $desc[0] = array( 'file', '/dev/null', 'r' ); + $desc[2] = array( 'file', '/dev/null', 'w' ); + } + $pipes = null; $proc = proc_open( $cmd, $desc, $pipes ); if ( !$proc ) {