Skip to content

Commit

Permalink
Add back editing of aliases and config files in core-edit
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Oct 5, 2017
1 parent 90e89fd commit 529829b
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/Commands/core/EditCommands.php
Expand Up @@ -3,9 +3,12 @@

use Drush\Commands\DrushCommands;
use Drush\Drush;
use Drush\SiteAlias\SiteAliasManagerAwareInterface;
use Drush\SiteAlias\SiteAliasManagerAwareTrait;

class EditCommands extends DrushCommands
class EditCommands extends DrushCommands implements SiteAliasManagerAwareInterface
{
use SiteAliasManagerAwareTrait;

/**
* Edit drushrc, site alias, and Drupal settings.php files.
Expand Down Expand Up @@ -72,15 +75,17 @@ public function load($headers = true)
}
}

if ($rcs = drush_get_context_options('context-path', true)) {
if ($rcs = Drush::config()->get('runtime.config.paths')) {
// @todo filter out any files that are within Drush.
$rcs = array_combine($rcs, $rcs);
if ($headers) {
$rcs_header = array('drushrc' => '-- Drushrc --');
}
}
// TODO: List alias files
$aliases = [];
if (!empty($aliases)) {
$aliases = drush_map_assoc($aliases);

if ($aliases = $this->siteAliasManager()->listAllFilePaths()) {
sort($aliases);
$aliases = array_combine($aliases, $aliases);
if ($headers) {
$aliases_header = array('aliases' => '-- Aliases --');
}
Expand All @@ -98,11 +103,8 @@ public function load($headers = true)
$drupal_header = array('drupal' => '-- Drupal --');
}
}
// TODO: how can we get a list of Drush commands and their paths?
$commands = []; // drush_get_commands();
ksort($commands);

return array_merge($php_header, $php, $bash_header, $bash, $rcs_header, $rcs, $aliases_header, $aliases, $commandfiles_header, $commandfiles, $drupal_header, $drupal);
return array_merge($php_header, $php, $bash_header, $bash, $rcs_header, $rcs, $aliases_header, $aliases, $drupal_header, $drupal);
}

public static function phpIniFiles()
Expand Down

0 comments on commit 529829b

Please sign in to comment.