registration: Vary the loaded queue cache on $wgVersion
authorKunal Mehta <legoktm@gmail.com>
Fri, 25 Sep 2015 01:09:41 +0000 (18:09 -0700)
committerKunal Mehta <legoktm@gmail.com>
Fri, 25 Sep 2015 01:09:41 +0000 (18:09 -0700)
If the version changes, we need to recheck the dependency requirements.

Follows-up cef1f31167177ca05c8981d.

Change-Id: I30e95b5dec7b5a1d9ca391fb2ae55e0b3de0c528

includes/registration/ExtensionRegistry.php

index 23e29d8..f91aeff 100644 (file)
@@ -114,12 +114,22 @@ class ExtensionRegistry {
        }
 
        public function loadFromQueue() {
+               global $wgVersion;
                if ( !$this->queued ) {
                        return;
                }
 
+               // A few more things to vary the cache on
+               $versions = array(
+                       'registration' => self::CACHE_VERSION,
+                       'mediawiki' => $wgVersion
+               );
+
                // See if this queue is in APC
-               $key = wfMemcKey( 'registration', md5( json_encode( $this->queued ) ), self::CACHE_VERSION );
+               $key = wfMemcKey(
+                       'registration',
+                       md5( json_encode( $this->queued + $versions ) )
+               );
                $data = $this->cache->get( $key );
                if ( $data ) {
                        $this->exportExtractedData( $data );