Updated: Comment #19
The current configuration override system is very powerful, but very complicated. The current system provides far more flexibility and overhead than is required to support locale overrides and arbitrary module-supplied overrides.
We currently fire off two events per config object during a read. Contrast this to D7, where there are no read-time events at all for the variable system.
The configuration system underlies most parts of Drupal, and should be as simple and fast as possible.
- bake in locale override support to the config system. this requires setting the language on the config factory - when set, the config system will automatically pick up overrides by looking for 'locale.$langcode.$config_name' objects
- provide a single override event to modules, to allow them to provide arbitrary overrides once per request. this is the equivalent of overriding global $conf in D7
With the current system you can't cache objects together as you have nfi what overrides might've happened. With the new patch, you put the language override in the cache key and you are done: we can cache raw config plus language overrides. That's a massive performance win even if we can't cache $conf / arbitrary overrides -- those will need to have their own caching indeed.
Finish the initial patch, get it in.
User interface changes
- complete removal of all ConfigContext objects and interfaces
- add an override event fired once per-request to allow modules to provide their overrides
- addition of getLanguage() and setLanguage() to to Config and ConfigFactory objects
- changing global settings.php overrides to use the new override event
Original report by beejeebus
Unless I was dreaming, we decided to replace the config context system with baked-in locale support and single-event based overrides.
This issue will track that. We may want a couple of smaller issues.
PASSED: [[SimpleTest]]: [MySQL] 59,527 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 59,321 pass(es). View
FAILED: [[SimpleTest]]: [MySQL] 59,298 pass(es), 1 fail(s), and 0 exception(s). View