From b80f81d4f1b1066059db1a4adfdd469d8ab5d79d Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sun, 2 Aug 2009 19:56:24 +0000 Subject: [PATCH] Forgot to bring doRebuild() along :) --- maintenance/rebuildLocalisationCache.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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"; -- 2.20.1