Index: trunk/phase3/maintenance/rebuildLocalisationCache.php |
— | — | @@ -45,6 +45,18 @@ |
46 | 46 | |
47 | 47 | $force = $this->hasOption('force'); |
48 | 48 | $threads = $this->getOption( 'threads', 1 ); |
| 49 | + if( $threads < 1 || $threads != intval( $threads ) ) { |
| 50 | + $this->output( "Invalid thread count specified; running single-threaded.\n" ); |
| 51 | + $threads = 1; |
| 52 | + } |
| 53 | + if( $threads > 1 && wfIsWindows() ) { |
| 54 | + $this->output( "Threaded rebuild is not supported on Windows; running single-threaded.\n" ); |
| 55 | + $threads = 1; |
| 56 | + } |
| 57 | + if( $threads > 1 && !function_exists( 'pcntl_fork' ) ) { |
| 58 | + $this->output( "PHP pcntl extension is not present; running single-threaded.\n" ); |
| 59 | + $threads = 1; |
| 60 | + } |
49 | 61 | |
50 | 62 | $conf = $wgLocalisationCacheConf; |
51 | 63 | $conf['manualRecache'] = false; // Allow fallbacks to create CDB files |