Page MenuHomePhabricator

Make OutputPage's mw.config array extendable internally instead of hard coded
Closed, ResolvedPublic


MediaWiki has two queues for mw.config variables. A site-wide set defined and outputted by ResourceLoader's startup module (i.e. wgSiteName, wgLoadScript, wgScriptPath, etc.). And one that is page specific (skin, wgPageName, wgUserName etc.).

The latter is hardcoded in OutputPage->getJSVars. Although it can be extended by extensions through the MakeGlobalVariablesScript, it's still annoying to have to define these variables in the hooks file instead of in, for example, the SpecialPage class itself. Another problem is access to the current context's Title object. I added $out to the hook in r96015 (which has getTitle()) but that only makes it a little but nicer.

the hard coded array should be an object member that can be extended via an add*() method. That way a SpecialPage (or for example ProtectionForm - poke bug 31230), can simply do $out->addThingy('wgFoo, 'bar')

Version: 1.18.x
Severity: enhancement


ReferenceSource BranchDest BranchAuthorTitle
repos/releng/cli!391fix-docker-updatemainaddshoreFix mw docker update
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 21 2014, 11:47 PM
bzimport set Reference to bz31233.