Merge "(bug 17808) (bug 21167) use real links for search suggestions"
[lhc/web/wiklou.git] / maintenance / rebuildLocalisationCache.php
index c48fb74..db77564 100644 (file)
@@ -29,7 +29,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to rebuild the localisation cache.
@@ -53,6 +53,15 @@ class RebuildLocalisationCache extends Maintenance {
                return '1000M';
        }
 
+       public function finalSetup() {
+               # This script needs to be run to build the inital l10n cache. But if
+               # $wgLanguageCode is not 'en', it won't be able to run because there is
+               # no l10n cache. Break the cycle by forcing $wgLanguageCode = 'en'.
+               global $wgLanguageCode;
+               $wgLanguageCode = 'en';
+               return parent::finalSetup();
+       }
+
        public function execute() {
                global $wgLocalisationCacheConf;