<?php
/**
- * quick hackjob to fix damages imports on wikisource
- * page records have page_latest wrong
+ * Corrects wrong values in the `page_latest` field in the database.
*
* Copyright © 2005 Brion Vibber <brion@pobox.com>
* http://www.mediawiki.org/
require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+/**
+ * Maintenance script to correct wrong values in the `page_latest` field
+ * in the database.
+ *
+ * @ingroup Maintenance
+ */
class AttachLatest extends Maintenance {
public function __construct() {
$id = $revision->getId();
$this->output( wfWikiID() . " $pageId [[$name]] latest time $latestTime, rev id $id\n" );
if ( $this->hasOption( 'fix' ) ) {
- $article = new Article( $title );
- $article->updateRevisionOn( $dbw, $revision );
+ $page = WikiPage::factory( $title );
+ $page->updateRevisionOn( $dbw, $revision );
}
$n++;
}