summaryrefslogtreecommitdiff
path: root/maintenance/refreshLinks.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
committerPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
commitd9022f63880ce039446fba8364f68e656b7bf4cb (patch)
tree16b40fbf17bf7c9ee6f4ead25b16dd192378050a /maintenance/refreshLinks.php
parent27cf83d177256813e2e802241085fce5dd0f3fb9 (diff)
Update to MediaWiki 1.19.0
Diffstat (limited to 'maintenance/refreshLinks.php')
-rw-r--r--maintenance/refreshLinks.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/maintenance/refreshLinks.php b/maintenance/refreshLinks.php
index 0515ef1b..c16b6963 100644
--- a/maintenance/refreshLinks.php
+++ b/maintenance/refreshLinks.php
@@ -184,17 +184,15 @@ class RefreshLinks extends Maintenance {
__METHOD__ );
return;
}
- $article = new Article( $title );
- $rt = $article->followRedirect();
+ $page = WikiPage::factory( $title );
+ $rt = $page->getRedirectTarget();
- if ( !$rt || !is_object( $rt ) ) {
+ if ( $rt === null ) {
// $title is not a redirect
// Delete any redirect table entry for it
$dbw->delete( 'redirect', array( 'rd_from' => $id ),
__METHOD__ );
- } else {
- $article->updateRedirectOn( $dbw, $rt );
}
}
@@ -213,13 +211,14 @@ class RefreshLinks extends Maintenance {
if ( is_null( $title ) ) {
return;
}
- $dbw->begin();
$revision = Revision::newFromTitle( $title );
if ( !$revision ) {
return;
}
+ $dbw->begin();
+
$options = new ParserOptions;
$parserOutput = $wgParser->parse( $revision->getText(), $title, $options, true, true, $revision->getId() );
$update = new LinksUpdate( $title, $parserOutput, false );
@@ -229,7 +228,7 @@ class RefreshLinks extends Maintenance {
/**
* Removes non-existing links from pages from pagelinks, imagelinks,
- * categorylinks, templatelinks and externallinks tables.
+ * categorylinks, templatelinks, externallinks, interwikilinks, langlinks and redirect tables.
*
* @param $maxLag
* @param $batchSize The size of deletion batches
@@ -254,6 +253,7 @@ class RefreshLinks extends Maintenance {
'iwlinks' => 'iwl_from',
'langlinks' => 'll_from',
'redirect' => 'rd_from',
+ 'page_props' => 'pp_page',
);
foreach ( $linksTables as $table => $field ) {
@@ -271,7 +271,6 @@ class RefreshLinks extends Maintenance {
$counter = 0;
$list = array();
$this->output( "0.." );
-
foreach ( $results as $row ) {
$counter++;
$list[] = $row->$field;