Page MenuHomePhabricator

[Extension:UserExport] Remove the usage of global variable $wgUser, $wgRequest, $wgOut
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()

in UserExport.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, 11:12 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 492046 had a related patch set uploaded (by Ananth subray; owner: Ananth subray):
[mediawiki/extensions/UserExport@master] Removed the usage of global variable $wgUser, $wgRequest, $wgOut

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

Change 492046 merged by jenkins-bot:
[mediawiki/extensions/UserExport@master] Removed the usage of global variable $wgUser, $wgRequest, $wgOut

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

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

Thank you!