17 use Symfony\Component\Console\Application;
18 use Symfony\Component\Console\Command\Command;
20 use TYPO3\CMS\Core\Package\PackageManager;
44 $this->setHidden(
true);
57 parent::setApplication($application);
65 $this->extbaseBootstrap = GeneralUtility::makeInstance(Bootstrap::class);
66 $this->extbaseBootstrap->initialize([]);
68 $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
71 $commandManager = $objectManager->get(CommandManager::class);
72 $commands = $commandManager->getAvailableCommands();
73 foreach ($commands as $command) {
74 $commandName = $commandManager->getShortestIdentifierForCommand($command);
75 $fullCommandName = $command->getCommandIdentifier();
76 if ($fullCommandName ===
'extbase:help:error' || $fullCommandName ===
'extbase:help:helpstub') {
79 if ($commandName ===
'help') {
80 $commandName =
'extbase:help';
82 $extbaseCommand = GeneralUtility::makeInstance(ExtbaseCommand::class, $fullCommandName);
84 if ($commandName !== $fullCommandName) {
85 $extbaseCommand->setAliases([$commandName]);
88 $extbaseCommand->setExtbaseCommand($command);
89 $this->getApplication()->add($extbaseCommand);