Use HTTPS instead of HTTP for Amazon
[lhc/web/wiklou.git] / includes / registration / ExtensionRegistry.php
index 76d25b6..344dd8f 100644 (file)
@@ -31,7 +31,7 @@ class ExtensionRegistry {
        /**
         * Bump whenever the registration cache needs resetting
         */
-       const CACHE_VERSION = 4;
+       const CACHE_VERSION = 5;
 
        /**
         * Special key that defines the merge strategy
@@ -40,11 +40,6 @@ class ExtensionRegistry {
         */
        const MERGE_STRATEGY = '_merge_strategy';
 
-       /**
-        * @var BagOStuff
-        */
-       protected $cache;
-
        /**
         * Array of loaded things, keyed by name, values are credits information
         *
@@ -90,16 +85,6 @@ class ExtensionRegistry {
                return self::$instance;
        }
 
-       public function __construct() {
-               // We use a try/catch because we don't want to fail here
-               // if $wgObjectCaches is not configured properly for APC setup
-               try {
-                       $this->cache = MediaWikiServices::getInstance()->getLocalServerObjectCache();
-               } catch ( MWException $e ) {
-                       $this->cache = new EmptyBagOStuff();
-               }
-       }
-
        /**
         * @param string $path Absolute path to the JSON file
         */
@@ -144,12 +129,19 @@ class ExtensionRegistry {
                        'mediawiki' => $wgVersion
                ];
 
+               // We use a try/catch because we don't want to fail here
+               // if $wgObjectCaches is not configured properly for APC setup
+               try {
+                       $cache = MediaWikiServices::getInstance()->getLocalServerObjectCache();
+               } catch ( MWException $e ) {
+                       $cache = new EmptyBagOStuff();
+               }
                // See if this queue is in APC
                $key = wfMemcKey(
                        'registration',
                        md5( json_encode( $this->queued + $versions ) )
                );
-               $data = $this->cache->get( $key );
+               $data = $cache->get( $key );
                if ( $data ) {
                        $this->exportExtractedData( $data );
                } else {
@@ -159,7 +151,7 @@ class ExtensionRegistry {
                        // did that, but it should be cached
                        $data['globals']['wgAutoloadClasses'] += $data['autoload'];
                        unset( $data['autoload'] );
-                       $this->cache->set( $key, $data, 60 * 60 * 24 );
+                       $cache->set( $key, $data, 60 * 60 * 24 );
                }
                $this->queued = [];
        }
@@ -203,8 +195,7 @@ class ExtensionRegistry {
                $autoloadClasses = [];
                $autoloaderPaths = [];
                $processor = new ExtensionProcessor();
-               $versionChecker = new VersionChecker();
-               $versionChecker->setCoreVersion( $wgVersion );
+               $versionChecker = new VersionChecker( $wgVersion );
                $extDependencies = [];
                $incompatible = [];
                foreach ( $queue as $path => $mtime ) {