Page MenuHomePhabricator

[Extension:LastUserLogin] Remove the usage of global variable $wgUser, $wgRequest, $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. $wgRequest with $this->getRequest()
  3. $wgOut with $this->getOutput()
  4. $wgLang with $this->getLanguage()

in LastUserLogin.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

Asrija1 added a subscriber: Asrija1.

Change 492437 had a related patch set uploaded (by Naga sai sravanth; owner: Naga sai sravanth):
[mediawiki/extensions/GrowthExperiments@master] Replaced rawParams() with plaintextParams()

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

Change 492441 had a related patch set uploaded (by SuswethaK; owner: SuswethaK):
[mediawiki/extensions/LastUserLogin@master] Remove the usage of global variable $wgUser, $wgRequest, $wgOut, $wgLang.

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

Change 492437 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] Replaced rawParams() with plaintextParams()

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

Change 492441 had a related patch set uploaded (by D3r1ck01; owner: SuswethaK):
[mediawiki/extensions/LastUserLogin@master] LastUserLogin: Replace the usage of global variables

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

Change 492441 merged by jenkins-bot:
[mediawiki/extensions/LastUserLogin@master] LastUserLogin: Replace the usage of global variables

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