* Changed wfMsgNoDBForContent() call to wfMessage(); also switched to user's language...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 19 Apr 2011 06:21:06 +0000 (06:21 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 19 Apr 2011 06:21:06 +0000 (06:21 +0000)
* 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

includes/GlobalFunctions.php
includes/db/LoadBalancer.php

index ff59662..4ba0c7c 100644 (file)
@@ -590,8 +590,11 @@ function wfMsgNoDB( $key ) {
 
 /**
  * Get a message from the language file, for the content
+ *
+ * @deprecated in 1.18; use wfMessage()
  */
 function wfMsgNoDBForContent( $key ) {
+       wfDeprecated( __FUNCTION__ );
        global $wgForceUIMsgAsContentMsg;
        $args = func_get_args();
        array_shift( $args );
@@ -629,6 +632,7 @@ function wfMsgReal( $key, $args, $useDB = true, $forContent = false, $transform
  * @param $key String
  */
 function wfMsgWeirdKey( $key ) {
+       wfDeprecated( __FUNCTION__ );
        $source = wfMsgGetKey( $key, false, true, false );
        if ( wfEmptyMsg( $key ) ) {
                return '';
index 42b4aa6..0f039a0 100644 (file)
@@ -221,7 +221,7 @@ class LoadBalancer {
                                        $i = $this->getRandomNonLagged( $currentLoads, $wiki );
                                        if ( $i === false && count( $currentLoads ) != 0 )  {
                                                # All slaves lagged. Switch to read-only mode
-                                               $wgReadOnly = wfMsgNoDBForContent( 'readonly_lag' );
+                                               $wgReadOnly = wfMessage( 'readonly_lag' )->useDatabase( false )->plain();
                                                $i = $this->pickRandom( $currentLoads );
                                                $laggedSlaveMode = true;
                                        }