r86374 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86373‎ | r86374 | r86375 >
Date:06:21, 19 April 2011
Author:ialex
Status:ok
Tags:
Comment:
* Changed wfMsgNoDBForContent() call to wfMessage(); also switched to user's language, I don't see any reason to not display this in user's language
* Marked wfMsgNoDBForContent() as deprecated and added wfDeprecated() call; the call in LoadBalancer was the only one in core and extensions
* Also added call to wfDeprecated() in wfMsgWeirdKey(); no call in core or extensions
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/db/LoadBalancer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -590,8 +590,11 @@
591591
592592 /**
593593 * Get a message from the language file, for the content
 594+ *
 595+ * @deprecated in 1.18; use wfMessage()
594596 */
595597 function wfMsgNoDBForContent( $key ) {
 598+ wfDeprecated( __FUNCTION__ );
596599 global $wgForceUIMsgAsContentMsg;
597600 $args = func_get_args();
598601 array_shift( $args );
@@ -629,6 +632,7 @@
630633 * @param $key String
631634 */
632635 function wfMsgWeirdKey( $key ) {
 636+ wfDeprecated( __FUNCTION__ );
633637 $source = wfMsgGetKey( $key, false, true, false );
634638 if ( wfEmptyMsg( $key ) ) {
635639 return '';
Index: trunk/phase3/includes/db/LoadBalancer.php
@@ -221,7 +221,7 @@
222222 $i = $this->getRandomNonLagged( $currentLoads, $wiki );
223223 if ( $i === false && count( $currentLoads ) != 0 ) {
224224 # All slaves lagged. Switch to read-only mode
225 - $wgReadOnly = wfMsgNoDBForContent( 'readonly_lag' );
 225+ $wgReadOnly = wfMessage( 'readonly_lag' )->useDatabase( false )->plain();
226226 $i = $this->pickRandom( $currentLoads );
227227 $laggedSlaveMode = true;
228228 }

Status & tagging log