/**
  * Check extension dependencies
  *
  * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
  * @throws \Exception
  */
 public function checkDependenciesAction(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension)
 {
     $message = '';
     $title = '';
     $hasDependencies = FALSE;
     $hasErrors = FALSE;
     try {
         $dependencyTypes = $this->managementService->getAndResolveDependencies($extension);
         if (count($dependencyTypes) > 0) {
             $hasDependencies = TRUE;
             $message = $this->translate('downloadExtension.dependencies.headline');
             foreach ($dependencyTypes as $dependencyType => $dependencies) {
                 $extensions = '';
                 foreach ($dependencies as $extensionKey => $dependency) {
                     $extensions .= $this->translate('downloadExtension.dependencies.extensionWithVersion', array($extensionKey, $dependency->getVersion())) . '<br />';
                 }
                 $message .= $this->translate('downloadExtension.dependencies.typeHeadline', array($this->translate('downloadExtension.dependencyType.' . $dependencyType), $extensions));
             }
             $title = $this->translate('downloadExtension.dependencies.resolveAutomatically');
         }
         $this->view->assign('dependencies', $dependencyTypes);
     } catch (\Exception $e) {
         $hasErrors = TRUE;
         $title = $this->translate('downloadExtension.dependencies.errorTitle');
         $message = $e->getMessage();
     }
     $this->view->assign('extension', $extension)->assign('hasDependencies', $hasDependencies)->assign('hasErrors', $hasErrors)->assign('message', $message)->assign('title', $title);
 }
 /**
  * Check extension dependencies
  *
  * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
  * @throws \Exception
  */
 public function checkDependenciesAction(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension)
 {
     $message = '';
     $title = '';
     $hasDependencies = false;
     $hasErrors = false;
     if ($this->configurationUtility->getCurrentConfiguration('extensionmanager')['automaticInstallation']['value']) {
         $action = 'installFromTer';
         try {
             $dependencyTypes = $this->managementService->getAndResolveDependencies($extension);
             if (!empty($dependencyTypes)) {
                 $hasDependencies = true;
                 $message = '<p>' . $this->translate('downloadExtension.dependencies.headline') . '</p>';
                 foreach ($dependencyTypes as $dependencyType => $dependencies) {
                     $extensions = '';
                     foreach ($dependencies as $extensionKey => $dependency) {
                         $extensions .= $this->translate('downloadExtension.dependencies.extensionWithVersion', array($extensionKey, $dependency->getVersion())) . '<br />';
                     }
                     $message .= $this->translate('downloadExtension.dependencies.typeHeadline', array($this->translate('downloadExtension.dependencyType.' . $dependencyType), $extensions));
                 }
                 $title = $this->translate('downloadExtension.dependencies.resolveAutomatically');
             }
             $this->view->assign('dependencies', $dependencyTypes);
         } catch (\Exception $e) {
             $hasErrors = true;
             $title = $this->translate('downloadExtension.dependencies.errorTitle');
             $message = $e->getMessage();
         }
     } else {
         // if automatic installation is deactivated, no dependency check is needed (download only)
         $action = 'installExtensionWithoutSystemDependencyCheck';
     }
     $this->view->assign('extension', $extension)->assign('action', $action)->assign('hasDependencies', $hasDependencies)->assign('hasErrors', $hasErrors)->assign('message', $message)->assign('title', $title);
 }
Beispiel #3
0
 /**
  * Check extension dependencies
  *
  * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
  * @throws \Exception
  */
 public function checkDependenciesAction(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension)
 {
     $message = '';
     $title = '';
     $hasDependencies = false;
     $hasErrors = false;
     $dependencyTypes = null;
     $configuration = ['value' => ['dependencies' => []]];
     if ($this->configurationUtility->getCurrentConfiguration('extensionmanager')['automaticInstallation']['value']) {
         $action = 'installFromTer';
         try {
             $dependencyTypes = $this->managementService->getAndResolveDependencies($extension);
             if (!empty($dependencyTypes)) {
                 $hasDependencies = true;
                 $message = '<p>' . $this->translate('downloadExtension.dependencies.headline') . '</p>';
                 foreach ($dependencyTypes as $dependencyType => $dependencies) {
                     $extensions = '';
                     foreach ($dependencies as $extensionKey => $dependency) {
                         if (!isset($configuration['value']['dependencies'][$dependencyType])) {
                             $configuration['value']['dependencies'][$dependencyType] = [];
                         }
                         $configuration['value']['dependencies'][$dependencyType][$extensionKey] = ['_exclude' => ['categoryIndexFromStringOrNumber']];
                         $extensions .= $this->translate('downloadExtension.dependencies.extensionWithVersion', [$extensionKey, $dependency->getVersion()]) . '<br />';
                     }
                     $message .= $this->translate('downloadExtension.dependencies.typeHeadline', [$this->translate('downloadExtension.dependencyType.' . $dependencyType), $extensions]);
                 }
                 $title = $this->translate('downloadExtension.dependencies.resolveAutomatically');
             }
         } catch (\Exception $e) {
             $hasErrors = true;
             $title = $this->translate('downloadExtension.dependencies.errorTitle');
             $message = $e->getMessage();
         }
     } else {
         // if automatic installation is deactivated, no dependency check is needed (download only)
         $action = 'installExtensionWithoutSystemDependencyCheck';
     }
     $url = $this->uriBuilder->uriFor($action, ['extension' => $extension->getUid(), 'format' => 'json'], 'Download');
     $this->view->setConfiguration($configuration);
     $this->view->assign('value', ['dependencies' => $dependencyTypes, 'url' => $url, 'message' => $message, 'hasErrors' => $hasErrors, 'hasDependencies' => $hasDependencies, 'title' => $title]);
 }
 /**
  * Check extension dependencies
  *
  * @throws Exception
  * @return void
  */
 public function checkDependenciesAction()
 {
     if (!$this->request->hasArgument('extension')) {
         throw new \Exception('Required argument extension not set.', 1334433342);
     }
     $extensionUid = $this->request->getArgument('extension');
     /** @var $extension \TYPO3\CMS\Extensionmanager\Domain\Model\Extension */
     $extension = $this->extensionRepository->findByUid(intval($extensionUid));
     $dependencyTypes = $this->managementService->getAndResolveDependencies($extension);
     $message = '';
     if (count($dependencyTypes) > 0) {
         // @todo translate and beautify
         $message = 'The following dependencies have to be resolved before installation:<br /><br />';
         foreach ($dependencyTypes as $dependencyType => $dependencies) {
             $message .= '<h3>Extensions marked for ' . $dependencyType . ':</h3>';
             foreach ($dependencies as $extensionKey => $dependency) {
                 $message .= $extensionKey . '<br />';
             }
             $message .= 'Shall these dependencies be resolved automatically?';
         }
     }
     $this->view->assign('dependencies', $dependencyTypes)->assign('extension', $extension)->assign('message', $message);
 }