r36334 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36333‎ | r36334 | r36335 >
Date:14:18, 16 June 2008
Author:demon
Status:old
Tags:
Comment:
Phase out the last of Article::getDB().
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -352,7 +352,7 @@
353353 */
354354 function loadPageData( $data = 'fromdb' ) {
355355 if ( $data === 'fromdb' ) {
356 - $dbr = $this->getDB();
 356+ $dbr = wfGetDB( DB_MASTER );
357357 $data = $this->pageDataFromId( $dbr, $this->getId() );
358358 }
359359
@@ -390,7 +390,7 @@
391391 return $this->mContent;
392392 }
393393
394 - $dbr = $this->getDB();
 394+ $dbr = wfGetDB( DB_MASTER );
395395
396396 # Pre-fill content with error message so that if something
397397 # fails we'll have something telling us what we intended.
@@ -458,6 +458,7 @@
459459 * Get the database which should be used for reads
460460 *
461461 * @return Database
 462+ * @deprecated - just call wfGetDB( DB_MASTER ) instead
462463 */
463464 function getDB() {
464465 return wfGetDB( DB_MASTER );
@@ -581,7 +582,7 @@
582583 $id = $this->getID();
583584 if ( 0 == $id ) return;
584585
585 - $this->mLastRevision = Revision::loadFromPageId( $this->getDB(), $id );
 586+ $this->mLastRevision = Revision::loadFromPageId( wfGetDB( DB_MASTER ), $id );
586587 if( !is_null( $this->mLastRevision ) ) {
587588 $this->mUser = $this->mLastRevision->getUser();
588589 $this->mUserText = $this->mLastRevision->getUserText();
Index: trunk/phase3/RELEASE-NOTES
@@ -372,6 +372,7 @@
373373 * Generate correct section anchors for numeric headers
374374 * (bug 14520) Don't load nonexistent CSS files for Chick/Myskin/Simple skins
375375 * (bug 14551) Cancel upload no longer automatically suppresses warnings
 376+* (bug 13878) Deprecate Article::getDB() in favor of direct wfGetDB() calls
376377
377378 === API changes in 1.13 ===
378379

Follow-up revisions

RevisionCommit summaryAuthorDate
r79739Remove ancient deprecated functions:...happy-melon18:04, 6 January 2011

Status & tagging log