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)

Event Timeline

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