r91243 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91242‎ | r91243 | r91244 >
Date:01:42, 1 July 2011
Author:reedy
Status:ok
Tags:
Comment:
Fix numerous undefined variables
Modified paths:
  • /trunk/phase3/maintenance/deleteOldRevisions.php (modified) (history)
  • /trunk/phase3/maintenance/fixSlaveDesync.php (modified) (history)
  • /trunk/phase3/maintenance/language/StatOutputs.php (modified) (history)
  • /trunk/phase3/maintenance/nukePage.php (modified) (history)
  • /trunk/phase3/maintenance/purgeOldText.inc (modified) (history)
  • /trunk/phase3/maintenance/storage/checkStorage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/storage/checkStorage.php
@@ -130,6 +130,7 @@
131131 // It's safe to just erase the old_flags field
132132 if ( $fix ) {
133133 $this->error( 'fixed', "Warning: old_flags set to 0", $id );
 134+ $dbw = wfGetDB( DB_MASTER );
134135 $dbw->ping();
135136 $dbw->update( 'text', array( 'old_flags' => '' ),
136137 array( 'old_id' => $id ), $fname );
Index: trunk/phase3/maintenance/nukePage.php
@@ -56,6 +56,7 @@
5757 # Get corresponding revisions
5858 $this->output( "Searching for revisions..." );
5959 $res = $dbw->query( "SELECT rev_id FROM $tbl_rev WHERE rev_page = $id" );
 60+ $revs = array();
6061 foreach ( $res as $row ) {
6162 $revs[] = $row->rev_id;
6263 }
Index: trunk/phase3/maintenance/purgeOldText.inc
@@ -44,6 +44,7 @@
4545 # Get "active" text records from the archive table
4646 echo( "Searching for active text records in archive table..." );
4747 $res = $dbw->query( "SELECT DISTINCT ar_text_id FROM $tbl_arc" );
 48+ $cur = array();
4849 foreach ( $res as $row ) {
4950 $cur[] = $row->ar_text_id;
5051 }
Index: trunk/phase3/maintenance/language/StatOutputs.php
@@ -53,6 +53,7 @@
5454 echo "For additional information on specific languages (the message names, the actual problems, etc.), run <code>php maintenance/language/checkLanguage.php --lang=foo</code>.\n\n";
5555 echo 'English (en) is excluded because it is the default localization';
5656 if( is_array( $wgDummyLanguageCodes ) ) {
 57+ $dummyCodes = array();
5758 foreach( $wgDummyLanguageCodes as $dummyCode ) {
5859 $dummyCodes[] = $wgContLang->getLanguageName( $dummyCode ) . ' (' . $dummyCode . ')';
5960 }
Index: trunk/phase3/maintenance/deleteOldRevisions.php
@@ -60,6 +60,7 @@
6161 # Get "active" revisions from the page table
6262 $this->output( "Searching for active revisions..." );
6363 $res = $dbw->query( "SELECT page_latest FROM $tbl_pag{$pageIdClause}" );
 64+ $cur = array();
6465 foreach ( $res as $row ) {
6566 $cur[] = $row->page_latest;
6667 }
Index: trunk/phase3/maintenance/fixSlaveDesync.php
@@ -124,7 +124,7 @@
125125 $masterIDs[] = $row->rev_id;
126126 }
127127
128 - $res = $db->select( 'revision', array( 'rev_id' ), array( 'rev_page' => $pageID ), __METHOD__ );
 128+ $res = $dbw->select( 'revision', array( 'rev_id' ), array( 'rev_page' => $pageID ), __METHOD__ );
129129 $slaveIDs = array();
130130 foreach ( $res as $row ) {
131131 $slaveIDs[] = $row->rev_id;
@@ -133,7 +133,7 @@
134134 $missingIDs = array_diff( $slaveIDs, $masterIDs );
135135 if ( count( $missingIDs ) ) {
136136 $this->output( "Found " . count( $missingIDs ) . " lost in master, copying from slave... " );
137 - $dbFrom = $db;
 137+ $dbFrom = $dbw;
138138 $found = true;
139139 $toMaster = true;
140140 } else {

Status & tagging log