Yaffs site version 1.1
[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 use Symfony\Component\Console\Command\Command;
13 use Drupal\Console\Core\Command\Shared\CommandTrait;
14 use Drupal\Console\Core\Style\DrupalStyle;
15
16 class AboutCommand extends Command
17 {
18     use CommandTrait;
19
20     /**
21      * {@inheritdoc}
22      */
23     protected function configure()
24     {
25         $this
26             ->setName('about')
27             ->setDescription($this->trans('commands.about.description'));
28     }
29
30     /**
31      * {@inheritdoc}
32      */
33     protected function execute(InputInterface $input, OutputInterface $output)
34     {
35         $io = new DrupalStyle($input, $output);
36         $application = $this->getApplication();
37
38         $aboutTitle = sprintf(
39             '%s (%s)',
40             $application->getName(),
41             $application->getVersion()
42         );
43
44         $io->setDecorated(false);
45         $io->title($aboutTitle);
46         $io->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             $io->writeln($commandInfo[0]);
75             $io->newLine();
76             $io->comment(sprintf('  %s', $commandInfo[1]));
77             $io->newLine();
78         }
79
80         $io->setDecorated(false);
81         $io->section($this->trans('commands.self-update.description'));
82         $io->setDecorated(true);
83         $io->comment('  drupal self-update');
84         $io->newLine();
85     }
86 }