From: Chad Horohoe Date: Sun, 2 Aug 2009 19:56:24 +0000 (+0000) Subject: Forgot to bring doRebuild() along :) X-Git-Tag: 1.31.0-rc.0~40569 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=b80f81d4f1b1066059db1a4adfdd469d8ab5d79d;p=lhc%2Fweb%2Fwiklou.git Forgot to bring doRebuild() along :) --- diff --git a/maintenance/rebuildLocalisationCache.php b/maintenance/rebuildLocalisationCache.php index 632b9eaccf..1e7a747449 100644 --- a/maintenance/rebuildLocalisationCache.php +++ b/maintenance/rebuildLocalisationCache.php @@ -67,11 +67,11 @@ class RebuildLocalisationCache extends Maintenance { if ( $pid === 0 ) { // Child - doRebuild( $codes, $numRebuilt, $lc, $force ); + $this->doRebuild( $codes, $numRebuilt, $lc, $force ); exit(); } elseif ($pid === -1) { // Fork failed or one thread, do it serialized - doRebuild( $codes, $numRebuilt, $lc, $force ); + $this->doRebuild( $codes, $numRebuilt, $lc, $force ); } else { // Main thread $pids[] = $pid; @@ -85,6 +85,20 @@ class RebuildLocalisationCache extends Maintenance { $this->output( "Use --force to rebuild the caches which are still fresh.\n" ); } } + + /** + * Rebuild language cache + * @todo Document + */ + private function doRebuild( $codes, &$numRebuilt, $lc, $force ) { + foreach ( $codes as $code ) { + if ( $force || $lc->isExpired( $code ) ) { + $this->output( "Rebuilding $code...\n" ); + $lc->recache( $code ); + $numRebuilt++; + } + } + } } $maintClass = "RebuildLocalisationCache";