<?php
-// quick hackjob to fix damages imports on wikisource
-// page records have page_latest wrong
-
/**
+ * quick hackjob to fix damages imports on wikisource
+ * page records have page_latest wrong
+ *
* Copyright (C) 2005 Brion Vibber <brion@pobox.com>
* http://www.mediawiki.org/
*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
- * @file
* @ingroup Maintenance
*/
-require_once( "Maintenance.php" );
+require_once( dirname(__FILE__) . '/Maintenance.php' );
class AttachLatest extends Maintenance {
public function __construct() {
parent::__construct();
- $this->addParam( "fix", "Actually fix the entries, will dry run otherwise" );
+ $this->addOption( "fix", "Actually fix the entries, will dry run otherwise" );
$this->mDescription = "Fix page_latest entries in the page table";
}
__METHOD__ );
$n = 0;
- while( $row = $dbw->fetchObject( $result ) ) {
+ foreach( $result as $row ) {
$pageId = intval( $row->page_id );
$title = Title::makeTitle( $row->page_namespace, $row->page_title );
$name = $title->getPrefixedText();