Page MenuHomePhabricator

MediaWikiServices should not rely on globals
Open, Needs TriagePublic

Description

MediaWikiServices::getInstance() lazy-initializes the service container and is hardcoded to use GlobalVarConfig, which is not so great. resetGlobalInstance can be used to replace that configuration, but it's a bit overcomplicated and causes T153256. It would be nicer if endpoints would have to explicitly create the services container and pass in a configuration object, and getInstance would just throw if called before that. (And then the long term goal is that nothing but endpoints use the service container so getInstance won't be needed at all...)

Event Timeline

Tgr created this task.Mar 20 2018, 6:29 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 20 2018, 6:29 AM
Tgr renamed this task from MediaWIkiServices should not rely on globals to MediaWikiServices should not rely on globals.Mar 20 2018, 6:31 AM