Skip to content

Commit

Permalink
Fixes #3277: Site-specific drush.yml file not loaded.
Browse files Browse the repository at this point in the history
  • Loading branch information
grasmash committed Dec 29, 2017
1 parent 51bf721 commit 25fad2c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
36 changes: 34 additions & 2 deletions src/Config/ConfigLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,42 @@ public function addDrushConfig($drushProjectDir)
* Add any configuration files found around the Drupal root of the
* selected site.
*
* @param Path to the selected Drupal site
* @param $siteRoot
* Path to the selected Drupal site.
* @return $this
*/
public function addSitewideConfig($siteRoot)
public function addDrupalConfig($siteRoot)
{
// There might not be a site.
if (!is_dir($siteRoot)) {
return;
}

// We might have already processed this root.
$siteRoot = realpath($siteRoot);
if (in_array($siteRoot, $this->siteRoots)) {
return;
}

// Remember that we've seen this location.
$this->siteRoots[] = $siteRoot;

$this->addConfigPaths(self::DRUPAL_CONTEXT, [ dirname($siteRoot) . '/drush', "$siteRoot/drush", "$siteRoot/sites/all/drush" ]);
return $this;
}

/**
* Add any configuration files found around the Drupal root of the
* selected site.
*
* @param $siteRoot
* Path to the selected Drupal site.
* @param $uri
* Site URI.
*
* @return $this
*/
public function addSiteConfig($siteRoot, $uri)
{
// There might not be a site.
if (!is_dir($siteRoot)) {
Expand Down
5 changes: 3 additions & 2 deletions src/Preflight/Preflight.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ public function preflight($argv)
// Extend configuration and alias files to include files in
// target site.
$root = $this->findSelectedSite();
$this->configLocator->addSitewideConfig($root);
$this->configLocator->addDrupalConfig($root);
$this->configLocator->addSiteConfig($root, $this->preflightArgs->uri());
$this->configLocator->setComposerRoot($this->drupalFinder()->getComposerRoot());

// Look up the locations where alias files may be found.
Expand All @@ -276,7 +277,7 @@ public function preflight($argv)

// If we did not redispatch, then add the site-wide config for the
// new root (if the root did in fact change) and continue.
$this->configLocator->addSitewideConfig($root);
$this->configLocator->addDrupalConfig($root);

// Remember the paths to all the files we loaded, so that we can
// report on it from Drush status or wherever else it may be needed.
Expand Down

0 comments on commit 25fad2c

Please sign in to comment.