From: James D. Forrester Date: Thu, 13 Sep 2018 19:58:58 +0000 (-0700) Subject: Drop wfUseMW, deprecated in 1.26 X-Git-Tag: 1.34.0-rc.0~4091^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=7e0bb365bb8b6cd9b9570526cf0ede71bc6ee2c1 Drop wfUseMW, deprecated in 1.26 Change-Id: I291d6eace1913a651c5e7136f3f2e0216d89fac5 --- diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index e5f83e5fdc..c136450a02 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -305,6 +305,8 @@ because of Phabricator reports. * ChangesListSpecialPage->getCustomFilters() * ChangesListSpecialPage->getFilterGroupDefinitionFromLegacyCustomFilters() * ChangesListSpecialPage::customFilters +* The global function wfUseMW, deprecated since 1.26, has now been removed. Use + the "requires" property of static extension registration instead. === Deprecations in 1.32 === * HTMLForm::setSubmitProgressive() is deprecated. No need to call it. Submit diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 4f121107e2..336cb89e99 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2503,38 +2503,6 @@ function wfUsePHP( $req_ver ) { } } -/** - * This function works like "use VERSION" in Perl except it checks the version - * of MediaWiki, the program will die with a backtrace if the current version - * of MediaWiki is less than the version provided. - * - * This is useful for extensions which due to their nature are not kept in sync - * with releases - * - * Note: Due to the behavior of PHP's version_compare() which is used in this - * function, if you want to allow the 'wmf' development versions add a 'c' (or - * any single letter other than 'a', 'b' or 'p') as a post-fix to your - * targeted version number. For example if you wanted to allow any variation - * of 1.22 use `wfUseMW( '1.22c' )`. Using an 'a' or 'b' instead of 'c' will - * not result in the same comparison due to the internal logic of - * version_compare(). - * - * @see perldoc -f use - * - * @deprecated since 1.26, use the "requires" property of extension.json - * @param string|int|float $req_ver The version to check, can be a string, an integer, or a float - * @throws MWException - */ -function wfUseMW( $req_ver ) { - global $wgVersion; - - wfDeprecated( __FUNCTION__, '1.26' ); - - if ( version_compare( $wgVersion, (string)$req_ver, '<' ) ) { - throw new MWException( "MediaWiki $req_ver required--this is only $wgVersion" ); - } -} - /** * Return the final portion of a pathname. * Reimplemented because PHP5's "basename()" is buggy with multibyte text.