preprocessDump.php: Fix invalid Preprocessor instantiation
[lhc/web/wiklou.git] / maintenance / preprocessDump.php
index a62e019..f0e5a6c 100644 (file)
@@ -26,6 +26,7 @@
  */
 
 use MediaWiki\MediaWikiServices;
+use MediaWiki\Storage\RevisionRecord;
 
 require_once __DIR__ . '/dumpIterator.php';
 
@@ -72,8 +73,9 @@ class PreprocessDump extends DumpIterator {
                        $name = Preprocessor_DOM::class;
                }
 
-               MediaWikiServices::getInstance()->getParser()->firstCallInit();
-               $this->mPreprocessor = new $name( $this );
+               $parser = MediaWikiServices::getInstance()->getParser();
+               $parser->firstCallInit();
+               $this->mPreprocessor = new $name( $parser );
        }
 
        /**
@@ -81,7 +83,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;