Add SettingsBuilder::finalize method. After the method is called, any attempt to modify the SettingsBuilder should throw exceptions. Call this method from Setup.php when we're done with SettingsBuilder
Description
Details
Project | Branch | Lines +/- | Subject | |
---|---|---|---|---|
mediawiki/core | master | +52 -1 | Settings: Prevent applying more settings after invoking `->finalize()` |
Event Timeline
I see that in Setup.php, once all settings have been loaded, the $wgSettings container is destroyed completely. Do we still need the finalize() method or will that method be replacing what unset() is doing?
In addition, it looks like finalize() will just be similar to what ExtensionRegistry::finish() does? I just want to know if we'll be doing ->finalize() instead of unset() @Pchelolo?
Yeah, finalize instead of unset. I'm already removing the unset in some of the other patches. $wgSettings is useful to have access to in tests.
Change 742984 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):
[mediawiki/core@master] Settings: Lock applying more settings after invoking `->finalize()`
Change 742984 merged by jenkins-bot:
[mediawiki/core@master] Settings: Prevent applying more settings after invoking `->finalize()`