From fcebee405f7b9b687e844a8d60d12eaa6c49f48e Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Mon, 18 Jul 2011 22:23:42 +0000 Subject: [PATCH] Add comment Remove unused wfGetDb() --- includes/Block.php | 5 ++--- includes/WikiPage.php | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/Block.php b/includes/Block.php index a59d935f9f..e5a17d99a8 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -346,13 +346,13 @@ class Block { protected function initFromRow( $row ) { $this->setTarget( $row->ipb_address ); $this->setBlocker( User::newFromId( $row->ipb_by ) ); - + $this->mReason = $row->ipb_reason; $this->mTimestamp = wfTimestamp( TS_MW, $row->ipb_timestamp ); $this->mAuto = $row->ipb_auto; $this->mHideName = $row->ipb_deleted; $this->mId = $row->ipb_id; - + // I wish I didn't have to do this $db = wfGetDB( DB_SLAVE ); if ( $row->ipb_expiry == $db->getInfinity() ) { @@ -643,7 +643,6 @@ class Block { $autoblock->mHideName = $this->mHideName; $autoblock->prevents( 'editownusertalk', $this->prevents( 'editownusertalk' ) ); - $dbr = wfGetDB( DB_SLAVE ); if ( $this->mExpiry == 'infinity' ) { # Original block was indefinite, start an autoblock now $autoblock->mExpiry = Block::getAutoblockExpiry( $timestamp ); diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 8804f834f9..5899fc0ce0 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -82,6 +82,8 @@ class WikiPage extends Page { * Always override this for all subclasses (until we use PHP with LSB) * * @param $id Int article ID to load + * + * @return WikiPage */ public static function newFromID( $id ) { $t = Title::newFromID( $id ); @@ -278,6 +280,8 @@ class WikiPage extends Page { /** * Return the list of revision fields that should be selected to create * a new page. + * + * @return array */ public static function selectFields() { return array( @@ -535,7 +539,7 @@ class WikiPage extends Page { * Revision::FOR_THIS_USER to be displayed to $wgUser * Revision::RAW get the text regardless of permissions * @return String|false The text of the current revision - */ + */ public function getText( $audience = Revision::FOR_PUBLIC ) { $this->loadLastEdit(); if ( $this->mLastRevision ) { -- 2.20.1