content: Deprecate TitleIsCssOrJsPage and TitleIsWikitextPage hooks
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 3 Dec 2014 04:11:33 +0000 (04:11 +0000)
committerTimo Tijhof <krinklemail@gmail.com>
Wed, 3 Dec 2014 04:11:33 +0000 (04:11 +0000)
They're currently documented as a 'compatibility hook'
in docs/contenthandler.txt. No longer used in any Wikimedia-hosted
git repository.

Superseded by the ContentHandlerDefaultModelFor hook.

Change-Id: I212230da7d6080cf500f930d4aa5a9024959d5f9

RELEASE-NOTES-1.25
docs/hooks.txt
includes/Title.php
includes/content/ContentHandler.php

index 92e0a2c..5d423a1 100644 (file)
@@ -250,6 +250,10 @@ changes to languages because of Bugzilla reports.
   fail for custom tokens registered only via the deprecated ApiTokensGetTokenTypes
   hook. The ApiQueryTokensRegisterTypes hook should be used for this to work.
 * Added wgRelevantArticleId to the client-side config, for use on special pages.
+* Deprecated the TitleIsCssOrJsPage hook. Superseded by the
+  ContentHandlerDefaultModelFor hook since MediaWiki 1.21.
+* Deprecated the TitleIsWikitextPage hook. Superseded by the
+  ContentHandlerDefaultModelFor hook since MediaWiki 1.21.
 
 == Compatibility ==
 
index a4e02c6..062a0c8 100644 (file)
@@ -2692,7 +2692,8 @@ that can be applied.
 $title: The title in question.
 &$types: The types of protection available.
 
-'TitleIsCssOrJsPage': Called when determining if a page is a CSS or JS page.
+'TitleIsCssOrJsPage': DEPRECATED! Use ContentHandlerDefaultModelFor instead.
+Called when determining if a page is a CSS or JS page.
 $title: Title object that is being checked
 $result: Boolean; whether MediaWiki currently thinks this is a CSS/JS page.
   Hooks may change this value to override the return value of
@@ -2713,7 +2714,8 @@ $result: Boolean; whether MediaWiki currently thinks this page is movable.
   Hooks may change this value to override the return value of
   Title::isMovable().
 
-'TitleIsWikitextPage': Called when determining if a page is a wikitext or should
+'TitleIsWikitextPage': DEPRECATED! Use ContentHandlerDefaultModelFor instead.
+Called when determining if a page is a wikitext or should
 be handled by separate handler (via ArticleViewCustom).
 $title: Title object that is being checked
 $result: Boolean; whether MediaWiki currently thinks this is a wikitext page.
index f913859..638da08 100644 (file)
@@ -1250,9 +1250,9 @@ class Title {
 
                # @note This hook is also called in ContentHandler::getDefaultModel.
                #   It's called here again to make sure hook functions can force this
-               #   method to return true even outside the mediawiki namespace.
+               #   method to return true even outside the MediaWiki namespace.
 
-               wfRunHooks( 'TitleIsCssOrJsPage', array( $this, &$isCssOrJsPage ) );
+               wfRunHooks( 'TitleIsCssOrJsPage', array( $this, &$isCssOrJsPage ), '1.25' );
 
                return $isCssOrJsPage;
        }
index ac41722..9aa42dd 100644 (file)
@@ -214,7 +214,7 @@ abstract class ContentHandler {
                }
 
                // Hook can force JS/CSS
-               wfRunHooks( 'TitleIsCssOrJsPage', array( $title, &$isCssOrJsPage ) );
+               wfRunHooks( 'TitleIsCssOrJsPage', array( $title, &$isCssOrJsPage ), '1.25' );
 
                // Is this a .css subpage of a user page?
                $isJsCssSubpage = NS_USER == $ns
@@ -229,7 +229,7 @@ abstract class ContentHandler {
                $isWikitext = $isWikitext && !$isCssOrJsPage && !$isJsCssSubpage;
 
                // Hook can override $isWikitext
-               wfRunHooks( 'TitleIsWikitextPage', array( $title, &$isWikitext ) );
+               wfRunHooks( 'TitleIsWikitextPage', array( $title, &$isWikitext ), '1.25' );
 
                if ( !$isWikitext ) {
                        switch ( $ext ) {