class RebuildLocalisationCache extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Rebuild the localisation cache";
+ $this->addDescription( 'Rebuild the localisation cache' );
$this->addOption( 'force', 'Rebuild all files, even ones not out of date' );
$this->addOption( 'threads', 'Fork more than one thread', false, true );
$this->addOption( 'outdir', 'Override the output directory (normally $wgCacheDirectory)',
$numRebuilt = 0;
$total = count( $codes );
$chunks = array_chunk( $codes, ceil( count( $codes ) / $threads ) );
- $pids = array();
+ $pids = [];
$parentStatus = 0;
foreach ( $chunks as $codes ) {
// Do not fork for only one thread
// Child, reseed because there is no bug in PHP:
// http://bugs.php.net/bug.php?id=42465
mt_srand( getmypid() );
+
$this->doRebuild( $codes, $lc, $force );
exit( 0 );
} elseif ( $pid === -1 ) {