Merge "Type hint against LinkTarget in WatchedItemStore"
[lhc/web/wiklou.git] / maintenance / preprocessDump.php
index f8526d0..b9e084e 100644 (file)
@@ -25,6 +25,9 @@
  * @ingroup Maintenance
  */
 
+use MediaWiki\MediaWikiServices;
+use MediaWiki\Storage\RevisionRecord;
+
 require_once __DIR__ . '/dumpIterator.php';
 
 /**
@@ -40,9 +43,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 +59,7 @@ class PreprocessDump extends DumpIterator {
        }
 
        public function checkOptions() {
-               global $wgParser, $wgParserConf, $wgPreprocessorCacheThreshold;
+               global $wgParserConf, $wgPreprocessorCacheThreshold;
 
                if ( !$this->hasOption( 'cache' ) ) {
                        $wgPreprocessorCacheThreshold = false;
@@ -70,7 +73,7 @@ class PreprocessDump extends DumpIterator {
                        $name = Preprocessor_DOM::class;
                }
 
-               $wgParser->firstCallInit();
+               MediaWikiServices::getInstance()->getParser()->firstCallInit();
                $this->mPreprocessor = new $name( $this );
        }
 
@@ -79,7 +82,7 @@ class PreprocessDump extends DumpIterator {
         * @param Revision $rev
         */
        public function processRevision( $rev ) {
-               $content = $rev->getContent( Revision::RAW );
+               $content = $rev->getContent( RevisionRecord::RAW );
 
                if ( $content->getModel() !== CONTENT_MODEL_WIKITEXT ) {
                        return;