Page MenuHomePhabricator

[Extension:ImportUsers] Remove the usage of global variable $wgUser, $wgOut, $wgLang
Closed, ResolvedPublic

Description

Problem

Now we are replacing the global variable by getting the context. The Classes which extends SpecialPage can directly access the context by $this.

Solution

Replace

  1. $wgUser with $this->getUser()
  2. $wgOut with $this->getOutput()
  3. $wgLang with $this->getLanguage()

in ImportUsers_body.php. If there are multiple usages then use a variable to store context instead of calling $this again and again.

Level

Easy

Reserved for Mini-MWT at VVIT (Feb 2019)

Details

Related Gerrit Patches:
mediawiki/extensions/ImportUsers : masterReplace the usage of global variable $wgUser, $wgOut, $wgLang

Event Timeline

Restricted Application added a project: User-Jayprakash12345. · View Herald TranscriptFeb 18 2019, 10:48 AM

Change 492440 had a related patch set uploaded (by HarikaMekala; owner: HarikaMekala):
[mediawiki/extensions/ImportUsers@master] emove the usage of global variable $wgUser, $wgOut, $wgLang

https://gerrit.wikimedia.org/r/492440

Change 492440 had a related patch set uploaded (by Jforrester; owner: HarikaMekala):
[mediawiki/extensions/ImportUsers@master] Replace the usage of global variable $wgUser, $wgOut, $wgLang

https://gerrit.wikimedia.org/r/492440

Change 492440 merged by jenkins-bot:
[mediawiki/extensions/ImportUsers@master] Replace the usage of global variable $wgUser, $wgOut, $wgLang

https://gerrit.wikimedia.org/r/492440

Jdforrester-WMF closed this task as Resolved.Apr 5 2019, 11:15 PM
Jdforrester-WMF removed a project: Patch-For-Review.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Thank you!