r12490 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12489‎ | r12490 | r12491 >
Date:00:44, 8 January 2006
Author:avar
Status:old
Tags:
Comment:
* Reverting ->getDB() => wfGetDB() in 1.434, not replication-safe
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -527,10 +527,6 @@
528528 /**
529529 * Get the database which should be used for reads
530530 *
531 - * This is deprecated, just use wfGetDB() instead
532 - *
533 - * @deprecated
534 - *
535531 * @return Database
536532 */
537533 function &getDB() {
@@ -580,7 +576,7 @@
581577 function getCount() {
582578 if ( -1 == $this->mCounter ) {
583579 $id = $this->getID();
584 - $dbr =& wfGetDB( DB_SLAVE );
 580+ $dbr =& $this->getDB();
585581 $this->mCounter = $dbr->selectField( 'page', 'page_counter', array( 'page_id' => $id ),
586582 'Article::getCount', $this->getSelectOptions() );
587583 }
@@ -694,7 +690,7 @@
695691
696692 $title = $this->mTitle;
697693 $contribs = array();
698 - $dbr =& wfGetDB( DB_SLAVE );
 694+ $dbr =& $this->getDB();
699695 $revTable = $dbr->tableName( 'revision' );
700696 $userTable = $dbr->tableName( 'user' );
701697 $encDBkey = $dbr->addQuotes( $title->getDBkey() );
@@ -1740,7 +1736,7 @@
17411737 # determine whether this page has earlier revisions
17421738 # and insert a warning if it does
17431739 # we select the text because it might be useful below
1744 - $dbr =& wfGetDB( DB_SLAVE );
 1740+ $dbr =& $this->getDB();
17451741 $ns = $this->mTitle->getNamespace();
17461742 $title = $this->mTitle->getDBkey();
17471743 $revisions = $dbr->select( array( 'page', 'revision' ),

Status & tagging log