X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FdumpIterator.php;h=31272bcaa6c3f5bca792b5bd153942e3273594ea;hb=c292cfd90f1b9f2939b6bc1e19e15700a87a037c;hp=4b2ff717e35ccbc373754ea2e5c77c2afebbaef0;hpb=166191535f486569277e95b7e6a3850b5db6757d;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/dumpIterator.php b/maintenance/dumpIterator.php index 4b2ff717e3..31272bcaa6 100644 --- a/maintenance/dumpIterator.php +++ b/maintenance/dumpIterator.php @@ -40,7 +40,7 @@ abstract class DumpIterator extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Does something with a dump"; + $this->addDescription( 'Does something with a dump' ); $this->addOption( 'file', 'File with text to run.', false, true ); $this->addOption( 'dump', 'XML dump to execute all revisions.', false, true ); $this->addOption( 'from', 'Article from XML dump to start from.', false, true ); @@ -54,7 +54,7 @@ abstract class DumpIterator extends Maintenance { $this->checkOptions(); if ( $this->hasOption( 'file' ) ) { - $revision = new WikiRevision; + $revision = new WikiRevision( $this->getConfig() ); $revision->setText( file_get_contents( $this->getOption( 'file' ) ) ); $revision->setTitle( Title::newFromText( @@ -73,10 +73,10 @@ abstract class DumpIterator extends Maintenance { $this->error( "Sorry, I don't support dump filenames yet. " . "Use - and provide it on stdin on the meantime.", true ); } - $importer = new WikiImporter( $source ); + $importer = new WikiImporter( $source, $this->getConfig() ); $importer->setRevisionCallback( - array( &$this, 'handleRevision' ) ); + [ $this, 'handleRevision' ] ); $this->from = $this->getOption( 'from', null ); $this->count = 0; @@ -164,7 +164,7 @@ class SearchDump extends DumpIterator { public function __construct() { parent::__construct(); - $this->mDescription = "Runs a regex in the revisions from a dump"; + $this->addDescription( 'Runs a regex in the revisions from a dump' ); $this->addOption( 'regex', 'Searching regex', true, true ); }