Selective distinct/combine merge strategy. #22
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In Drush configuration files, it is possible to define additional paths where command files and alias file paths may be found. For example, the following config will make the Drush 9 configuration behavior similar to what Drush 8 does:
A problem arises, though, when there are multiple
drush.yml
files, each with their owninclude
&/oralias-path
configurations, then the current implementation will return the paths from only one of the configuration files. The paths in all of the other configuration files will be overwritten and ignored.What is needed to fix this limitation is a merge strategy that unions together all of the paths from all of the
drush.yml
files. However, it would not necessarily be appropriate to union all of the arrays from all configuration files.The preliminary idea in this PR is to provide an API to specify the exact path for config items where array values should be unioned rather than replaced.
Here is how it would be used in Drush
\Drush\Config\ConfigLocator
:I'm not sure what the right solution is here, though. If we go with a solution similar to this one, I think I'll switch from an array of strings to a class with an API.