Skip to content

Commit

Permalink
Merge branch 'conf-paths-in-status'
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson committed Sep 30, 2017
2 parents 02a2719 + f343a19 commit 195ed0a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/Commands/core/StatusCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ public function getPropertyList($options)
$status_table['drush-script'] = DRUSH_COMMAND;
$status_table['drush-version'] = Drush::getVersion();
$status_table['drush-temp'] = drush_find_tmp();
$status_table['drush-conf'] = drush_flatten_array(drush_get_context_options('context-path', ''));

$status_table['drush-conf'] = Drush::config()->get('runtime.config.paths');
// List available alias files
$alias_files = $this->siteAliasManager()->listAllFilePaths();
sort($alias_files);
Expand Down
15 changes: 10 additions & 5 deletions src/Config/ConfigLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class ConfigLocator

protected $siteRoots = [];

protected $configFilePaths = [];

/*
* From context.inc:
*
Expand Down Expand Up @@ -93,6 +95,8 @@ public function __construct()
$this->config->addPlaceholder(self::ENVIRONMENT_CONTEXT);

$this->isLocal = false;

$this->configFilePaths = [];
}

/**
Expand All @@ -116,6 +120,11 @@ public function sources()
return $this->sources;
}

public function configFilePaths()
{
return $this->configFilePaths;
}

protected function addToSources(array $sources)
{
if (!is_array($this->sources)) {
Expand Down Expand Up @@ -217,13 +226,9 @@ public function addConfigPaths($contextName, $paths)
protected function addConfigCandidates(ConfigProcessor $processor, ConfigLoaderInterface $loader, $paths, $candidates)
{
$configFiles = $this->locateConfigs($paths, $candidates);
if (empty($configFiles)) {
return;
}

// TODO: store `$configFiles` and make them available to `drush status`
foreach ($configFiles as $configFile) {
$processor->extend($loader->load($configFile));
$this->configFilePaths[] = $configFile;
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/Preflight/Preflight.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ protected function doRun($argv)
$root = $this->setSelectedSite($selfAliasRecord->localRoot());
$configLocator->addSitewideConfig($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.

$config->set('runtime.config.paths', $configLocator->configFilePaths());

// We need to check the php minimum version again, in case anyone
// has set it to something higher in one of the config files we loaded.
$this->verify->confirmPhpVersion($config->get('drush.php.minimum-version'));
Expand Down

0 comments on commit 195ed0a

Please sign in to comment.