'Disable link table updates. Is faster but leaves the wiki in an inconsistent state'
);
$this->addOption( 'image-base-path', 'Import files from a specified path', false, true );
+ $this->addOption( 'skip-to', 'Start from nth page by skipping first n-1 pages', false, true );
$this->addArg( 'file', 'Dump file to import [else use stdin]', false );
}
}
$this->output( "Done!\n" );
- $this->output( "You might want to run rebuildrecentchanges.php to regenerate RecentChanges\n" );
+ $this->output( "You might want to run rebuildrecentchanges.php to regenerate RecentChanges,\n" );
+ $this->output( "and initSiteStats.php to update page and revision counts\n" );
}
function setNsfilter( array $namespaces ) {
$source = new ImportStreamSource( $handle );
$importer = new WikiImporter( $source, $this->getConfig() );
+ // Updating statistics require a lot of time so disable it
+ $importer->disableStatisticsUpdate();
+
if ( $this->hasOption( 'debug' ) ) {
$importer->setDebug( true );
}
return false;
}
}
+ if ( $this->hasOption( 'skip-to' ) ) {
+ $nthPage = (int)$this->getOption( 'skip-to' );
+ $importer->setPageOffset( $nthPage );
+ $this->pageCount = $nthPage - 1;
+ }
$importer->setPageCallback( [ $this, 'reportPage' ] );
$this->importCallback = $importer->setRevisionCallback(
[ $this, 'handleRevision' ] );