setAliases([]); } /** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { if (null === $this->command) { $this->command = $this->getApplication()->find($input->getArgument('command_name')); } // Extbase help was explicitly called if ($input->getArgument('command') === 'extbase:help' || $input->getArgument('command') === 'extbase:help:help') { $_SERVER['argv'][1] = 'extbase:help:help'; $bootstrap = GeneralUtility::makeInstance(Bootstrap::class); $bootstrap->run('', []); } elseif ($this->command instanceof ExtbaseCommand) { // An extbase command was originally called, but is now required to show the help information // Ugly hack to modify 'argv' so the help command for a specific command is shown $args = [$_SERVER['argv'][0], 'help']; foreach ($_SERVER['argv'] as $k => $value) { if ($k === 0 || $value === '--help' || $value === '-h') { continue; } $args[] = $value; } $_SERVER['argv'] = $args; // run Extbase bootstrap $bootstrap = GeneralUtility::makeInstance(Bootstrap::class); $bootstrap->run('', []); } else { // Any other symfony command should just show up the regular info parent::execute($input, $output); } } }