From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- maintenance/preprocessDump.php | 86 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 maintenance/preprocessDump.php (limited to 'maintenance/preprocessDump.php') diff --git a/maintenance/preprocessDump.php b/maintenance/preprocessDump.php new file mode 100644 index 00000000..ad9b4f14 --- /dev/null +++ b/maintenance/preprocessDump.php @@ -0,0 +1,86 @@ +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'; + } + + $wgParser->firstCallInit(); + $this->mPreprocessor = new $name( $this ); + } + + /** + * Callback function for each revision, preprocessToObj() + * @param $rev Revision + */ + public function processRevision( $rev ) { + try { + $this->mPreprocessor->preprocessToObj( $rev->getText(), 0 ); + } + catch(Exception $e) { + $this->error("Caught exception " . $e->getMessage() . " in " . $rev->getTitle()->getPrefixedText() ); + } + } +} + +$maintClass = "PreprocessDump"; +require_once( RUN_MAINTENANCE_IF_MAIN ); + -- cgit v1.2.3-54-g00ecf