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