X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrupal%2Fconsole%2Fsrc%2FCommand%2FConfig%2FEditCommand.php;fp=vendor%2Fdrupal%2Fconsole%2Fsrc%2FCommand%2FConfig%2FEditCommand.php;h=564648cd62493c461d871401ab41b3b69f282a13;hp=d142d711131b61cf244436a9a25786f0f4e8bfdb;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/vendor/drupal/console/src/Command/Config/EditCommand.php b/vendor/drupal/console/src/Command/Config/EditCommand.php index d142d7111..564648cd6 100644 --- a/vendor/drupal/console/src/Command/Config/EditCommand.php +++ b/vendor/drupal/console/src/Command/Config/EditCommand.php @@ -17,15 +17,11 @@ use Symfony\Component\Filesystem\Exception\IOExceptionInterface; use Drupal\Component\Serialization\Yaml; use Drupal\Core\Config\CachedStorage; use Drupal\Core\Config\ConfigFactory; -use Symfony\Component\Console\Command\Command; -use Drupal\Console\Core\Command\Shared\CommandTrait; -use Drupal\Console\Core\Style\DrupalStyle; +use Drupal\Console\Core\Command\Command; use Drupal\Console\Core\Utils\ConfigurationManager; class EditCommand extends Command { - use CommandTrait; - /** * @var ConfigFactory */ @@ -75,7 +71,8 @@ class EditCommand extends Command 'editor', InputArgument::OPTIONAL, $this->trans('commands.config.edit.arguments.editor') - ); + ) + ->setAliases(['ced']); } /** @@ -83,8 +80,6 @@ class EditCommand extends Command */ protected function execute(InputInterface $input, OutputInterface $output) { - $io = new DrupalStyle($input, $output); - $configName = $input->getArgument('config-name'); $editor = $input->getArgument('editor'); $config = $this->configFactory->getEditable($configName); @@ -95,7 +90,7 @@ class EditCommand extends Command $fileSystem = new Filesystem(); if (!$configName) { - $io->error($this->trans('commands.config.edit.messages.no-config')); + $this->getIo()->error($this->trans('commands.config.edit.messages.no-config')); return 1; } @@ -104,7 +99,7 @@ class EditCommand extends Command $fileSystem->mkdir($temporaryDirectory); $fileSystem->dumpFile($configFile, $this->getYamlConfig($configName)); } catch (IOExceptionInterface $e) { - $io->error($this->trans('commands.config.edit.messages.no-directory').' '.$e->getPath()); + $this->getIo()->error($this->trans('commands.config.edit.messages.no-directory').' '.$e->getPath()); return 1; } @@ -124,7 +119,7 @@ class EditCommand extends Command } if (!$process->isSuccessful()) { - $io->error($process->getErrorOutput()); + $this->getIo()->error($process->getErrorOutput()); return 1; } @@ -133,13 +128,11 @@ class EditCommand extends Command protected function interact(InputInterface $input, OutputInterface $output) { - $io = new DrupalStyle($input, $output); - $configName = $input->getArgument('config-name'); if (!$configName) { $configNames = $this->configFactory->listAll(); - $configName = $io->choice( - 'Choose a configuration', + $configName = $this->getIo()->choice( + $this->trans('commands.config.edit.messages.choose-configuration'), $configNames ); @@ -168,7 +161,7 @@ class EditCommand extends Command protected function getEditor() { $config = $this->configurationManager->getConfiguration(); - $editor = $config->get('application.editor', 'vi'); + $editor = $config->get('application.editor', ''); if ($editor != '') { return trim($editor);