Page MenuHomePhabricator

[Extension:CloseWikis] 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 SpecialCloseWiki.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 492449 had a related patch set uploaded (by Nivas10798; owner: Nivas10798):
[mediawiki/extensions/CloseWikis@master] Remove the usage of global variable $wgUser, $wgRequest, $wgOut

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

Change 492449 had a related patch set uploaded (by D3r1ck01; owner: Nivas10798):
[mediawiki/extensions/CloseWikis@master] SpecialCloseWiki: Replace the usage of global variables

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

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

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

Jdforrester-WMF removed a project: Patch-For-Review.
Jdforrester-WMF subscribed.

Thank you! Sorry for the trouble getting this merged.