Merge "Add any prior block to BlockIpComplete hook"
[lhc/web/wiklou.git] / includes / cache / localisation / LocalisationCache.php
index dd7d81a..4970a2b 100644 (file)
@@ -23,6 +23,8 @@
 use Cdb\Reader as CdbReader;
 use Cdb\Writer as CdbWriter;
 use CLDRPluralRuleParser\Evaluator;
+use CLDRPluralRuleParser\Error as CLDRPluralRuleError;
+use MediaWiki\MediaWikiServices;
 
 /**
  * Class for caching the contents of localisation files, Messages*.php
@@ -802,12 +804,15 @@ class LocalisationCache {
         * @return array
         */
        public function getMessagesDirs() {
-               global $wgMessagesDirs, $IP;
+               global $IP;
+
+               $config = MediaWikiServices::getInstance()->getMainConfig();
+               $messagesDirs = $config->get( 'MessagesDirs' );
                return [
                        'core' => "$IP/languages/i18n",
                        'api' => "$IP/includes/api/i18n",
                        'oojs-ui' => "$IP/resources/lib/oojs-ui/i18n",
-               ] + $wgMessagesDirs;
+               ] + $messagesDirs;
        }
 
        /**
@@ -958,8 +963,9 @@ class LocalisationCache {
 
                # Add cache dependencies for any referenced globals
                $deps['wgExtensionMessagesFiles'] = new GlobalDependency( 'wgExtensionMessagesFiles' );
-               // $wgMessagesDirs is used in LocalisationCache::getMessagesDirs()
-               $deps['wgMessagesDirs'] = new GlobalDependency( 'wgMessagesDirs' );
+               // The 'MessagesDirs' config setting is used in LocalisationCache::getMessagesDirs().
+               // We use the key 'wgMessagesDirs' for historical reasons.
+               $deps['wgMessagesDirs'] = new MainConfigDependency( 'MessagesDirs' );
                $deps['version'] = new ConstantDependency( 'LocalisationCache::VERSION' );
 
                # Add dependencies to the cache entry