Page MenuHomePhabricator

Reduce uses of RequestContext::getMain in MediaWiki code
Open, Needs TriagePublic

Description

This task suggests the goal to dramatically reduce the use of global context across both core and extension code.
It could be closed once RequestContext::getMain (or analogous pattern) once there is

  • a precise list of scenarios where calling RequestContext::getMain is truly appropriate,
  • code is adjusted to only call RequestContext::getMain in precisely these cases.

This would include many complex injections, hook signature adjustments, and potentially deprecations of entire code paths.
This is a very long-term goal, which could well stretch across more than a decade.
Using RequestContext is still preferable if the alternative is calling globals like $wgLang, $wgRequest, $wgOut etc.