From: Tim Starling Date: Fri, 23 May 2008 08:54:19 +0000 (+0000) Subject: Clarify behaviour of wfGetDB(DB_SLAVE) X-Git-Tag: 1.31.0-rc.0~47446 X-Git-Url: http://git.cyclocoop.org/data/%24oldEdit?a=commitdiff_plain;h=349f8d7fce5e030b389e322f6b922332500f8cb0;p=lhc%2Fweb%2Fwiklou.git Clarify behaviour of wfGetDB(DB_SLAVE) --- 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 );