‪TYPO3CMS  9.5
SiteShowCommand.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
19 use Symfony\Component\Console\Command\Command;
20 use Symfony\Component\Console\Input\InputArgument;
21 use Symfony\Component\Console\Input\InputInterface;
22 use Symfony\Component\Console\Output\OutputInterface;
23 use Symfony\Component\Console\Style\SymfonyStyle;
24 use Symfony\Component\Yaml\Yaml;
26 
30 class ‪SiteShowCommand extends Command
31 {
35  protected function ‪configure()
36  {
37  $this->setDescription('Shows the configuration of the specified site. Specify the identifier via "site:show <identifier>".')
38  ->addArgument(
39  'identifier',
40  InputArgument::REQUIRED,
41  'The identifier of the site'
42  );
43  }
44 
50  protected function ‪execute(InputInterface $input, OutputInterface ‪$output)
51  {
52  $io = new SymfonyStyle($input, ‪$output);
53  $siteFinder = new ‪SiteFinder();
54  $site = $siteFinder->getSiteByIdentifier($input->getArgument('identifier'));
55  $io->title('Site configuration for ' . $input->getArgument('identifier'));
56  $io->block(Yaml::dump($site->getConfiguration(), 4));
57  }
58 }
‪TYPO3\CMS\Core\Command\SiteShowCommand\execute
‪execute(InputInterface $input, OutputInterface $output)
Definition: SiteShowCommand.php:50
‪TYPO3\CMS\Core\Site\SiteFinder
Definition: SiteFinder.php:31
‪TYPO3\CMS\Core\Command\SiteShowCommand
Definition: SiteShowCommand.php:31
‪$output
‪$output
Definition: annotationChecker.php:113
‪TYPO3\CMS\Core\Command\SiteShowCommand\configure
‪configure()
Definition: SiteShowCommand.php:35
‪TYPO3\CMS\Core\Command
Definition: DumpAutoloadCommand.php:3