<?php
/**
* Take page text out of an XML dump file and preprocess it to obj.
- * It may be useful for getting preprocessor statistics or filling the
+ * It may be useful for getting preprocessor statistics or filling the
* preprocessor cache.
*
- * Copyright (C) 2011 Platonides - http://www.mediawiki.org/
+ * Copyright © 2011 Platonides - http://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* @file
* @ingroup Maintenance
*/
-
-require_once( dirname( __FILE__ ) . '/dumpIterator.php' );
+require_once( __DIR__ . '/dumpIterator.php' );
+
+/**
+ * Maintenance script that takes page text out of an XML dump file and
+ * preprocesses it to obj.
+ *
+ * @ingroup Maintenance
+ */
class PreprocessDump extends DumpIterator {
/* Variables for dressing up as a parser */
global $wgParser;
return $wgParser->getStripList();
}
-
+
public function __construct() {
parent::__construct();
$this->addOption( 'cache', 'Use and populate the preprocessor cache.', false, false );
if ( !$this->hasOption( 'cache' ) ) {
$wgPreprocessorCacheThreshold = false;
}
-
+
if ( $this->hasOption( 'preprocessor' ) ) {
$name = $this->getOption( 'preprocessor' );
} elseif ( isset( $wgParserConf['preprocessorClass'] ) ) {
$wgParser->firstCallInit();
$this->mPreprocessor = new $name( $this );
}
-
+
/**
* Callback function for each revision, preprocessToObj()
* @param $rev Revision
}
$maintClass = "PreprocessDump";
-require( RUN_MAINTENANCE_IF_MAIN );
+require_once( RUN_MAINTENANCE_IF_MAIN );