Index: trunk/phase3/maintenance/refreshLinks.php |
— | — | @@ -160,29 +160,27 @@ |
161 | 161 | * @param $id int The page_id of the redirect |
162 | 162 | */ |
163 | 163 | private function fixRedirect( $id ) { |
164 | | - global $wgTitle, $wgArticle; |
165 | | - |
166 | | - $wgTitle = Title::newFromID( $id ); |
| 164 | + $title = Title::newFromID( $id ); |
167 | 165 | $dbw = wfGetDB( DB_MASTER ); |
168 | 166 | |
169 | | - if ( is_null( $wgTitle ) ) { |
| 167 | + if ( is_null( $title ) ) { |
170 | 168 | // This page doesn't exist (any more) |
171 | 169 | // Delete any redirect table entry for it |
172 | 170 | $dbw->delete( 'redirect', array( 'rd_from' => $id ), |
173 | 171 | __METHOD__ ); |
174 | 172 | return; |
175 | 173 | } |
176 | | - $wgArticle = new Article( $wgTitle ); |
| 174 | + $article = new Article( $title ); |
177 | 175 | |
178 | | - $rt = $wgArticle->followRedirect(); |
| 176 | + $rt = $article->followRedirect(); |
179 | 177 | |
180 | 178 | if ( !$rt || !is_object( $rt ) ) { |
181 | | - // $wgTitle is not a redirect |
| 179 | + // $title is not a redirect |
182 | 180 | // Delete any redirect table entry for it |
183 | 181 | $dbw->delete( 'redirect', array( 'rd_from' => $id ), |
184 | 182 | __METHOD__ ); |
185 | 183 | } else { |
186 | | - $wgArticle->updateRedirectOn( $dbw, $rt ); |
| 184 | + $article->updateRedirectOn( $dbw, $rt ); |
187 | 185 | } |
188 | 186 | } |
189 | 187 | |
— | — | @@ -191,26 +189,26 @@ |
192 | 190 | * @param $id int The page_id |
193 | 191 | */ |
194 | 192 | public static function fixLinksFromArticle( $id ) { |
195 | | - global $wgTitle, $wgParser; |
| 193 | + global $wgParser; |
196 | 194 | |
197 | | - $wgTitle = Title::newFromID( $id ); |
| 195 | + $title = Title::newFromID( $id ); |
198 | 196 | $dbw = wfGetDB( DB_MASTER ); |
199 | 197 | |
200 | 198 | LinkCache::singleton()->clear(); |
201 | 199 | |
202 | | - if ( is_null( $wgTitle ) ) { |
| 200 | + if ( is_null( $title ) ) { |
203 | 201 | return; |
204 | 202 | } |
205 | 203 | $dbw->begin(); |
206 | 204 | |
207 | | - $revision = Revision::newFromTitle( $wgTitle ); |
| 205 | + $revision = Revision::newFromTitle( $title ); |
208 | 206 | if ( !$revision ) { |
209 | 207 | return; |
210 | 208 | } |
211 | 209 | |
212 | 210 | $options = new ParserOptions; |
213 | | - $parserOutput = $wgParser->parse( $revision->getText(), $wgTitle, $options, true, true, $revision->getId() ); |
214 | | - $update = new LinksUpdate( $wgTitle, $parserOutput, false ); |
| 211 | + $parserOutput = $wgParser->parse( $revision->getText(), $title, $options, true, true, $revision->getId() ); |
| 212 | + $update = new LinksUpdate( $title, $parserOutput, false ); |
215 | 213 | $update->doUpdate(); |
216 | 214 | $dbw->commit(); |
217 | 215 | } |