Example #1
0
 /**
  * Handles checks to find a compatible extension version from TER to fulfill given dependency
  *
  * @todo unit tests
  * @param string $extensionKey
  * @param Dependency $dependency
  * @throws Exception\UnresolvedDependencyException
  * @return void
  */
 protected function getExtensionFromTer($extensionKey, Dependency $dependency)
 {
     $isExtensionDownloadableFromTer = $this->isExtensionDownloadableFromTer($extensionKey);
     if (!$isExtensionDownloadableFromTer) {
         if (!$this->skipDependencyCheck) {
             if ($this->extensionRepository->countAll() > 0) {
                 throw new Exception\MissingExtensionDependencyException('The extension ' . $extensionKey . ' is not available from TER.', 1399161266);
             } else {
                 throw new Exception\MissingExtensionDependencyException('The extension ' . $extensionKey . ' could not be checked. Please update your Extension-List from TYPO3 Extension Repository (TER).', 1430580308);
             }
         }
         return;
     }
     $isDownloadableVersionCompatible = $this->isDownloadableVersionCompatible($dependency);
     if (!$isDownloadableVersionCompatible) {
         if (!$this->skipDependencyCheck) {
             throw new Exception\MissingVersionDependencyException('No compatible version found for extension ' . $extensionKey, 1399161284);
         }
         return;
     }
     $latestCompatibleExtensionByIntegerVersionDependency = $this->getLatestCompatibleExtensionByIntegerVersionDependency($dependency);
     if (!$latestCompatibleExtensionByIntegerVersionDependency instanceof Extension) {
         if (!$this->skipDependencyCheck) {
             throw new Exception\MissingExtensionDependencyException('Could not resolve dependency for "' . $dependency->getIdentifier() . '"', 1399161302);
         }
         return;
     }
     if ($this->isDependentExtensionLoaded($extensionKey)) {
         $this->managementService->markExtensionForUpdate($latestCompatibleExtensionByIntegerVersionDependency);
     } else {
         $this->managementService->markExtensionForDownload($latestCompatibleExtensionByIntegerVersionDependency);
     }
 }
 /**
  * Handles checks to find a compatible extension version from TER
  * to fulfill given dependency
  *
  * @todo unit tests
  * @param string $extensionKey
  * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency
  * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
  * @return void
  */
 protected function getExtensionFromTer($extensionKey, \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency)
 {
     $isExtensionDownloadableFromTer = $this->isExtensionDownloadableFromTer($extensionKey);
     if ($isExtensionDownloadableFromTer === TRUE) {
         $isDownloadableVersionCompatible = $this->isDownloadableVersionCompatible($dependency);
         if ($isDownloadableVersionCompatible === TRUE) {
             $latestCompatibleExtensionByIntegerVersionDependency = $this->getLatestCompatibleExtensionByIntegerVersionDependency($dependency);
             if ($latestCompatibleExtensionByIntegerVersionDependency instanceof \TYPO3\CMS\Extensionmanager\Domain\Model\Extension) {
                 if ($this->isDependentExtensionLoaded($extensionKey)) {
                     $this->managementService->markExtensionForUpdate($latestCompatibleExtensionByIntegerVersionDependency);
                 } else {
                     $this->managementService->markExtensionForDownload($latestCompatibleExtensionByIntegerVersionDependency);
                 }
             } else {
                 throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Could not resolve dependency for "' . $dependency->getIdentifier() . '"');
             }
         } else {
             throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('No compatible version found for extension ' . $extensionKey);
         }
     } else {
         throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('The extension ' . $extensionKey . ' is not available from TER.');
     }
 }