Phase out the last of Article::getDB().
authorChad Horohoe <demon@users.mediawiki.org>
Mon, 16 Jun 2008 14:18:41 +0000 (14:18 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Mon, 16 Jun 2008 14:18:41 +0000 (14:18 +0000)
RELEASE-NOTES
includes/Article.php

index e0c467b..e2cd03e 100644 (file)
@@ -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 ===
 
index 4b6ed5a..0649532 100644 (file)
@@ -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();