From 349f8d7fce5e030b389e322f6b922332500f8cb0 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 23 May 2008 08:54:19 +0000 Subject: [PATCH] Clarify behaviour of wfGetDB(DB_SLAVE) --- includes/GlobalFunctions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 276e51b8d9..4d3c32b026 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2378,7 +2378,7 @@ function wfSplitWikiID( $wiki ) { } /* - * Get a Database object + * Get a Database object. * @param integer $db Index of the connection to get. May be DB_MASTER for the * master (for write queries), DB_SLAVE for potentially lagged * read queries, or an integer >= 0 for a particular server. @@ -2388,6 +2388,10 @@ function wfSplitWikiID( $wiki ) { * in one group. * * @param string $wiki The wiki ID, or false for the current wiki + * + * Note: multiple calls to wfGetDB(DB_SLAVE) during the course of one request + * will always return the same object, unless the underlying connection or load + * balancer is manually destroyed. */ function &wfGetDB( $db = DB_LAST, $groups = array(), $wiki = false ) { return wfGetLB( $wiki )->getConnection( $db, $groups, $wiki ); -- 2.20.1