X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fdrush%2Fdrush%2Fsrc%2FConfig%2FConfigLocator.php;fp=vendor%2Fdrush%2Fdrush%2Fsrc%2FConfig%2FConfigLocator.php;h=e61be7b651cabdb8d67fd2e2b66775bc0dd6e10f;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=c9948103822bc00335b200e02493322ce218dfa6;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/vendor/drush/drush/src/Config/ConfigLocator.php b/vendor/drush/drush/src/Config/ConfigLocator.php index c99481038..e61be7b65 100644 --- a/vendor/drush/drush/src/Config/ConfigLocator.php +++ b/vendor/drush/drush/src/Config/ConfigLocator.php @@ -5,7 +5,6 @@ use Consolidation\Config\Loader\ConfigLoaderInterface; use Drush\Config\Loader\YamlConfigLoader; use Consolidation\Config\Loader\ConfigProcessor; use Consolidation\Config\Util\EnvConfig; -use Symfony\Component\Finder\Finder; /** * Locate Drush configuration files and load them into the configuration @@ -299,6 +298,7 @@ class ConfigLocator // Make all of the config values parsed so far available in evaluations. $reference = $this->config()->export(); $processor = new ConfigProcessor(); + $processor->useMergeStrategyForKeys(['drush.paths.include', 'drush.paths.alias-path']); $context = $this->config->getContext($contextName); $processor->add($context->export()); @@ -421,7 +421,7 @@ class ConfigLocator { $builtin = $this->getBuiltinCommandFilePaths(); $included = $this->getIncludedCommandFilePaths($commandPaths); - $site = $this->getSiteCommandFilePaths(["$root/drush", dirname($root) . '/drush']); + $site = $this->getSiteCommandFilePaths($root); return array_merge( $builtin, @@ -461,29 +461,11 @@ class ConfigLocator * 'dirname($root)/drush' directory that contains a composer.json * file or a 'Commands' or 'src/Commands' directory. */ - protected function getSiteCommandFilePaths($directories) + protected function getSiteCommandFilePaths($root) { - $result = []; - - $directories = array_filter($directories, 'is_dir'); - - if (empty($directories)) { - return $result; - } + $directories = ["$root/drush", dirname($root) . '/drush', "$root/sites/all/drush"]; - // Find projects - $finder = new Finder(); - $finder->files() - ->ignoreUnreadableDirs() - ->path('#composer.json$|^src/Commands|^Commands#') - ->in($directories) - ->depth('<= 3'); - - foreach ($finder as $file) { - $result[] = dirname($file->getRealPath()); - } - - return $result; + return array_filter($directories, 'is_dir'); } /**