r85380 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85379‎ | r85380 | r85381 >
Date:21:14, 4 April 2011
Author:reedy
Status:ok
Tags:
Comment:
Fixup numerous undefined variables (some from r85379), possibly around in various trunk revisions

Not bothered digging them up
Modified paths:
  • /branches/REL1_17/phase3/includes/Feed.php (modified) (history)
  • /branches/REL1_17/phase3/includes/LogEventsList.php (modified) (history)
  • /branches/REL1_17/phase3/includes/api/ApiQueryCategories.php (modified) (history)
  • /branches/REL1_17/phase3/includes/db/DatabaseIbm_db2.php (modified) (history)
  • /branches/REL1_17/phase3/includes/parser/LinkHolderArray.php (modified) (history)
  • /branches/REL1_17/phase3/maintenance/addwiki.php (modified) (history)
  • /branches/REL1_17/phase3/maintenance/checkUsernames.php (modified) (history)
  • /branches/REL1_17/phase3/maintenance/dumpInterwiki.php (modified) (history)
  • /branches/REL1_17/phase3/maintenance/minify.php (modified) (history)
  • /branches/REL1_17/phase3/maintenance/refreshLinks.php (modified) (history)
  • /branches/REL1_17/phase3/maintenance/renamewiki.php (modified) (history)
  • /branches/REL1_17/phase3/maintenance/storage/recompressTracked.php (modified) (history)
  • /branches/REL1_17/phase3/maintenance/tests/RunSeleniumTests.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/phase3/maintenance/renamewiki.php
