Skip to content

Commit

Permalink
Processing configuration files recursively.
Browse files Browse the repository at this point in the history
  • Loading branch information
grasmash committed Jan 3, 2018
1 parent 5fbd8f3 commit 89aef5c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Config/ConfigLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class ConfigLocator

protected $configFilePaths = [];

protected $processedConfigPaths = [];

/*
* From context.inc:
*
Expand Down Expand Up @@ -308,6 +310,15 @@ public function addConfigPaths($contextName, $paths)
$this->addToSources($processor->sources());
$context->import($processor->export($reference));
$this->config->addContext($contextName, $context);
$this->processedConfigPaths = array_merge($this->processedConfigPaths, $paths);

// Recursive case.
if ($context->has('drush.paths.config')) {
$new_config_paths = array_diff((array) $context->get('drush.paths.config'), $this->processedConfigPaths);
if ($new_config_paths) {
$this->addConfigPaths($contextName, $new_config_paths);
}
}

return $this;
}
Expand Down

0 comments on commit 89aef5c

Please sign in to comment.