X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpreprocessDump.php;h=a62e0196a5932f1a5085a6c20e8d943f0af20a0e;hb=0ab6111f8553ba71e14da4dac9b7db61891329d2;hp=d540e8f9020355b80289ef154d8a557f44739ef5;hpb=16c80e429be5904fb42a93f260f8de3d18f0c692;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/preprocessDump.php b/maintenance/preprocessDump.php index d540e8f902..a62e0196a5 100644 --- a/maintenance/preprocessDump.php +++ b/maintenance/preprocessDump.php @@ -25,6 +25,8 @@ * @ingroup Maintenance */ +use MediaWiki\MediaWikiServices; + require_once __DIR__ . '/dumpIterator.php'; /** @@ -40,9 +42,9 @@ class PreprocessDump extends DumpIterator { public $mPPNodeCount = 0; public function getStripList() { - global $wgParser; + $parser = MediaWikiServices::getInstance()->getParser(); - return $wgParser->getStripList(); + return $parser->getStripList(); } public function __construct() { @@ -56,7 +58,7 @@ class PreprocessDump extends DumpIterator { } public function checkOptions() { - global $wgParser, $wgParserConf, $wgPreprocessorCacheThreshold; + global $wgParserConf, $wgPreprocessorCacheThreshold; if ( !$this->hasOption( 'cache' ) ) { $wgPreprocessorCacheThreshold = false; @@ -70,7 +72,7 @@ class PreprocessDump extends DumpIterator { $name = Preprocessor_DOM::class; } - $wgParser->firstCallInit(); + MediaWikiServices::getInstance()->getParser()->firstCallInit(); $this->mPreprocessor = new $name( $this ); } @@ -86,7 +88,7 @@ class PreprocessDump extends DumpIterator { } try { - $this->mPreprocessor->preprocessToObj( strval( $content->getNativeData() ), 0 ); + $this->mPreprocessor->preprocessToObj( strval( $content->getText() ), 0 ); } catch ( Exception $e ) { $this->error( "Caught exception " . $e->getMessage() . " in " . $rev->getTitle()->getPrefixedText() );