Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -2346,21 +2346,24 @@ |
2347 | 2347 | } |
2348 | 2348 | |
2349 | 2349 | /** |
2350 | | - * Executes a shell command in the background. Passes back the PID of the operation |
| 2350 | + * Executes a shell command in the background. Returns true of successful. |
2351 | 2351 | * |
2352 | | - * FIXME: Does not work on Windows; does not work at all (See CodeReview r55575) |
2353 | | - * |
2354 | 2352 | * @param $cmd String |
2355 | 2353 | */ |
2356 | | -function wfShellBackgroundExec( $cmd ){ |
| 2354 | +function wfShellBackgroundExec( $cmd ) { |
2357 | 2355 | wfDebug( "wfShellBackgroundExec: $cmd\n" ); |
2358 | 2356 | |
2359 | 2357 | if ( ! wfShellExecEnabled() ) { |
2360 | | - return "Unable to run external programs"; |
| 2358 | + return false; |
2361 | 2359 | } |
2362 | 2360 | |
2363 | | - $pid = shell_exec( "nohup $cmd > /dev/null & echo $!" ); |
2364 | | - return $pid; |
| 2361 | + if ( wfIsWindows() ) { |
| 2362 | + shell_exec( "start /b $cmd >nul"); |
| 2363 | + return true; |
| 2364 | + } else { |
| 2365 | + $pid = shell_exec( "nohup $cmd > /dev/null & echo $!" ); |
| 2366 | + return (bool)$pid; |
| 2367 | + } |
2365 | 2368 | } |
2366 | 2369 | |
2367 | 2370 | /** |