Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / drush / drush / src / Config / ConfigLocator.php
index c9948103822bc00335b200e02493322ce218dfa6..e61be7b651cabdb8d67fd2e2b66775bc0dd6e10f 100644 (file)
@@ -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');
     }
 
     /**