summaryrefslogtreecommitdiff
path: root/includes/Wiki.php
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-05-05 15:30:48 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-05-05 15:30:48 -0400
commit3d86add3dfa5e0b3ead9859593d4a52cf7555a34 (patch)
tree453d8bd3fda4dbb3020017ea1a469291da5cdc71 /includes/Wiki.php
parent064cec79ca4c8201de0d06bbca6cb7a5345d11be (diff)
parent2e44b49a2db3026050b136de9b00f749dd3ff939 (diff)
Merge branch 'archwiki'
Diffstat (limited to 'includes/Wiki.php')
-rw-r--r--includes/Wiki.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/includes/Wiki.php b/includes/Wiki.php
index ae75bf33..074ec1ab 100644
--- a/includes/Wiki.php
+++ b/includes/Wiki.php
@@ -653,12 +653,19 @@ class MediaWiki {
}
if ( !wfShellExecDisabled() && is_executable( $wgPhpCli ) ) {
- // Start a background process to run some of the jobs.
- // This will be asynchronous on *nix though not on Windows.
+ // Start a background process to run some of the jobs
wfProfileIn( __METHOD__ . '-exec' );
$retVal = 1;
$cmd = wfShellWikiCmd( "$IP/maintenance/runJobs.php", array( '--maxjobs', $n ) );
- wfShellExec( "$cmd &", $retVal );
+ $cmd .= " >" . wfGetNull() . " 2>&1"; // don't hang PHP on pipes
+ if ( wfIsWindows() ) {
+ // Using START makes this async and also works around a bug where using
+ // wfShellExec() with a quoted script name causes a filename syntax error.
+ $cmd = "START /B \"bg\" $cmd";
+ } else {
+ $cmd = "$cmd &";
+ }
+ wfShellExec( $cmd, $retVal );
wfProfileOut( __METHOD__ . '-exec' );
} else {
try {