diff --git a/src/Commands/core/StatusCommands.php b/src/Commands/core/StatusCommands.php index c4c1b54634..11a7021187 100644 --- a/src/Commands/core/StatusCommands.php +++ b/src/Commands/core/StatusCommands.php @@ -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); diff --git a/src/Config/ConfigLocator.php b/src/Config/ConfigLocator.php index 0482dba615..75f4e9aca2 100644 --- a/src/Config/ConfigLocator.php +++ b/src/Config/ConfigLocator.php @@ -38,6 +38,8 @@ class ConfigLocator protected $siteRoots = []; + protected $configFilePaths = []; + /* * From context.inc: * @@ -93,6 +95,8 @@ public function __construct() $this->config->addPlaceholder(self::ENVIRONMENT_CONTEXT); $this->isLocal = false; + + $this->configFilePaths = []; } /** @@ -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)) { @@ -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; } } diff --git a/src/Preflight/Preflight.php b/src/Preflight/Preflight.php index 4700023114..a06cce6193 100644 --- a/src/Preflight/Preflight.php +++ b/src/Preflight/Preflight.php @@ -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'));