X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fcontent%2FContentHandler.php;h=3389a00f748710608e80f48479f59a8a6d087b4b;hp=4e50c8ee799b090784c7d2bb6a1d1ed4606e8e00;hb=ce079cf6ad79ca8d3360817f809b219d166f9153;hpb=314058b0d0b8aad36b82ff0b7df2c52c89a475d1 diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index 4e50c8ee79..3389a00f74 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -82,15 +82,6 @@ class MWUnknownContentModelException extends MWException { * @ingroup Content */ abstract class ContentHandler { - /** - * Switch for enabling deprecation warnings. Used by ContentHandler::deprecated() - * and ContentHandler::runLegacyHooks(). - * - * Once the ContentHandler code has settled in a bit, this should be set to true to - * make extensions etc. show warnings when using deprecated functions and hooks. - */ - protected static $enableDeprecationWarnings = false; - /** * Convenience function for getting flat text from a Content object. This * should only be used in the context of backwards compatibility with code @@ -243,7 +234,7 @@ abstract class ContentHandler { } // Hook can force JS/CSS - Hooks::run( 'TitleIsCssOrJsPage', [ $title, &$isCodePage ], '1.25' ); + Hooks::run( 'TitleIsCssOrJsPage', [ $title, &$isCodePage ], '1.21' ); // Is this a user subpage containing code? $isCodeSubpage = NS_USER == $ns @@ -258,7 +249,7 @@ abstract class ContentHandler { $isWikitext = $isWikitext && !$isCodePage && !$isCodeSubpage; // Hook can override $isWikitext - Hooks::run( 'TitleIsWikitextPage', [ $title, &$isWikitext ], '1.25' ); + Hooks::run( 'TitleIsWikitextPage', [ $title, &$isWikitext ], '1.21' ); if ( !$isWikitext ) { switch ( $ext ) { @@ -706,7 +697,7 @@ abstract class ContentHandler { if ( $title->getNamespace() == NS_MEDIAWIKI ) { // Parse mediawiki messages with correct target language list( /* $unused */, $lang ) = MessageCache::singleton()->figureMessage( $title->getText() ); - $pageLang = wfGetLangObj( $lang ); + $pageLang = Language::factory( $lang ); } Hooks::run( 'PageContentLanguage', [ $title, &$pageLang, $wgLang ] ); @@ -1139,25 +1130,6 @@ abstract class ContentHandler { return $this->supportsDirectEditing(); } - /** - * Logs a deprecation warning, visible if $wgDevelopmentWarnings, but only if - * self::$enableDeprecationWarnings is set to true. - * - * @param string $func The name of the deprecated function - * @param string $version The version since the method is deprecated. Usually 1.21 - * for ContentHandler related stuff. - * @param string|bool $component : Component to which the function belongs. - * If false, it is assumed the function is in MediaWiki core. - * - * @see ContentHandler::$enableDeprecationWarnings - * @see wfDeprecated - */ - public static function deprecated( $func, $version, $component = false ) { - if ( self::$enableDeprecationWarnings ) { - wfDeprecated( $func, $version, $component, 3 ); - } - } - /** * Call a legacy hook that uses text instead of Content objects. * Will log a warning when a matching hook function is registered.