Add tests for ExtensionJsonValidator
[lhc/web/wiklou.git] / includes / registration / ExtensionRegistry.php
index 994de97..bb4c7fd 100644 (file)
@@ -20,9 +20,16 @@ class ExtensionRegistry {
 
        /**
         * Version of the highest supported manifest version
+        * Note: Update MANIFEST_VERSION_MW_VERSION when changing this
         */
        const MANIFEST_VERSION = 2;
 
+       /**
+        * MediaWiki version constraint representing what the current
+        * highest MANIFEST_VERSION is supported in
+        */
+       const MANIFEST_VERSION_MW_VERSION = '>= 1.29.0';
+
        /**
         * Version of the oldest supported manifest version
         */
@@ -291,7 +298,7 @@ class ExtensionRegistry {
 
                        // Optimistic: If the global is not set, or is an empty array, replace it entirely.
                        // Will be O(1) performance.
-                       if ( !isset( $GLOBALS[$key] ) || ( is_array( $GLOBALS[$key] ) && !$GLOBALS[$key] ) ) {
+                       if ( !array_key_exists( $key, $GLOBALS ) || ( is_array( $GLOBALS[$key] ) && !$GLOBALS[$key] ) ) {
                                $GLOBALS[$key] = $val;
                                continue;
                        }
@@ -323,7 +330,7 @@ class ExtensionRegistry {
                }
 
                if ( isset( $info['autoloaderNS'] ) ) {
-                       Autoloader::$psr4Namespaces += $info['autoloaderNS'];
+                       AutoLoader::$psr4Namespaces += $info['autoloaderNS'];
                }
 
                foreach ( $info['defines'] as $name => $val ) {