Page MenuHomePhabricator

doMaintenance.php creates ConfigFactory::getDefaultInstance() before Setup.php is run
Closed, ResolvedPublic

Description

$maintenance->setConfig( ConfigFactory::getDefaultInstance()->makeConfig( 'main' ) );
$maintenance->finalSetup();
// Some last includes
require_once "$IP/includes/Setup.php";

We now load extensions from the top of Setup.php, meaning that if they want to register their config types, it's too late. AFAICT we cannot move up Setup.php to before finalSetup() because it needs to run before extension functions. So I'm thinking we should just call Maintenance::setConfig() *after* Setup.php runs and say that finalSetup has to use globals for now.

Event Timeline

Legoktm raised the priority of this task from to Needs Triage.
Legoktm updated the task description. (Show Details)
Legoktm added subscribers: Legoktm, Mattflaschen-WMF.

Change 194281 had a related patch set uploaded (by Legoktm):
maintenance: Defer initilization of 'main' Config until after Setup.php runs

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

Legoktm set Security to None.
Legoktm moved this task from Backlog to Needs Review/Feedback on the MediaWiki-Core-Team board.
Legoktm moved this task from Backlog to In Progress on the MediaWiki-Configuration board.

Change 194281 merged by Legoktm:
maintenance: Defer initilization of 'main' Config until after Setup.php runs

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