silverstripe/silverstripe-framework — pull request #2173 by hafriedlander (2013-07-01 22:12:10+00:00)
Title: Fixes to Only and Except rules in config system (fixes #2043 amongst others)

Fix issues with Only and Except rules (like issue #2043).

- Adds some tests

- Makes them work at all (previously the split between matchesPrefilterVariantRules and matchesVariantRules caused all rules to fail rule checks).

- Re-checks Only and Except rules after executing _config.php files so that changes to the state of the system (such as changing the environment type) are reflected in which Only and Except rules are used

(Note: this check only occurs once, after all _config.php code has been executed, so if you change which rules match in one _config.php, then use Config::inst()->get() in another _config.php, the result will still be from the old rules)

Deliberately written to be "smallest possible change", rather than fixing any larger code design issues.

Note this is an updated version of https://github.com/silverstripe/silverstripe-framework/pull/2170 which fixes an issue that one had with caching