Follow-up If8dfdaf1: Hard-deprecate, drop two uses, other pre-5.3 back-compat code
authorJames D. Forrester <jforrester@wikimedia.org>
Fri, 25 May 2018 00:01:02 +0000 (17:01 -0700)
committerJames D. Forrester <jforrester@wikimedia.org>
Fri, 25 May 2018 00:01:02 +0000 (17:01 -0700)
Change-Id: I1c5eee3fe30d6687d88e07011a3d40b6770d0daf

includes/collation/IcuCollation.php
includes/specials/SpecialVersion.php
maintenance/language/generateCollationData.php

index f38396d..d6ab0ff 100644 (file)
@@ -535,6 +535,7 @@ class IcuCollation extends Collation {
         * @return string
         */
        static function getICUVersion() {
+               wfDeprecated( __METHOD__, '1.32' );
                return INTL_ICU_VERSION;
        }
 
index 48728a3..d4e5151 100644 (file)
@@ -233,9 +233,7 @@ class SpecialVersion extends SpecialPage {
                }
                $software[$dbr->getSoftwareLink()] = $dbr->getServerInfo();
 
-               if ( IcuCollation::getICUVersion() ) {
-                       $software['[http://site.icu-project.org/ ICU]'] = IcuCollation::getICUVersion();
-               }
+               $software['[http://site.icu-project.org/ ICU]'] = INTL_ICU_VERSION;
 
                // Allow a hook to add/remove items.
                Hooks::run( 'SoftwareInfo', [ &$software ] );
index aec9252..d30a077 100644 (file)
@@ -71,7 +71,7 @@ class GenerateCollationData extends Maintenance {
                $ucdallURL = "https://www.unicode.org/Public/<Unicode version>/ucdxml/ucd.all.grouped.zip";
 
                if ( !$allkeysPresent || !$ucdallPresent ) {
-                       $icuVersion = IcuCollation::getICUVersion();
+                       $icuVersion = INTL_ICU_VERSION;
                        $unicodeVersion = IcuCollation::getUnicodeVersionForICU();
 
                        $error = "";
@@ -88,16 +88,7 @@ class GenerateCollationData extends Maintenance {
                        }
 
                        $versionKnown = false;
-                       if ( !$icuVersion ) {
-                               // Unknown version - either very old intl,
-                               // or PHP < 5.3.7 which does not expose this information
-                               $error .= "As MediaWiki could not determine the version of ICU library used by your PHP's "
-                                       . "intl extension it can't suggest which file version to download. "
-                                       . "This can be caused by running a very old version of intl or PHP < 5.3.7. "
-                                       . "If you are sure everything is all right, find out the ICU version "
-                                       . "by running phpinfo(), check what is the Unicode version it is using "
-                                       . "at http://site.icu-project.org/download, then try finding appropriate data file(s) at:";
-                       } elseif ( version_compare( $icuVersion, "4.0", "<" ) ) {
+                       if ( version_compare( $icuVersion, "4.0", "<" ) ) {
                                // Extra old version
                                $error .= "You are using outdated version of ICU ($icuVersion), intended for "
                                        . ( $unicodeVersion ? "Unicode $unicodeVersion" : "an unknown version of Unicode" )