X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrupal%2Fconsole%2Fsrc%2FCommand%2FConfig%2FDebugCommand.php;fp=vendor%2Fdrupal%2Fconsole%2Fsrc%2FCommand%2FConfig%2FDebugCommand.php;h=0000000000000000000000000000000000000000;hp=ab05456263684dff9dccf37f1e0ad2e1f17cb74d;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/vendor/drupal/console/src/Command/Config/DebugCommand.php b/vendor/drupal/console/src/Command/Config/DebugCommand.php deleted file mode 100644 index ab0545626..000000000 --- a/vendor/drupal/console/src/Command/Config/DebugCommand.php +++ /dev/null @@ -1,123 +0,0 @@ -configFactory = $configFactory; - $this->configStorage = $configStorage; - parent::__construct(); - } - - /** - * {@inheritdoc} - */ - protected function configure() - { - $this - ->setName('config:debug') - ->setDescription($this->trans('commands.config.debug.description')) - ->addArgument( - 'name', - InputArgument::OPTIONAL, - $this->trans('commands.config.debug.arguments.name') - ); - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $io = new DrupalStyle($input, $output); - - $configName = $input->getArgument('name'); - if (!$configName) { - $this->getAllConfigurations($io); - } else { - $this->getConfigurationByName($io, $configName); - } - } - - /** - * @param $io DrupalStyle - */ - private function getAllConfigurations(DrupalStyle $io) - { - $names = $this->configFactory->listAll(); - $tableHeader = [ - $this->trans('commands.config.debug.arguments.name'), - ]; - $tableRows = []; - foreach ($names as $name) { - $tableRows[] = [ - $name, - ]; - } - - $io->table($tableHeader, $tableRows, 'compact'); - } - - /** - * @param $io DrupalStyle - * @param $config_name String - */ - private function getConfigurationByName(DrupalStyle $io, $config_name) - { - if ($this->configStorage->exists($config_name)) { - $tableHeader = [ - $config_name, - ]; - - $configuration = $this->configStorage->read($config_name); - $configurationEncoded = Yaml::encode($configuration); - $tableRows = []; - $tableRows[] = [ - $configurationEncoded, - ]; - - $io->table($tableHeader, $tableRows, 'compact'); - } else { - $io->error( - sprintf($this->trans('commands.config.debug.errors.not-exists'), $config_name) - ); - } - } -}