From 02f8475482d8118280aeb6daf4e86aa11921f0d4 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Tue, 4 Dec 2012 12:19:09 +0100 Subject: [PATCH] Add wfDeprecated to wfMsg* methods from 1.21 on These were marked soft deprecated in 1.18. Change-Id: Ifa82da981c69b2ea9d5b298e9dfb04fc29483206 --- RELEASE-NOTES-1.21 | 4 ++++ includes/GlobalFunctions.php | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21 index af7264aba3..220089d50e 100644 --- a/RELEASE-NOTES-1.21 +++ b/RELEASE-NOTES-1.21 @@ -53,6 +53,10 @@ production. * Added EditPage::showStandardInputs:options hook to allow extensions to add new fields to the "editOptions" area of the edit form. * Upload stash DB schema altered to improve upload performance. +* The following global functions are now reporting deprecated warnings in + debug mode: wfMsg, wfMsgNoTrans, wfMsgForContent, wfMsgForContentNoTrans, + wfMsgReal, wfMsgGetKey, wfMsgHtml, wfMsgWikiHtml, wfMsgExt, wfEmptyMsg. Use + the Message class, or the global method wfMessage. === Bug fixes in 1.21 === * (bug 40353) SpecialDoubleRedirect should support interwiki redirects. diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index b6cabdacd3..6d86a5047c 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1427,6 +1427,8 @@ function wfMessageFallback( /*...*/ ) { * @return String */ function wfMsg( $key ) { + wfDeprecated( __METHOD__, '1.21' ); + $args = func_get_args(); array_shift( $args ); return wfMsgReal( $key, $args ); @@ -1441,6 +1443,8 @@ function wfMsg( $key ) { * @return String */ function wfMsgNoTrans( $key ) { + wfDeprecated( __METHOD__, '1.21' ); + $args = func_get_args(); array_shift( $args ); return wfMsgReal( $key, $args, true, false, false ); @@ -1472,6 +1476,8 @@ function wfMsgNoTrans( $key ) { * @return String */ function wfMsgForContent( $key ) { + wfDeprecated( __METHOD__, '1.21' ); + global $wgForceUIMsgAsContentMsg; $args = func_get_args(); array_shift( $args ); @@ -1493,6 +1499,8 @@ function wfMsgForContent( $key ) { * @return String */ function wfMsgForContentNoTrans( $key ) { + wfDeprecated( __METHOD__, '1.21' ); + global $wgForceUIMsgAsContentMsg; $args = func_get_args(); array_shift( $args ); @@ -1518,6 +1526,8 @@ function wfMsgForContentNoTrans( $key ) { * @return String: the requested message. */ function wfMsgReal( $key, $args, $useDB = true, $forContent = false, $transform = true ) { + wfDeprecated( __METHOD__, '1.21' ); + wfProfileIn( __METHOD__ ); $message = wfMsgGetKey( $key, $useDB, $forContent, $transform ); $message = wfMsgReplaceArgs( $message, $args ); @@ -1538,6 +1548,8 @@ function wfMsgReal( $key, $args, $useDB = true, $forContent = false, $transform * @return string */ function wfMsgGetKey( $key, $useDB = true, $langCode = false, $transform = true ) { + wfDeprecated( __METHOD__, '1.21' ); + wfRunHooks( 'NormalizeMessageKey', array( &$key, &$useDB, &$langCode, &$transform ) ); $cache = MessageCache::singleton(); @@ -1592,6 +1604,8 @@ function wfMsgReplaceArgs( $message, $args ) { * @return string */ function wfMsgHtml( $key ) { + wfDeprecated( __METHOD__, '1.21' ); + $args = func_get_args(); array_shift( $args ); return wfMsgReplaceArgs( htmlspecialchars( wfMsgGetKey( $key ) ), $args ); @@ -1611,6 +1625,8 @@ function wfMsgHtml( $key ) { * @return string */ function wfMsgWikiHtml( $key ) { + wfDeprecated( __METHOD__, '1.21' ); + $args = func_get_args(); array_shift( $args ); return wfMsgReplaceArgs( @@ -1642,6 +1658,8 @@ function wfMsgWikiHtml( $key ) { * @return String */ function wfMsgExt( $key, $options ) { + wfDeprecated( __METHOD__, '1.21' ); + $args = func_get_args(); array_shift( $args ); array_shift( $args ); @@ -1722,6 +1740,8 @@ function wfMsgExt( $key, $options ) { * @return Boolean True if the message *doesn't* exist. */ function wfEmptyMsg( $key ) { + wfDeprecated( __METHOD__, '1.21' ); + return MessageCache::singleton()->get( $key, /*useDB*/true, /*content*/false ) === false; } -- 2.20.1