In the Drupal 8.x cycle we've endeavoured to remove all global variables from Drupal to reduce side effects and make unit testing easy. However we've introduced a few during the development cycle. One of them is
$config. It is used in
settings.php to override config values.
Beta phase evaluation
|Issue category||Task because globals work|
|Issue priority||Major because it is a stated aim of Drupal to avoid using global state is possible. This was not achievable when global config overrides were first implement because we didn't yet have the kernel and settings class implemented.|
|Prioritized changes||The main goal of this issue is to reduce fragility by preventing side effects in the configuration system.|
|Disruption||Not disruptive as the method of declaring configuration overrides is exactly the same. There are no changes to settings.php. Some contrib tests might need to change if they are just setting global state but they can simply use
Why should this be an rc target
Because global state is problematic for having a predictable system and testing. It would be great to be able to remove the configuration globals during the Drupal 8 cycle. Therefore we should make them internal and provide getters so that code can rely on setting them in settings.php and having a way to access them that will not change.
FAILED: [[SimpleTest]]: [PHP 5.5 MySQL] 100,668 pass(es), 2 fail(s), and 0 exception(s). View
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 91,349 pass(es). View