‪TYPO3CMS  ‪main
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 {
33  public function ‪__construct(protected readonly ‪SiteFinder $siteFinder)
34  {
35  parent::__construct();
36  }
37 
41  protected function ‪configure()
42  {
43  $this->addArgument(
44  'identifier',
45  InputArgument::REQUIRED,
46  'The identifier of the site'
47  );
48  }
49 
53  protected function ‪execute(InputInterface $input, OutputInterface ‪$output): int
54  {
55  $io = new SymfonyStyle($input, ‪$output);
56  $site = $this->siteFinder->getSiteByIdentifier($input->getArgument('identifier'));
57  $io->title('Site configuration for ' . $input->getArgument('identifier'));
58  $io->block(Yaml::dump($site->getConfiguration(), 4));
59  return Command::SUCCESS;
60  }
61 }
‪TYPO3\CMS\Core\Command\SiteShowCommand\__construct
‪__construct(protected readonly SiteFinder $siteFinder)
Definition: SiteShowCommand.php:33
‪TYPO3\CMS\Core\Command\SiteShowCommand\execute
‪execute(InputInterface $input, OutputInterface $output)
Definition: SiteShowCommand.php:53
‪TYPO3\CMS\Core\Site\SiteFinder
Definition: SiteFinder.php:31
‪TYPO3\CMS\Core\Command\SiteShowCommand
Definition: SiteShowCommand.php:32
‪$output
‪$output
Definition: annotationChecker.php:114
‪TYPO3\CMS\Core\Command\SiteShowCommand\configure
‪configure()
Definition: SiteShowCommand.php:41
‪TYPO3\CMS\Core\Command
Definition: CacheFlushCommand.php:18