‪TYPO3CMS  9.5
ExtbaseCommand.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
17 use Symfony\Component\Console\Application;
18 use Symfony\Component\Console\Command\Command;
19 use Symfony\Component\Console\Input\InputInterface;
20 use Symfony\Component\Console\Output\OutputInterface;
23 
28 class ‪ExtbaseCommand extends Command
29 {
34  protected ‪$command;
35 
39  protected function ‪configure()
40  {
41  $this->ignoreValidationErrors();
42  }
43 
49  public function ‪setExtbaseCommand(\‪TYPO3\CMS\‪Extbase\Mvc\Cli\Command ‪$command)
50  {
51  $this->command = ‪$command;
52  }
53 
61  public function ‪setApplication(Application $application = null)
62  {
63  parent::setApplication($application);
64  $description = $this->command->getDescription();
65  $description = str_replace(LF, ' ', $description);
66  $this->setDescription($description);
67  }
68 
75  protected function ‪execute(InputInterface $input, OutputInterface ‪$output)
76  {
77  // ugly hack because extbase only knows "help" (hardcoded, but already defined by symfony)
78  // and "extbase:help:help"
79  if ($_SERVER['argv'][1] === 'extbase:help') {
80  $_SERVER['argv'][1] = 'extbase:help:help';
81  }
82  $bootstrap = GeneralUtility::makeInstance(Bootstrap::class);
83  $bootstrap->run('', []);
84  }
85 }
‪TYPO3\CMS\Extbase\Command
Definition: CoreCommand.php:2
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:4
‪TYPO3
‪TYPO3\CMS\Extbase\Command\ExtbaseCommand\setExtbaseCommand
‪setExtbaseCommand(\TYPO3\CMS\Extbase\Mvc\Cli\Command $command)
Definition: ExtbaseCommand.php:48
‪TYPO3\CMS\Extbase\Command\ExtbaseCommand\$command
‪TYPO3 CMS Extbase Mvc Cli Command $command
Definition: ExtbaseCommand.php:33
‪TYPO3\CMS\Extbase\Command\ExtbaseCommand\execute
‪execute(InputInterface $input, OutputInterface $output)
Definition: ExtbaseCommand.php:74
‪$output
‪$output
Definition: annotationChecker.php:113
‪TYPO3\CMS\Extbase\Command\ExtbaseCommand\configure
‪configure()
Definition: ExtbaseCommand.php:38
‪TYPO3\CMS\Extbase\Core\Bootstrap
Definition: Bootstrap.php:31
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Extbase\Command\ExtbaseCommand\setApplication
‪setApplication(Application $application=null)
Definition: ExtbaseCommand.php:60
‪TYPO3\CMS\Extbase\Command\ExtbaseCommand
Definition: ExtbaseCommand.php:29