From e7660a865448f1b0bc5fee0e1a5319864f76ea78 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 19 Apr 2011 06:21:06 +0000 Subject: [PATCH] * 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 --- includes/GlobalFunctions.php | 4 ++++ includes/db/LoadBalancer.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index ff596621ed..4ba0c7c891 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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 ''; diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index 42b4aa690a..0f039a0bb7 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -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; } -- 2.20.1