public function execute() {
if ( !( $this->hasOption( 'file' ) ^ $this->hasOption( 'dump' ) ) ) {
- $this->error( "You must provide a file or dump", true );
+ $this->fatalError( "You must provide a file or dump" );
}
$this->checkOptions();
if ( $this->getOption( 'dump' ) == '-' ) {
$source = new ImportStreamSource( $this->getStdin() );
} else {
- $this->error( "Sorry, I don't support dump filenames yet. "
- . "Use - and provide it on stdin on the meantime.", true );
+ $this->fatalError( "Sorry, I don't support dump filenames yet. "
+ . "Use - and provide it on stdin on the meantime." );
}
$importer = new WikiImporter( $source, $this->getConfig() );
$importer->setRevisionCallback(
[ $this, 'handleRevision' ] );
+ $importer->setNoticeCallback( function ( $msg, $params ) {
+ echo wfMessage( $msg, $params )->text() . "\n";
+ } );
$this->from = $this->getOption( 'from', null );
$this->count = 0;
if ( $this->getDbType() == Maintenance::DB_NONE ) {
global $wgUseDatabaseMessages, $wgLocalisationCacheConf, $wgHooks;
$wgUseDatabaseMessages = false;
- $wgLocalisationCacheConf['storeClass'] = 'LCStoreNull';
+ $wgLocalisationCacheConf['storeClass'] = LCStoreNull::class;
$wgHooks['InterwikiLoadPrefix'][] = 'DumpIterator::disableInterwikis';
}
}
}
}
-$maintClass = "SearchDump";
+$maintClass = SearchDump::class;
require_once RUN_MAINTENANCE_IF_MAIN;