Index: trunk/phase3/maintenance/storage/checkStorage.php |
— | — | @@ -130,6 +130,7 @@ |
131 | 131 | // It's safe to just erase the old_flags field |
132 | 132 | if ( $fix ) { |
133 | 133 | $this->error( 'fixed', "Warning: old_flags set to 0", $id ); |
| 134 | + $dbw = wfGetDB( DB_MASTER ); |
134 | 135 | $dbw->ping(); |
135 | 136 | $dbw->update( 'text', array( 'old_flags' => '' ), |
136 | 137 | array( 'old_id' => $id ), $fname ); |
Index: trunk/phase3/maintenance/nukePage.php |
— | — | @@ -56,6 +56,7 @@ |
57 | 57 | # Get corresponding revisions |
58 | 58 | $this->output( "Searching for revisions..." ); |
59 | 59 | $res = $dbw->query( "SELECT rev_id FROM $tbl_rev WHERE rev_page = $id" ); |
| 60 | + $revs = array(); |
60 | 61 | foreach ( $res as $row ) { |
61 | 62 | $revs[] = $row->rev_id; |
62 | 63 | } |
Index: trunk/phase3/maintenance/purgeOldText.inc |
— | — | @@ -44,6 +44,7 @@ |
45 | 45 | # Get "active" text records from the archive table |
46 | 46 | echo( "Searching for active text records in archive table..." ); |
47 | 47 | $res = $dbw->query( "SELECT DISTINCT ar_text_id FROM $tbl_arc" ); |
| 48 | + $cur = array(); |
48 | 49 | foreach ( $res as $row ) { |
49 | 50 | $cur[] = $row->ar_text_id; |
50 | 51 | } |
Index: trunk/phase3/maintenance/language/StatOutputs.php |
— | — | @@ -53,6 +53,7 @@ |
54 | 54 | 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"; |
55 | 55 | echo 'English (en) is excluded because it is the default localization'; |
56 | 56 | if( is_array( $wgDummyLanguageCodes ) ) { |
| 57 | + $dummyCodes = array(); |
57 | 58 | foreach( $wgDummyLanguageCodes as $dummyCode ) { |
58 | 59 | $dummyCodes[] = $wgContLang->getLanguageName( $dummyCode ) . ' (' . $dummyCode . ')'; |
59 | 60 | } |
Index: trunk/phase3/maintenance/deleteOldRevisions.php |
— | — | @@ -60,6 +60,7 @@ |
61 | 61 | # Get "active" revisions from the page table |
62 | 62 | $this->output( "Searching for active revisions..." ); |
63 | 63 | $res = $dbw->query( "SELECT page_latest FROM $tbl_pag{$pageIdClause}" ); |
| 64 | + $cur = array(); |
64 | 65 | foreach ( $res as $row ) { |
65 | 66 | $cur[] = $row->page_latest; |
66 | 67 | } |
Index: trunk/phase3/maintenance/fixSlaveDesync.php |
— | — | @@ -124,7 +124,7 @@ |
125 | 125 | $masterIDs[] = $row->rev_id; |
126 | 126 | } |
127 | 127 | |
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__ ); |
129 | 129 | $slaveIDs = array(); |
130 | 130 | foreach ( $res as $row ) { |
131 | 131 | $slaveIDs[] = $row->rev_id; |
— | — | @@ -133,7 +133,7 @@ |
134 | 134 | $missingIDs = array_diff( $slaveIDs, $masterIDs ); |
135 | 135 | if ( count( $missingIDs ) ) { |
136 | 136 | $this->output( "Found " . count( $missingIDs ) . " lost in master, copying from slave... " ); |
137 | | - $dbFrom = $db; |
| 137 | + $dbFrom = $dbw; |
138 | 138 | $found = true; |
139 | 139 | $toMaster = true; |
140 | 140 | } else { |