From b2f0fe5d552b647d057b85555eea9e7045d78e7b Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Mon, 16 Jun 2008 14:18:41 +0000 Subject: [PATCH] Phase out the last of Article::getDB(). --- RELEASE-NOTES | 1 + includes/Article.php | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e0c467b92b..e2cd03e35d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -372,6 +372,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Generate correct section anchors for numeric headers * (bug 14520) Don't load nonexistent CSS files for Chick/Myskin/Simple skins * (bug 14551) Cancel upload no longer automatically suppresses warnings +* (bug 13878) Deprecate Article::getDB() in favor of direct wfGetDB() calls === API changes in 1.13 === diff --git a/includes/Article.php b/includes/Article.php index 4b6ed5abbc..0649532300 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -352,7 +352,7 @@ class Article { */ function loadPageData( $data = 'fromdb' ) { if ( $data === 'fromdb' ) { - $dbr = $this->getDB(); + $dbr = wfGetDB( DB_MASTER ); $data = $this->pageDataFromId( $dbr, $this->getId() ); } @@ -390,7 +390,7 @@ class Article { return $this->mContent; } - $dbr = $this->getDB(); + $dbr = wfGetDB( DB_MASTER ); # Pre-fill content with error message so that if something # fails we'll have something telling us what we intended. @@ -458,6 +458,7 @@ class Article { * Get the database which should be used for reads * * @return Database + * @deprecated - just call wfGetDB( DB_MASTER ) instead */ function getDB() { return wfGetDB( DB_MASTER ); @@ -581,7 +582,7 @@ class Article { $id = $this->getID(); if ( 0 == $id ) return; - $this->mLastRevision = Revision::loadFromPageId( $this->getDB(), $id ); + $this->mLastRevision = Revision::loadFromPageId( wfGetDB( DB_MASTER ), $id ); if( !is_null( $this->mLastRevision ) ) { $this->mUser = $this->mLastRevision->getUser(); $this->mUserText = $this->mLastRevision->getUserText(); -- 2.20.1