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;