if ( is_callable( $this->mNoticeCallback ) ) {
call_user_func( $this->mNoticeCallback, $msg, $params );
} else { # No ImportReporter -> CLI
- echo wfMessage( $msg, $params )->text() . "\n";
+ // T177997: the command line importers should call setNoticeCallback()
+ // for their own custom callback to echo the notice
+ wfDebug( wfMessage( $msg, $params )->text() . "\n" );
}
}
$importer->setRevisionCallback(
[ $this, 'handleRevision' ] );
+ $importer->setNoticeCallback( function ( $msg, $params ) {
+ echo wfMessage( $msg, $params )->text() . "\n";
+ } );
$this->from = $this->getOption( 'from', null );
$this->count = 0;
$this->pageCount = $nthPage - 1;
}
$importer->setPageCallback( [ $this, 'reportPage' ] );
+ $importer->setNoticeCallback( function ( $msg, $params ) {
+ echo wfMessage( $msg, $params )->text() . "\n";
+ } );
$this->importCallback = $importer->setRevisionCallback(
[ $this, 'handleRevision' ] );
$this->uploadCallback = $importer->setUploadCallback(
$importer->setRevisionCallback(
[ $this, 'handleRevision' ] );
+ $importer->setNoticeCallback( function ( $msg, $params ) {
+ echo wfMessage( $msg, $params )->text() . "\n";
+ } );
$importer->doImport();
MediaWikiServices::getInstance()->getMainConfig()
);
$importer->setRevisionCallback( [ $this, 'importRevision' ] );
+ $importer->setNoticeCallback( function ( $msg, $params ) {
+ echo wfMessage( $msg, $params )->text() . "\n";
+ } );
$importer->doImport();
}