r89267 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89266‎ | r89267 | r89268 >
Date:15:36, 1 June 2011
Author:reedy
Status:ok
Tags:
Comment:
Kill freeResult() calls

Add some member variable documentation, add a few braces
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuthUser.php (modified) (history)
  • /trunk/extensions/CentralAuth/migratePass0.php (modified) (history)
  • /trunk/extensions/CentralAuth/migratePass1.php (modified) (history)
  • /trunk/extensions/CentralAuth/specials/SpecialCentralAuth.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/migratePass0.php
@@ -33,7 +33,6 @@
3434 $users[intval( $row->user_id )] = $row->user_name;
3535 ++$migrated;
3636 }
37 - $dbr->freeResult( $result );
3837
3938 CentralAuthUser::storeMigrationData( $wgDBname, $users );
4039
Index: trunk/extensions/CentralAuth/migratePass1.php
@@ -28,7 +28,6 @@
2929 migratePassOneReport( $migrated, $total, $start );
3030 }
3131 }
32 - $dbBackground->freeResult( $result );
3332 migratePassOneReport( $migrated, $total, $start );
3433 echo "DONE\n";
3534 }
Index: trunk/extensions/CentralAuth/CentralAuthUser.php
@@ -145,7 +145,6 @@
146146 "WHERE gu_name=?";
147147 $result = $dbr->safeQuery( $sql, wfWikiID(), $this->mName );
148148 $row = $dbr->fetchObject( $result );
149 - $dbr->freeResult( $result );
150149
151150 $this->loadFromRow( $row, true );
152151 $this->saveToCache();
@@ -1338,7 +1337,6 @@
13391338 foreach ( $result as $row ) {
13401339 $dbs[] = $row->ln_wiki;
13411340 }
1342 - $dbw->freeResult( $result );
13431341
13441342 return $dbs;
13451343 }
@@ -1467,7 +1465,6 @@
14681466 foreach ( $result as $row ) {
14691467 $wikis[] = $row->lu_wiki;
14701468 }
1471 - $dbw->freeResult( $result );
14721469
14731470 $this->mAttachedArray = $wikis;
14741471 $this->mAttachedList = implode( "\n", $wikis );
@@ -1520,7 +1517,6 @@
15211518 $wikis[$row->lu_wiki] = array_merge( $wikis[$row->lu_wiki],
15221519 $this->localUserData( $row->lu_wiki ) );
15231520 }
1524 - $dbw->freeResult( $result );
15251521
15261522 return $wikis;
15271523 }
Index: trunk/extensions/CentralAuth/specials/SpecialCentralAuth.php
@@ -1,8 +1,14 @@
22 <?php
33 class SpecialCentralAuth extends SpecialPage {
44 var $mUserName, $mCanUnmerge, $mCanLock, $mCanOversight, $mCanEdit;
5 - var $mGlobalUser, $mAttachedLocalAccounts, $mUnattachedLocalAccounts;
65
 6+ /**
 7+ * @var CentralAuthUser
 8+ */
 9+ var $mGlobalUser;
 10+
 11+ var $mAttachedLocalAccounts, $mUnattachedLocalAccounts;
 12+
713 function __construct() {
814 parent::__construct( 'CentralAuth' );
915 }
@@ -73,12 +79,15 @@
7480 $this->showUsernameForm();
7581 if ( $continue ) {
7682 $this->showInfo();
77 - if ( $this->mCanLock )
 83+ if ( $this->mCanLock ) {
7884 $this->showStatusForm();
79 - if ( $this->mCanUnmerge )
 85+ }
 86+ if ( $this->mCanUnmerge ) {
8087 $this->showActionForm( 'delete' );
81 - if ( $this->mCanEdit )
 88+ }
 89+ if ( $this->mCanEdit ) {
8290 $this->showLogExtract();
 91+ }
8392 $this->showWikiLists();
8493 }
8594 }

Status & tagging log