getStripList(); } public function __construct() { parent::__construct(); $this->addOption( 'cache', 'Use and populate the preprocessor cache.', false, false ); $this->addOption( 'preprocessor', 'Preprocessor to use.', false, false ); } public function getDbType() { return Maintenance::DB_NONE; } public function checkOptions() { global $wgParser, $wgParserConf, $wgPreprocessorCacheThreshold; if ( !$this->hasOption( 'cache' ) ) { $wgPreprocessorCacheThreshold = false; } if ( $this->hasOption( 'preprocessor' ) ) { $name = $this->getOption( 'preprocessor' ); } elseif ( isset( $wgParserConf['preprocessorClass'] ) ) { $name = $wgParserConf['preprocessorClass']; } else { $name = Preprocessor_DOM::class; } $wgParser->firstCallInit(); $this->mPreprocessor = new $name( $this ); } /** * Callback function for each revision, preprocessToObj() * @param Revision $rev */ public function processRevision( $rev ) { $content = $rev->getContent( Revision::RAW ); if ( $content->getModel() !== CONTENT_MODEL_WIKITEXT ) { return; } try { $this->mPreprocessor->preprocessToObj( strval( $content->getNativeData() ), 0 ); } catch ( Exception $e ) { $this->error( "Caught exception " . $e->getMessage() . " in " . $rev->getTitle()->getPrefixedText() ); } } } $maintClass = PreprocessDump::class; require_once RUN_MAINTENANCE_IF_MAIN;