r54229 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54228‎ | r54229 | r54230 >
Date:19:56, 2 August 2009
Author:demon
Status:ok
Tags:
Comment:
Forgot to bring doRebuild() along :)
Modified paths:
  • /trunk/phase3/maintenance/rebuildLocalisationCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/rebuildLocalisationCache.php
@@ -67,11 +67,11 @@
6868
6969 if ( $pid === 0 ) {
7070 // Child
71 - doRebuild( $codes, $numRebuilt, $lc, $force );
 71+ $this->doRebuild( $codes, $numRebuilt, $lc, $force );
7272 exit();
7373 } elseif ($pid === -1) {
7474 // Fork failed or one thread, do it serialized
75 - doRebuild( $codes, $numRebuilt, $lc, $force );
 75+ $this->doRebuild( $codes, $numRebuilt, $lc, $force );
7676 } else {
7777 // Main thread
7878 $pids[] = $pid;
@@ -85,6 +85,20 @@
8686 $this->output( "Use --force to rebuild the caches which are still fresh.\n" );
8787 }
8888 }
 89+
 90+ /**
 91+ * Rebuild language cache
 92+ * @todo Document
 93+ */
 94+ private function doRebuild( $codes, &$numRebuilt, $lc, $force ) {
 95+ foreach ( $codes as $code ) {
 96+ if ( $force || $lc->isExpired( $code ) ) {
 97+ $this->output( "Rebuilding $code...\n" );
 98+ $lc->recache( $code );
 99+ $numRebuilt++;
 100+ }
 101+ }
 102+ }
89103 }
90104
91105 $maintClass = "RebuildLocalisationCache";

Status & tagging log