Merge "mw.Feedback: If the message is posted remotely, link the title correctly"
[lhc/web/wiklou.git] / maintenance / preprocessDump.php
index bb3d68b..d540e8f 100644 (file)
@@ -4,7 +4,7 @@
  * It may be useful for getting preprocessor statistics or filling the
  * preprocessor cache.
  *
- * Copyright © 2011 Platonides - http://www.mediawiki.org/
+ * Copyright © 2011 Platonides - https://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
@@ -25,7 +25,7 @@
  * @ingroup Maintenance
  */
 
-require_once( __DIR__ . '/dumpIterator.php' );
+require_once __DIR__ . '/dumpIterator.php';
 
 /**
  * Maintenance script that takes page text out of an XML dump file and
@@ -41,6 +41,7 @@ class PreprocessDump extends DumpIterator {
 
        public function getStripList() {
                global $wgParser;
+
                return $wgParser->getStripList();
        }
 
@@ -66,7 +67,7 @@ class PreprocessDump extends DumpIterator {
                } elseif ( isset( $wgParserConf['preprocessorClass'] ) ) {
                        $name = $wgParserConf['preprocessorClass'];
                } else {
-                       $name = 'Preprocessor_DOM';
+                       $name = Preprocessor_DOM::class;
                }
 
                $wgParser->firstCallInit();
@@ -75,7 +76,7 @@ class PreprocessDump extends DumpIterator {
 
        /**
         * Callback function for each revision, preprocessToObj()
-        * @param $rev Revision
+        * @param Revision $rev
         */
        public function processRevision( $rev ) {
                $content = $rev->getContent( Revision::RAW );
@@ -86,12 +87,12 @@ class PreprocessDump extends DumpIterator {
 
                try {
                        $this->mPreprocessor->preprocessToObj( strval( $content->getNativeData() ), 0 );
-               }
-               catch(Exception $e) {
-                       $this->error("Caught exception " . $e->getMessage() . " in " . $rev->getTitle()->getPrefixedText() );
+               } catch ( Exception $e ) {
+                       $this->error( "Caught exception " . $e->getMessage() . " in "
+                               . $rev->getTitle()->getPrefixedText() );
                }
        }
 }
 
-$maintClass = "PreprocessDump";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+$maintClass = PreprocessDump::class;
+require_once RUN_MAINTENANCE_IF_MAIN;