convertExtensionToRegistration: Set requires key in extension.json
authorUmherirrender <umherirrender_de.wp@web.de>
Fri, 2 Feb 2018 22:19:43 +0000 (23:19 +0100)
committerUmherirrender <umherirrender_de.wp@web.de>
Mon, 5 Feb 2018 06:56:24 +0000 (06:56 +0000)
The highest manifest version is not supported from the start of
extension.json
For extensions converted to this highest version the mininum core
version must be specified to avoid load problems in the extension.

Using 1.29.0 for manifest version 2 due to T149757 /
Id1071fc0647892438e5cd0e3ee621fbdaaa64014

Change-Id: Iea5ba589c70958db7500cf3587b5ebd738532026

includes/registration/ExtensionRegistry.php
maintenance/convertExtensionToRegistration.php

index ae1ab58..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
         */
index 0205311..4ae9558 100644 (file)
@@ -144,6 +144,11 @@ class ConvertExtensionToRegistration extends Maintenance {
                                unset( $this->json[$key] );
                        }
                }
+               // Set a requirement on the MediaWiki version that the current MANIFEST_VERSION
+               // was introduced in.
+               $out['requires'] = [
+                       ExtensionRegistry::MEDIAWIKI_CORE => ExtensionRegistry::MANIFEST_VERSION_MW_VERSION
+               ];
                $out += $this->json;
                // Put this at the bottom
                $out['manifest_version'] = ExtensionRegistry::MANIFEST_VERSION;