From 0483765086760f604dc72cab6302d42e786b99b9 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Fri, 2 Feb 2018 23:19:43 +0100 Subject: [PATCH] convertExtensionToRegistration: Set requires key in extension.json 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 | 7 +++++++ maintenance/convertExtensionToRegistration.php | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/includes/registration/ExtensionRegistry.php b/includes/registration/ExtensionRegistry.php index ae1ab58906..bb4c7fd02a 100644 --- a/includes/registration/ExtensionRegistry.php +++ b/includes/registration/ExtensionRegistry.php @@ -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 */ diff --git a/maintenance/convertExtensionToRegistration.php b/maintenance/convertExtensionToRegistration.php index 0205311ae1..4ae9558703 100644 --- a/maintenance/convertExtensionToRegistration.php +++ b/maintenance/convertExtensionToRegistration.php @@ -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; -- 2.20.1