TYPO3 CMS  TYPO3_8-7
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 
23 
27 class ExtbaseCommand extends Command
28 {
33  protected $command;
34 
38  protected function configure()
39  {
40  $this->ignoreValidationErrors();
41  }
42 
48  public function setExtbaseCommand(\TYPO3\CMS\Extbase\Mvc\Cli\Command $command)
49  {
50  $this->command = $command;
51  }
52 
60  public function setApplication(Application $application = null)
61  {
62  parent::setApplication($application);
63  $description = $this->command->getDescription();
64  $description = str_replace(LF, ' ', $description);
65  $this->setDescription($description);
66  }
67 
74  protected function execute(InputInterface $input, OutputInterface $output)
75  {
76  // ugly hack because extbase only knows "help" (hardcoded, but already defined by symfony)
77  // and "extbase:help:help"
78  if ($_SERVER['argv'][1] === 'extbase:help') {
79  $_SERVER['argv'][1] = 'extbase:help:help';
80  }
81  $bootstrap = GeneralUtility::makeInstance(Bootstrap::class);
82  $bootstrap->run('', []);
83  }
84 }
execute(InputInterface $input, OutputInterface $output)
setExtbaseCommand(\TYPO3\CMS\Extbase\Mvc\Cli\Command $command)
static makeInstance($className,... $constructorArguments)
setApplication(Application $application=null)