X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrenderDump.php;h=cc5ae5961ebda2a3f2550681ef20cbbbb4a3a6fa;hb=ae031e237eab8e2023d0fe128f9749a8a43ea439;hp=169f512cfa66a2e42e61b4370cd969b6782a6035;hpb=280cb03b4d87e864a723686daf5d1699b3566ec1;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/renderDump.php b/maintenance/renderDump.php index 169f512cfa..cc5ae5961e 100644 --- a/maintenance/renderDump.php +++ b/maintenance/renderDump.php @@ -43,7 +43,8 @@ class DumpRenderer extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Take page text out of an XML dump file and render basic HTML out to files"; + $this->addDescription( + 'Take page text out of an XML dump file and render basic HTML out to files' ); $this->addOption( 'output-dir', 'The directory to output the HTML files to', true, true ); $this->addOption( 'prefix', 'Prefix for the rendered files (defaults to wiki)', false, true ); $this->addOption( 'parser', 'Use an alternative parser class', false, true ); @@ -61,10 +62,13 @@ class DumpRenderer extends Maintenance { } $source = new ImportStreamSource( $this->getStdin() ); - $importer = new WikiImporter( $source ); + $importer = new WikiImporter( $source, $this->getConfig() ); $importer->setRevisionCallback( - array( &$this, 'handleRevision' ) ); + [ $this, 'handleRevision' ] ); + $importer->setNoticeCallback( function ( $msg, $params ) { + echo wfMessage( $msg, $params )->text() . "\n"; + } ); $importer->doImport(); @@ -119,5 +123,5 @@ class DumpRenderer extends Maintenance { } } -$maintClass = "DumpRenderer"; +$maintClass = DumpRenderer::class; require_once RUN_MAINTENANCE_IF_MAIN;