r101454 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101453‎ | r101454 | r101455 >
Date:07:34, 1 November 2011
Author:reedy
Status:ok
Tags:
Comment:
Followup r101449, just changing forceRecache isn't actually enough

Add a method to set force to true on the options array to RebuildLocalisationCache
Modified paths:
  • /trunk/phase3/includes/installer/DatabaseUpdater.php (modified) (history)
  • /trunk/phase3/maintenance/rebuildLocalisationCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/rebuildLocalisationCache.php
@@ -112,9 +112,9 @@
113113 * Helper function to rebuild list of languages codes. Prints the code
114114 * for each language which is rebuilt.
115115 * @param $codes list List of language codes to rebuild.
116 - * @param $lc object Instance of LocalisationCache_BulkLoad (?)
117 - * @param $force bool Rebuild up-to-date languages
118 - * @return int Number of rebuilt languages
 116+ * @param $lc LocalisationCache Instance of LocalisationCache_BulkLoad (?)
 117+ * @param $force bool Rebuild up-to-date languages
 118+ * @return int Number of rebuilt languages
119119 */
120120 private function doRebuild( $codes, $lc, $force ) {
121121 $numRebuilt = 0;
@@ -127,6 +127,15 @@
128128 }
129129 return $numRebuilt;
130130 }
 131+
 132+ /**
 133+ * Sets whether a run of this maintenance script has the force parameter set
 134+ *
 135+ * @param bool $forced
 136+ */
 137+ public function setForce( $forced = true ) {
 138+ $this->mOptions['force'] = $forced;
 139+ }
131140 }
132141
133142 $maintClass = "RebuildLocalisationCache";
Index: trunk/phase3/includes/installer/DatabaseUpdater.php
@@ -621,10 +621,12 @@
622622 }
623623
624624 protected function doRebuildLocalisationCache() {
625 - global $wgLocalisationCacheConf;
626 - $wgLocalisationCacheConf['forceRecache'] = true;
 625+ /**
 626+ * @var $cl RebuildLocalisationCache
 627+ */
627628 $cl = $this->maintenance->runChild( 'RebuildLocalisationCache', 'rebuildLocalisationCache.php' );
628629 $this->output( "Rebuilding localisation cache...\n" );
 630+ $cl->setForce();
629631 $cl->execute();
630632 $this->output( "Rebuilding localisation cache done.\n" );
631633 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r101897REL1_18 MFT r101449, r101450, r101454reedy22:29, 3 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r101449Bug 30934 - Warning: Invalid argument supplied for foreach() in /languages/La...reedy05:23, 1 November 2011

Status & tagging log