5 * Contains \Drupal\Console\Command\Config\SettingsDebugCommand.
8 namespace Drupal\Console\Command\Config;
10 use Symfony\Component\Console\Input\InputInterface;
11 use Symfony\Component\Console\Output\OutputInterface;
12 use Drupal\Component\Serialization\Yaml;
13 use Drupal\Console\Core\Style\DrupalStyle;
14 use Symfony\Component\Console\Command\Command;
15 use Drupal\Console\Core\Command\Shared\CommandTrait;
16 use Drupal\Core\Site\Settings;
21 * @package Drupal\Console\Command\Config
23 class SettingsDebugCommand extends Command
33 * SettingsDebugCommand constructor.
35 * @param Settings $settings
37 public function __construct(Settings $settings)
39 $this->settings = $settings;
41 parent::__construct();
46 protected function configure()
49 ->setName('config:settings:debug')
50 ->setDescription($this->trans('commands.config.settings.debug.description'))
51 ->setHelp($this->trans('commands.config.settings.debug.help'));
57 protected function execute(InputInterface $input, OutputInterface $output)
59 $io = new DrupalStyle($input, $output);
61 $settingKeys = array_keys($this->settings->getAll());
64 $io->info($this->trans('commands.config.settings.debug.messages.current'));
67 foreach ($settingKeys as $settingKey) {
68 $settingValue = $this->settings->get($settingKey);
69 $io->comment($settingKey . ': ', is_array($settingValue));
70 $io->write(Yaml::encode($settingValue));