From: Sam Reed Date: Tue, 1 Nov 2011 07:34:56 +0000 (+0000) Subject: Followup r101449, just changing forceRecache isn't actually enough X-Git-Tag: 1.31.0-rc.0~26792 X-Git-Url: http://git.cyclocoop.org//%22%22._DIR_PLUGIN_FULLCALENDAR.%22prive/themes/spip/images/event_edit.png/%22?a=commitdiff_plain;h=39ece40f466e7a9c3e9000c65533c7ddb772e60d;p=lhc%2Fweb%2Fwiklou.git Followup r101449, just changing forceRecache isn't actually enough Add a method to set force to true on the options array to RebuildLocalisationCache --- diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 6461da8ea5..74105943d9 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -621,10 +621,12 @@ abstract class DatabaseUpdater { } protected function doRebuildLocalisationCache() { - global $wgLocalisationCacheConf; - $wgLocalisationCacheConf['forceRecache'] = true; + /** + * @var $cl RebuildLocalisationCache + */ $cl = $this->maintenance->runChild( 'RebuildLocalisationCache', 'rebuildLocalisationCache.php' ); $this->output( "Rebuilding localisation cache...\n" ); + $cl->setForce(); $cl->execute(); $this->output( "Rebuilding localisation cache done.\n" ); } diff --git a/maintenance/rebuildLocalisationCache.php b/maintenance/rebuildLocalisationCache.php index 0ca99610e9..831d808ae6 100644 --- a/maintenance/rebuildLocalisationCache.php +++ b/maintenance/rebuildLocalisationCache.php @@ -112,9 +112,9 @@ class RebuildLocalisationCache extends Maintenance { * Helper function to rebuild list of languages codes. Prints the code * for each language which is rebuilt. * @param $codes list List of language codes to rebuild. - * @param $lc object Instance of LocalisationCache_BulkLoad (?) - * @param $force bool Rebuild up-to-date languages - * @return int Number of rebuilt languages + * @param $lc LocalisationCache Instance of LocalisationCache_BulkLoad (?) + * @param $force bool Rebuild up-to-date languages + * @return int Number of rebuilt languages */ private function doRebuild( $codes, $lc, $force ) { $numRebuilt = 0; @@ -127,6 +127,15 @@ class RebuildLocalisationCache extends Maintenance { } return $numRebuilt; } + + /** + * Sets whether a run of this maintenance script has the force parameter set + * + * @param bool $forced + */ + public function setForce( $forced = true ) { + $this->mOptions['force'] = $forced; + } } $maintClass = "RebuildLocalisationCache";