* @ingroup Maintenance
*/
+use MediaWiki\MediaWikiServices;
+
require_once __DIR__ . '/dumpIterator.php';
/**
public $mPPNodeCount = 0;
public function getStripList() {
- global $wgParser;
- return $wgParser->getStripList();
+ $parser = MediaWikiServices::getInstance()->getParser();
+
+ return $parser->getStripList();
}
public function __construct() {
}
public function checkOptions() {
- global $wgParser, $wgParserConf, $wgPreprocessorCacheThreshold;
+ global $wgParserConf, $wgPreprocessorCacheThreshold;
if ( !$this->hasOption( 'cache' ) ) {
$wgPreprocessorCacheThreshold = false;
} elseif ( isset( $wgParserConf['preprocessorClass'] ) ) {
$name = $wgParserConf['preprocessorClass'];
} else {
- $name = 'Preprocessor_DOM';
+ $name = Preprocessor_DOM::class;
}
- $wgParser->firstCallInit();
+ MediaWikiServices::getInstance()->getParser()->firstCallInit();
$this->mPreprocessor = new $name( $this );
}
}
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() );
+ $this->error( "Caught exception " . $e->getMessage() . " in "
+ . $rev->getTitle()->getPrefixedText() );
}
}
}
-$maintClass = "PreprocessDump";
+$maintClass = PreprocessDump::class;
require_once RUN_MAINTENANCE_IF_MAIN;