r41094 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41093‎ | r41094 | r41095 >
Date:09:15, 21 September 2008
Author:tstarling
Status:old
Tags:
Comment:
Fixed more wfGetDB() calls with no arguments.
Modified paths:
  • /trunk/extensions/DeleteQueue/ReviewForm.php (modified) (history)
  • /trunk/extensions/SimpleSecurity/SimpleSecurity.php (modified) (history)
  • /trunk/extensions/Translate/tag/FuzzyJob.php (modified) (history)
  • /trunk/extensions/Translate/tag/Utils.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryBlocks.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryBlocks.php
@@ -127,10 +127,9 @@
128128 Block::purgeExpired();
129129
130130 $res = $this->select(__METHOD__);
131 - $db = wfGetDB();
132131
133132 $count = 0;
134 - while($row = $db->fetchObject($res))
 133+ while($row = $res->fetchObject())
135134 {
136135 if($count++ == $params['limit'])
137136 {
Index: trunk/extensions/SimpleSecurity/SimpleSecurity.php
@@ -466,7 +466,7 @@
467467 # Request a DB connection to ensure the LoadBalancer is initialised,
468468 # then change back to old DBtype since it won't be used for making connections again but can affect other operations
469469 # such as $wgContLang->stripForSearch which is called by SearchMySQL::parseQuery
470 - wfGetDB();
 470+ wfGetDB( DB_MASTER );
471471 $wgDBtype = $wgOldDBtype;
472472
473473 # Add messages
Index: trunk/extensions/Translate/tag/Utils.php
@@ -55,7 +55,7 @@
5656 * Revision::getRevisionText( $row ).
5757 */
5858 public static function getPageContent( $namespace, $pages ) {
59 - $dbr = wfGetDB();
 59+ $dbr = wfGetDB( DB_SLAVE );
6060 $rows = $dbr->select( array( 'page', 'revision', 'text' ),
6161 array( 'page_title', 'old_text', 'old_flags' ),
6262 array(
@@ -177,4 +177,4 @@
178178 return array_map( $function, $array );
179179 }
180180
181 -}
\ No newline at end of file
 181+}
Index: trunk/extensions/Translate/tag/FuzzyJob.php
@@ -16,7 +16,7 @@
1717 static $user;
1818
1919 public static function fuzzyPages( $reason, $comment, Title $prefix ) {
20 - $dbr = wfGetDB();
 20+ $dbr = wfGetDB( DB_SLAVE );
2121 $likePattern = $dbr->escapeLike( $prefix->getDBkey() ) . '/%%';
2222
2323 $res = $dbr->select(
Index: trunk/extensions/DeleteQueue/ReviewForm.php
@@ -40,7 +40,7 @@
4141 $queue = $dqi->getQueue( );
4242
4343 // Transaction
44 - $dbw = wfGetDB();
 44+ $dbw = wfGetDB( DB_MASTER );
4545 $dbw->begin();
4646
4747 switch ($action) {