r92486 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92485‎ | r92486 | r92487 >
Date:22:23, 18 July 2011
Author:reedy
Status:ok
Tags:
Comment:
Add comment

Remove unused wfGetDb()
Modified paths:
  • /trunk/phase3/includes/Block.php (modified) (history)
  • /trunk/phase3/includes/WikiPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/WikiPage.php
@@ -82,6 +82,8 @@
8383 * Always override this for all subclasses (until we use PHP with LSB)
8484 *
8585 * @param $id Int article ID to load
 86+ *
 87+ * @return WikiPage
8688 */
8789 public static function newFromID( $id ) {
8890 $t = Title::newFromID( $id );
@@ -278,6 +280,8 @@
279281 /**
280282 * Return the list of revision fields that should be selected to create
281283 * a new page.
 284+ *
 285+ * @return array
282286 */
283287 public static function selectFields() {
284288 return array(
@@ -535,7 +539,7 @@
536540 * Revision::FOR_THIS_USER to be displayed to $wgUser
537541 * Revision::RAW get the text regardless of permissions
538542 * @return String|false The text of the current revision
539 - */
 543+ */
540544 public function getText( $audience = Revision::FOR_PUBLIC ) {
541545 $this->loadLastEdit();
542546 if ( $this->mLastRevision ) {
Index: trunk/phase3/includes/Block.php
@@ -346,13 +346,13 @@
347347 protected function initFromRow( $row ) {
348348 $this->setTarget( $row->ipb_address );
349349 $this->setBlocker( User::newFromId( $row->ipb_by ) );
350 -
 350+
351351 $this->mReason = $row->ipb_reason;
352352 $this->mTimestamp = wfTimestamp( TS_MW, $row->ipb_timestamp );
353353 $this->mAuto = $row->ipb_auto;
354354 $this->mHideName = $row->ipb_deleted;
355355 $this->mId = $row->ipb_id;
356 -
 356+
357357 // I wish I didn't have to do this
358358 $db = wfGetDB( DB_SLAVE );
359359 if ( $row->ipb_expiry == $db->getInfinity() ) {
@@ -643,7 +643,6 @@
644644 $autoblock->mHideName = $this->mHideName;
645645 $autoblock->prevents( 'editownusertalk', $this->prevents( 'editownusertalk' ) );
646646
647 - $dbr = wfGetDB( DB_SLAVE );
648647 if ( $this->mExpiry == 'infinity' ) {
649648 # Original block was indefinite, start an autoblock now
650649 $autoblock->mExpiry = Block::getAutoblockExpiry( $timestamp );

Follow-up revisions

RevisionCommit summaryAuthorDate
r92505MFT r92477, r92480, r92481, r92482, r92484, r9485, r92486...reedy23:14, 18 July 2011

Status & tagging log