Merge "Fix usage of MediaWikiServices in comments and documentation"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 3 Mar 2019 14:36:53 +0000 (14:36 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 3 Mar 2019 14:36:53 +0000 (14:36 +0000)
includes/installer/Installer.php
includes/installer/WebInstaller.php

index 3ac152e..bc3fe29 100644 (file)
@@ -686,10 +686,10 @@ abstract class Installer {
         * @return string
         */
        public function parse( $text, $lineStart = false ) {
-               global $wgParser;
+               $parser = MediaWikiServices::getInstance()->getParser();
 
                try {
-                       $out = $wgParser->parse( $text, $this->parserTitle, $this->parserOptions, $lineStart );
+                       $out = $parser->parse( $text, $this->parserTitle, $this->parserOptions, $lineStart );
                        $html = $out->getText( [
                                'enableSectionEditLinks' => false,
                                'unwrap' => true,
index cda8612..e1070c6 100644 (file)
@@ -140,9 +140,9 @@ class WebInstaller extends Installer {
                $this->request = $request;
 
                // Add parser hooks
-               global $wgParser;
-               $wgParser->setHook( 'downloadlink', [ $this, 'downloadLinkHook' ] );
-               $wgParser->setHook( 'doclink', [ $this, 'docLink' ] );
+               $parser = MediaWikiServices::getInstance()->getParser();
+               $parser->setHook( 'downloadlink', [ $this, 'downloadLinkHook' ] );
+               $parser->setHook( 'doclink', [ $this, 'docLink' ] );
        }
 
        /**