Security update for Core, with self-updated composer
[yaffs-website] / vendor / drupal / console-core / src / Command / AboutCommand.php
1 <?php
2
3 /**
4  * @file
5  * Contains \Drupal\Console\Core\Command\AboutCommand.
6  */
7
8 namespace Drupal\Console\Core\Command;
9
10 use Symfony\Component\Console\Input\InputInterface;
11 use Symfony\Component\Console\Output\OutputInterface;
12
13 /**
14  * Class AboutCommand
15  *
16  * @package Drupal\Console\Core\Command
17  */
18 class AboutCommand extends Command
19 {
20
21     /**
22      * {@inheritdoc}
23      */
24     protected function configure()
25     {
26         $this
27             ->setName('about')
28             ->setDescription($this->trans('commands.about.description'));
29     }
30
31     /**
32      * {@inheritdoc}
33      */
34     protected function execute(InputInterface $input, OutputInterface $output)
35     {
36         $application = $this->getApplication();
37
38         $aboutTitle = sprintf(
39             '%s (%s)',
40             $application->getName(),
41             $application->getVersion()
42         );
43
44         $this->getIo()->setDecorated(false);
45         $this->getIo()->title($aboutTitle);
46         $this->getIo()->setDecorated(true);
47
48         $commands = [
49             'init' => [
50                 $this->trans('commands.init.description'),
51                 'drupal init'
52             ],
53             'quick-start' => [
54                 $this->trans('commands.common.messages.quick-start'),
55                 'drupal quick:start'
56             ],
57             'site-new' => [
58                 $this->trans('commands.site.new.description'),
59                 'drupal site:new'
60             ],
61             'site-install' => [
62                 $this->trans('commands.site.install.description'),
63                 sprintf(
64                     'drupal site:install'
65                 )
66             ],
67             'list' => [
68                 $this->trans('commands.list.description'),
69                 'drupal list',
70             ]
71         ];
72
73         foreach ($commands as $command => $commandInfo) {
74             $this->getIo()->writeln($commandInfo[0]);
75             $this->getIo()->comment(sprintf(' %s', $commandInfo[1]));
76             $this->getIo()->newLine();
77         }
78
79         $this->getIo()->writeln($this->trans('commands.self-update.description'));
80         $this->getIo()->comment('  drupal self-update');
81         $this->getIo()->newLine();
82     }
83 }