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

Restricted Application added a project: User-Jayprakash12345. · View Herald TranscriptFeb 18 2019, 10:10 AM
Asrija1 claimed this task.Feb 23 2019, 4:59 AM
Asrija1 removed Asrija1 as the assignee of this task.Feb 23 2019, 5:13 AM
Asrija1 added a subscriber: Asrija1.
Asrija1 removed a subscriber: Asrija1.Feb 23 2019, 5:16 AM

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

Jdforrester-WMF closed this task as Resolved.Apr 6 2019, 7:59 PM
Jdforrester-WMF removed a project: Patch-For-Review.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Thank you!