This patch implements a number of improvements to the Config object without any real* funtional change. Though these may seem unrelated issues, I think they make sense all in one patch for easier discussion:
- Delay config loading till the data is actually used, which will save some queries when building config objects.
- Move global $conf overrides to the ConfigFactory. It seems to me that using a global $conf inside a Config object is really bad encapsulation.*
- Use config name as a parameter for Config object constructor, which makes it cleaner and soves some lines.
- For the rest, it adds more flexible config overrides which are just read but never saved, that in case we need some runtime override of some value for anything.
* Minor changes to previous behavior:
- If you create a config object outside of the config factory, it won't get overrides which is actually a feature for install operations and in any case for giving modules full control over config objects
- Overrides from global $conf are only applied when the config object is created, so changing global $conf after we got the config object won't have any effect on it (which I believe is also a feature as as it gives us better encapsulation and more predictable data). See short discussion on #4, #5, #6 below
Also this is a small step for a bigger feature D8MI, which isfor what we need more flexible config overrides.
PASSED: [[SimpleTest]]: [MySQL] 40,010 pass(es). View
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch config-1671198-26.patch. Unable to apply patch. See the log in the details link for more information. View
PASSED: [[SimpleTest]]: [MySQL] 39,814 pass(es). View