Security update for Core, with self-updated composer
[yaffs-website] / vendor / drupal / console-core / src / Command / Debug / SettingsCommand.php
diff --git a/vendor/drupal/console-core/src/Command/Debug/SettingsCommand.php b/vendor/drupal/console-core/src/Command/Debug/SettingsCommand.php
new file mode 100644 (file)
index 0000000..224bd63
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Console\Core\Command\Debug\SettingsCommand.
+ */
+
+namespace Drupal\Console\Core\Command\Debug;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Drupal\Console\Core\Command\Command;
+use Drupal\Console\Core\Utils\ConfigurationManager;
+use Symfony\Component\Yaml\Yaml;
+
+/**
+ * Class SettingsCommand
+ *
+ * @package Drupal\Console\Core\Command\Settings
+ */
+class SettingsCommand extends Command
+{
+    /**
+     * @var ConfigurationManager
+     */
+    protected $configurationManager;
+
+    /**
+     * CheckCommand constructor.
+     *
+     * @param ConfigurationManager $configurationManager
+     */
+    public function __construct(
+        ConfigurationManager $configurationManager
+    ) {
+        $this->configurationManager = $configurationManager;
+        parent::__construct();
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function configure()
+    {
+        $this
+            ->setName('debug:settings')
+            ->setDescription($this->trans('commands.debug.settings.description'))
+            ->setAliases(['dse']);
+        ;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        $configuration = $this->configurationManager->getConfiguration();
+        $configApplication['application'] = $configuration->getRaw('application');
+
+        unset($configApplication['application']['autowire']);
+        unset($configApplication['application']['languages']);
+
+        $this->getIo()->write(Yaml::dump($configApplication, 6, 2));
+        $this->getIo()->newLine();
+
+        return 0;
+    }
+}