Index: trunk/phase3/maintenance/orphans.php |
— | — | @@ -53,10 +53,11 @@ |
54 | 54 | * @param $db DatabaseBase object |
55 | 55 | * @param $extraTable String The name of any extra tables to lock (eg: text) |
56 | 56 | */ |
57 | | - private function lockTables( &$db, $extraTable = null ) { |
| 57 | + private function lockTables( $db, $extraTable = array() ) { |
58 | 58 | $tbls = array( 'page', 'revision', 'redirect' ); |
59 | | - if ( $extraTable ) |
60 | | - $tbls[] = $extraTable; |
| 59 | + if ( $extraTable ) { |
| 60 | + $tbls = array_merge( $tbls, $extraTable ); |
| 61 | + } |
61 | 62 | $db->lockTables( array(), $tbls, __METHOD__, false ); |
62 | 63 | } |
63 | 64 | |
— | — | @@ -167,7 +168,7 @@ |
168 | 169 | $revision = $dbw->tableName( 'revision' ); |
169 | 170 | |
170 | 171 | if ( $fix ) { |
171 | | - $dbw->lockTables( $dbw, 'text', __METHOD__ ); |
| 172 | + $this->lockTables( $dbw, array( 'user', 'text' ) ); |
172 | 173 | } |
173 | 174 | |
174 | 175 | $this->output( "\nChecking for pages whose page_latest links are incorrect... (this may take a while on a large wiki)\n" ); |
— | — | @@ -206,7 +207,7 @@ |
207 | 208 | $this->output( "... updating to revision $maxId\n" ); |
208 | 209 | $maxRev = Revision::newFromId( $maxId ); |
209 | 210 | $title = Title::makeTitle( $row->page_namespace, $row->page_title ); |
210 | | - $article = new Article( $title ); |
| 211 | + $article = WikiPage::factory( $title ); |
211 | 212 | $article->updateRevisionOn( $dbw, $maxRev ); |
212 | 213 | } |
213 | 214 | } |