/** * Toggle extension installation state action * * @param string $extension */ protected function toggleExtensionInstallationStateAction($extension) { $installedExtensions = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray(); if (in_array($extension, $installedExtensions)) { // uninstall $this->installUtility->uninstall($extension); } else { // install $this->managementService->resolveDependenciesAndInstall($this->installUtility->enrichExtensionWithDetails($extension)); } $this->redirect('index', 'List', NULL, array(self::TRIGGER_RefreshModuleMenu => TRUE)); }
/** * Update an extension. Makes no sanity check but directly searches highest * available version from TER and updates. Update check is done by the list * already. This method should only be called if we are sure that there is * an update. * * @return void */ protected function updateExtensionAction() { $extensionKey = $this->request->getArgument('extension'); /** @var $highestTerVersionExtension \TYPO3\CMS\Extensionmanager\Domain\Model\Extension */ $highestTerVersionExtension = $this->extensionRepository->findHighestAvailableVersion($extensionKey); $this->prepareExtensionForImport($highestTerVersionExtension); $result = $this->managementService->resolveDependenciesAndInstall($highestTerVersionExtension); $this->view->assign('result', $result)->assign('extension', $highestTerVersionExtension); }