From: Derick Alangi Date: Sun, 3 Mar 2019 12:23:47 +0000 (+0100) Subject: installer: Replace the use of global $wgParser with services X-Git-Tag: 1.34.0-rc.0~2676 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=3d662e93a2787cc58ed46418d2e911fd3df15f92;p=lhc%2Fweb%2Fwiklou.git installer: Replace the use of global $wgParser with services global $wgParser was deprecated in 1.32 and services are used instead to get the parser object via MediaWikiServices. Making this replacement as we're avoiding globals. Change-Id: I967a52c481bfcc83552053a03e88acb038810828 --- diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 3ac152e9be..bc3fe29b77 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -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, diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index cda8612956..e1070c6e8f 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -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' ] ); } /**