/**
  * @param string $extensionKey
  * @return void
  */
 public function markExtensionForInstallation($extensionKey)
 {
     // We have to check for dependencies of the extension first, before marking it for installation
     // because this extension might have dependencies, which need to be installed first
     $this->dependencyUtility->checkDependencies($this->extensionModelUtility->mapExtensionArrayToModel($this->installUtility->enrichExtensionWithDetails($extensionKey)));
     $this->downloadQueue->addExtensionToInstallQueue($extensionKey);
 }
Ejemplo n.º 2
0
 /**
  * Toggle extension installation state action
  *
  * @param string $extensionKey
  */
 protected function toggleExtensionInstallationStateAction($extensionKey)
 {
     $installedExtensions = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray();
     try {
         if (in_array($extensionKey, $installedExtensions)) {
             // uninstall
             $this->installUtility->uninstall($extensionKey);
         } else {
             // install
             $extension = $this->extensionModelUtility->mapExtensionArrayToModel($this->installUtility->enrichExtensionWithDetails($extensionKey));
             if ($this->managementService->installExtension($extension) === FALSE) {
                 $this->redirect('unresolvedDependencies', 'List', NULL, array('extensionKey' => $extensionKey));
             }
         }
     } catch (\TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException $e) {
         $this->addFlashMessage(htmlspecialchars($e->getMessage()), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
     } catch (\TYPO3\Flow\Package\Exception\PackageStatesFileNotWritableException $e) {
         $this->addFlashMessage(htmlspecialchars($e->getMessage()), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
     }
     $this->redirect('index', 'List', NULL, array(self::TRIGGER_RefreshModuleMenu => TRUE));
 }
 /**
  * @param string $extensionKey
  * @return Extension
  * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
  */
 public function getExtension($extensionKey)
 {
     return $this->extensionModelUtility->mapExtensionArrayToModel($this->installUtility->enrichExtensionWithDetails($extensionKey));
 }