EditPage uses a ton of global objects ($wgOut, $wgUser, etc.). These should be replaced with the appropriate RequestContext function instead.
A getContext() function and $this->context member variable were added in rMW841c4076574b: EditPage: Add getContext() function.
Then, four commits were made to switch global objects out for context equivalents (1000 line chunks):
- rMWf2f810181aa4: EditPage: Use context instead of globals (1/4)
- rMWafa630749a39: EditPage: Use context instead of globals (2/4)
- rMW27fd11095213: EditPage: Use context instead of globals (3/4)
- rMW589cadedf317: EditPage: Use context instead of globals (4/4)
These were reverted in rMW5ce43a986133: Revert serie of "EditPage: Use context instead of globals" due to breakage in LiquidThreads: T143889: Replies impossible: The content format json is not supported by the content model.
We need to check other Wikimedia-deployed extensions and then re-apply the de-globalization change.
- $wgAjaxEditStash: 2 uses
- $wgAllowUserCss: 2 uses
- $wgAllowUserJs: 2 uses
- $wgBrowserBlackList: 3 uses - gone with T67297: Remove $wgBrowserBlackList and associated EditPage methods
- $wgContentHandlerUseDB: 3 uses
- $wgContLang: 5 uses - OK, no context based replacement
- $wgEnableUploads: 1 use - static
- $wgForeignFileRepos: 2 uses - static
- $wgMaxArticleSize: 4 uses
- $wgOut: 2 uses - remaining uses will go away with T30856: Remove classic edit toolbar from core
- $wgParser: 8 uses - OK, no context based replacement
- $wgPreviewOnOpenNamespaces: 3 uses
- $wgRawHtml: 2 uses
- $wgRequest: 13 uses
- $wgRightsText: 3 uses - static
- $wgSpamRegex: 4 uses - static
- $wgSummarySpamRegex: 3 uses - static
- $wgTitle: 3 uses - only as fallback. Follow-up is T176526: Remove $wgTitle fallback from EditPage in MW1.36
- $wgUseMediaWikiUIEverywhere: 2 uses