Drop the LanguageGetSpecialPageAliases and LanguageGetMagic hooks
authorJames D. Forrester <jforrester@wikimedia.org>
Mon, 11 Jun 2018 23:50:41 +0000 (16:50 -0700)
committerJames D. Forrester <jforrester@wikimedia.org>
Mon, 29 Oct 2018 22:09:20 +0000 (15:09 -0700)
Deprecated since 1.16 and unused in known git.

Bug: T199291
Change-Id: Idcaf1b2c24c64653f700be4fe810ed124ba4ab7c

RELEASE-NOTES-1.33
docs/hooks.txt
languages/Language.php
languages/messages/MessagesEn.php
languages/messages/MessagesKk_arab.php

index ddccef5..3e7e496 100644 (file)
@@ -97,6 +97,9 @@ because of Phabricator reports.
   that LoginSignupSpecialPage->getBCFieldDefinitions() is removed.
 * The 'jquery.localize' module, deprecated in 1.32, has been removed. Instead,
   use 'jquery.i18n'.
+* The hooks LanguageGetSpecialPageAliases and LanguageGetMagic, deprecated since
+  1.16, have now been removed. Instead, use $specialPageAliases or $magicWords
+  respectively in a $wgExtensionMessagesFiles file.
 * …
 
 === Deprecations in 1.33 ===
index 66967e0..14656fa 100644 (file)
@@ -1962,23 +1962,11 @@ $user: User the password is being validated for
 $code: The language code or the language we're looking for a messages file for
 &$file: The messages file path, you can override this to change the location.
 
-'LanguageGetMagic': DEPRECATED since 1.16! Use $magicWords in a file listed in
-$wgExtensionMessagesFiles instead.
-Use this to define synonyms of magic words depending of the language
-&$magicExtensions: associative array of magic words synonyms
-$lang: language code (string)
-
 'LanguageGetNamespaces': Provide custom ordering for namespaces or
 remove namespaces. Do not use this hook to add namespaces. Use
 CanonicalNamespaces for that.
 &$namespaces: Array of namespaces indexed by their numbers
 
-'LanguageGetSpecialPageAliases': DEPRECATED! Use $specialPageAliases in a file
-listed in $wgExtensionMessagesFiles instead.
-Use to define aliases of special pages names depending of the language
-&$specialPageAliases: associative array of magic words synonyms
-$lang: language code (string)
-
 'LanguageGetTranslatedLanguageNames': Provide translated language names.
 &$names: array of language code => language name
 $code: language of the preferred translations
index 86f4505..aa287e9 100644 (file)
@@ -58,7 +58,7 @@ class Language {
        public $mConverter;
 
        public $mVariants, $mCode, $mLoaded = false;
-       public $mMagicExtensions = [], $mMagicHookDone = false;
+       public $mMagicExtensions = [];
        private $mHtmlCode = null, $mParentLanguage = false;
 
        public $dateFormatStrings = [];
@@ -3205,28 +3205,12 @@ class Language {
                return self::$dataCache->getItem( $this->mCode, 'magicWords' );
        }
 
-       /**
-        * Run the LanguageGetMagic hook once.
-        */
-       protected function doMagicHook() {
-               if ( $this->mMagicHookDone ) {
-                       return;
-               }
-               $this->mMagicHookDone = true;
-               Hooks::run( 'LanguageGetMagic', [ &$this->mMagicExtensions, $this->getCode() ], '1.16' );
-       }
-
        /**
         * Fill a MagicWord object with data from here
         *
         * @param MagicWord $mw
         */
        function getMagic( $mw ) {
-               // Saves a function call
-               if ( !$this->mMagicHookDone ) {
-                       $this->doMagicHook();
-               }
-
                $rawEntry = $this->mMagicExtensions[$mw->mId] ??
                        self::$dataCache->getSubitem( $this->mCode, 'magicWords', $mw->mId );
 
@@ -3264,8 +3248,6 @@ class Language {
                        // Initialise array
                        $this->mExtendedSpecialPageAliases =
                                self::$dataCache->getItem( $this->mCode, 'specialPageAliases' );
-                       Hooks::run( 'LanguageGetSpecialPageAliases',
-                               [ &$this->mExtendedSpecialPageAliases, $this->getCode() ], '1.16' );
                }
 
                return $this->mExtendedSpecialPageAliases;
index 4c078a6..587f6ea 100644 (file)
@@ -207,8 +207,6 @@ $bookstoreList = [
  *     used aliases. The aliases SHOULD be sorted by the following convention:
  *     1. Local first, English last, then
  *     2. Most common first, least common last.
- *
- * This array can be modified at runtime with the LanguageGetMagic hook
  */
 $magicWords = [
 #   ID                               CASE  SYNONYMS
@@ -388,9 +386,6 @@ $magicWords = [
  * Alternate names of special pages. All names are case-insensitive. The first
  * listed alias will be used as the default. Aliases from the fallback
  * localisation (usually English) will be included by default.
- *
- * This array may be altered at runtime using the LanguageGetSpecialPageAliases
- * hook.
  */
 $specialPageAliases = [
        'Activeusers'               => [ 'ActiveUsers' ],
index 2ff8c61..d7154e9 100644 (file)
@@ -162,8 +162,6 @@ $dateFormats = [
  *   Please include the English words as synonyms.  This allows people
  *   from other wikis to contribute more easily.
  *   Please don't remove deprecated values, them should be keeped for backward compatibility.
- *
- * This array can be modified at runtime with the LanguageGetMagic hook
  */
 $magicWords = [
        'redirect'                  => [ '0', '#ايداۋ', '#АЙДАУ', '#REDIRECT' ],