r35220 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r35219‎ | r35220 | r35221 >
Date:08:54, 23 May 2008
Author:tstarling
Status:old
Tags:
Comment:
Clarify behaviour of wfGetDB(DB_SLAVE)
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -2378,7 +2378,7 @@
23792379 }
23802380
23812381 /*
2382 - * Get a Database object
 2382+ * Get a Database object.
23832383 * @param integer $db Index of the connection to get. May be DB_MASTER for the
23842384 * master (for write queries), DB_SLAVE for potentially lagged
23852385 * read queries, or an integer >= 0 for a particular server.
@@ -2388,6 +2388,10 @@
23892389 * in one group.
23902390 *
23912391 * @param string $wiki The wiki ID, or false for the current wiki
 2392+ *
 2393+ * Note: multiple calls to wfGetDB(DB_SLAVE) during the course of one request
 2394+ * will always return the same object, unless the underlying connection or load
 2395+ * balancer is manually destroyed.
23922396 */
23932397 function &wfGetDB( $db = DB_LAST, $groups = array(), $wiki = false ) {
23942398 return wfGetLB( $wiki )->getConnection( $db, $groups, $wiki );

Status & tagging log