@@ -57,7 +57,7 @@
5858 }
5959
6060 if ( count( $stores ) ) {
61 - $this->output( "Initialising external storage $store...\n" );
 61+ $this->output( "Initialising external storage...\n" );
6262 global $wgDBuser, $wgDBpassword, $wgExternalServers;
6363 foreach ( $stores as $storeURL ) {
6464 $m = array();
Index: branches/REL1_17/phase3/maintenance/storage/recompressTracked.php
@@ -610,7 +610,7 @@
611611 foreach ( $res as $row ) {
612612 $text = Revision::getRevisionText( $row );
613613 if ( $text === false ) {
614 - $this->critical( "Error: cannot load revision text for old_id=$textId" );
 614+ $this->critical( "Error: cannot load revision text for old_id={$row->old_id}" );
615615 continue;
616616 }
617617
Index: branches/REL1_17/phase3/maintenance/minify.php
@@ -74,7 +74,7 @@
7575 public function getExtension( $fileName ) {
7676 $dotPos = strrpos( $fileName, '.' );
7777 if ( $dotPos === false ) {
78 - $this->error( "No file extension, cannot determine type: $arg" );
 78+ $this->error( "No file extension, cannot determine type: $fileName" );
7979 exit( 1 );
8080 }
8181 return substr( $fileName, $dotPos + 1 );
Index: branches/REL1_17/phase3/maintenance/refreshLinks.php
@@ -91,6 +91,7 @@
9292 $num = $dbr->numRows( $res );
9393 $this->output( "Refreshing $num old redirects from $start...\n" );
9494
 95+ $i = 0;
9596 foreach ( $res as $row ) {
9697 if ( !( ++$i % $reportingInterval ) ) {
9798 $this->output( "$i\n" );
Index: branches/REL1_17/phase3/maintenance/tests/RunSeleniumTests.php
@@ -140,9 +140,9 @@
141141 public function execute() {
142142 global $wgServer, $wgScriptPath, $wgHooks;
143143
144 - $seleniumSettings;
145 - $seleniumBrowsers;
146 - $seleniumTestSuites;
 144+ $seleniumSettings = array();
 145+ $seleniumBrowsers = array();
 146+ $seleniumTestSuites = array();
147147
148148 $configFile = $this->getOption( 'seleniumConfig', '' );
149149 if ( strlen( $configFile ) > 0 ) {
Index: branches/REL1_17/phase3/maintenance/addwiki.php
@@ -90,7 +90,7 @@
9191 # Initialise external storage
9292 if ( is_array( $wgDefaultExternalStore ) ) {
9393 $stores = $wgDefaultExternalStore;
94 - } elseif ( $stores ) {
 94+ } elseif ( $wgDefaultExternalStore ) {
9595 $stores = array( $wgDefaultExternalStore );
9696 } else {
9797 $stores = array();
Index: branches/REL1_17/phase3/maintenance/checkUsernames.php
@@ -45,7 +45,7 @@
4646 foreach ( $res as $row ) {
4747 if ( ! User::isValidUserName( $row->user_name ) ) {
4848 $this->error( sprintf( "%s: %6d: '%s'\n", wfWikiID(), $row->user_id, $row->user_name ) );
49 - wfDebugLog( 'checkUsernames', $out );
 49+ wfDebugLog( 'checkUsernames', $row->user_name );
5050 }
5151 }
5252 }
Index: branches/REL1_17/phase3/maintenance/dumpInterwiki.php
@@ -148,7 +148,7 @@
149149 $this->makeLanguageLinks ( $site, "_" . $site->suffix );
150150 }
151151
152 - foreach ( $dblist as $db ) {
 152+ foreach ( $this->dblist as $db ) {
153153 if ( isset( $this->specials[$db] ) ) {
154154 # Special wiki
155155 # Has interwiki links and interlanguage links to wikipedia
Index: branches/REL1_17/phase3/includes/parser/LinkHolderArray.php
@@ -348,7 +348,7 @@
349349 continue;
350350 }
351351 $linkBatch->addObj( $variantTitle );
352 - $variantMap[$variantTitle->getPrefixedDBkey()][] = $key;
 352+ $variantMap[$variantTitle->getPrefixedDBkey()][] = $titlesAttrs[$i]['key'];
353353 }
354354 }
355355 }
Index: branches/REL1_17/phase3/includes/db/DatabaseIbm_db2.php
@@ -949,7 +949,7 @@
950950 $overhead = "SAVEPOINT $ignore ON ROLLBACK RETAIN CURSORS";
951951 db2_exec( $this->mConn, $overhead, $this->mStmtOptions );
952952
953 - $this->execute( $stmt, $row );
 953+ $res2 = $this->execute( $stmt, $row );
954954
955955 if ( !$res2 ) {
956956 $this->installPrint( 'Last error:' );
Index: branches/REL1_17/phase3/includes/Feed.php
@@ -101,7 +101,7 @@
102102 */
103103 public function setUniqueId($uniqueId, $RSSisPermalink = False) {
104104 $this->UniqueId = $uniqueId;
105 - $this->RSSIsPermalink = $isPermalink;
 105+ $this->RSSIsPermalink = $RSSisPermalink;
106106 }
107107
108108 /**
Index: branches/REL1_17/phase3/includes/LogEventsList.php
@@ -1091,7 +1091,7 @@
10921092 public function show() {
10931093 global $wgOut;
10941094 # Set title and add header
1095 - $this->list->showHeader( $pager->getType() );
 1095+ $this->list->showHeader( $this->pager->getType() );
10961096 # Show form options
10971097 $this->list->showOptions( $this->pager->getType(), $this->pager->getUser(), $this->pager->getPage(),
10981098 $this->pager->getPattern(), $this->pager->getYear(), $this->pager->getMonth() );
Index: branches/REL1_17/phase3/includes/api/ApiQueryCategories.php
@@ -132,8 +132,8 @@
133133
134134 $res = $this->select( __METHOD__ );
135135
 136+ $count = 0;
136137 if ( is_null( $resultPageSet ) ) {
137 - $count = 0;
138138 foreach ( $res as $row ) {
139139 if ( ++$count > $params['limit'] ) {
140140 // We've reached the one extra which shows that

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85379Fixup a few undefined variables and alike while checking REL1_17reedy21:13, 4 April 2011

Status & tagging log