setDescription('Activates an extension by key') ->setHelp('The extension files must be present in one of the recognized extension folder paths in TYPO3.') ->setAliases(['extensionmanager:extension:install', 'extension:install']) ->addArgument( 'extensionkey', InputArgument::REQUIRED, 'The extension key of a currently deactivated extension, located in one of TYPO3\'s extension paths.' ); } /** * Installs an extension * * @inheritdoc */ protected function execute(InputInterface $input, OutputInterface $output) { $io = new SymfonyStyle($input, $output); $extensionKey = $input->getArgument('extensionkey'); // Ensure the _cli_ user is authenticated because the extension might import data Bootstrap::initializeBackendAuthentication(); $objectManager = GeneralUtility::makeInstance(ObjectManager::class); // Emits packages may have changed signal $signalSlotDispatcher = $objectManager->get(Dispatcher::class); $signalSlotDispatcher->dispatch('PackageManagement', 'packagesMayHaveChanged'); // Do the installation process $objectManager->get(InstallUtility::class)->install($extensionKey); $io->success('Activated extension ' . $extensionKey . ' successfully.'); } }