ENHANCEMENT 2x increase in scanning of files for ConfigManifest

This commit is contained in:
Jake Bentvelzen 2016-12-08 21:35:38 +11:00
parent 322d3e18fd
commit 085c8f5a43
2 changed files with 9 additions and 2 deletions

View File

@ -165,6 +165,10 @@ pair in the mask is removed
## Configuration YAML Syntax and Rules
<div class="alert" markdown="1">
As of Silverstripe 4, YAML files can no longer be placed any deeper than 2 directories deep. As this was an unintended bug, this change will only affect you if you nest your modules deeper than the top level of your project.
</div>
Each module can have a directory immediately underneath the main module directory called `_config/`. Inside this
directory you can add YAML files that contain values for the configuration system.

View File

@ -244,7 +244,9 @@ class ConfigManifest
'min_depth' => 0,
'name_regex' => '/(^|[\/\\\\])_config.php$/',
'ignore_tests' => !$includeTests,
'file_callback' => array($this, 'addSourceConfigFile')
'file_callback' => array($this, 'addSourceConfigFile'),
// Cannot be max_depth: 1 due to "/framework/admin/_config.php"
'max_depth' => 2
));
$finder->find($this->base);
@ -252,7 +254,8 @@ class ConfigManifest
$finder->setOptions(array(
'name_regex' => '/\.ya?ml$/',
'ignore_tests' => !$includeTests,
'file_callback' => array($this, 'addYAMLConfigFile')
'file_callback' => array($this, 'addYAMLConfigFile'),
'max_depth' => 2
));
$finder->find($this->base);