X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrebuildLocalisationCache.php;h=4213d5f85d9f97405ea74b7dcfb7348f6d406dea;hb=70532ff53fae4442bd776df70b849acdb3714679;hp=36caa3a884406fa111c015447e36f1332d3d2af5;hpb=630a39ce6b686872db84c2c2d022bb6c26bf23a8;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildLocalisationCache.php b/maintenance/rebuildLocalisationCache.php index 36caa3a884..4213d5f85d 100644 --- a/maintenance/rebuildLocalisationCache.php +++ b/maintenance/rebuildLocalisationCache.php @@ -92,7 +92,7 @@ class RebuildLocalisationCache extends Maintenance { explode( ',', $this->getOption( 'lang' ) ) ); # Bailed out if nothing is left if ( count( $codes ) == 0 ) { - $this->error( 'None of the languages specified exists.', 1 ); + $this->fatalError( 'None of the languages specified exists.' ); } } else { # By default get all languages @@ -104,7 +104,7 @@ class RebuildLocalisationCache extends Maintenance { $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 @@ -112,8 +112,9 @@ class RebuildLocalisationCache extends Maintenance { if ( $pid === 0 ) { // Child, reseed because there is no bug in PHP: - // http://bugs.php.net/bug.php?id=42465 + // https://bugs.php.net/bug.php?id=42465 mt_srand( getmypid() ); + $this->doRebuild( $codes, $lc, $force ); exit( 0 ); } elseif ( $pid === -1 ) { @@ -176,5 +177,5 @@ class RebuildLocalisationCache extends Maintenance { } } -$maintClass = "RebuildLocalisationCache"; +$maintClass = RebuildLocalisationCache::class; require_once RUN_MAINTENANCE_IF_MAIN;