/** * Checks if an update for an extension is available * * @internal * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extensionData * @return boolean */ public function isUpdateAvailable(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extensionData) { // Only check for update for TER extensions $version = $extensionData->getIntegerVersion(); /** @var $highestTerVersionExtension \TYPO3\CMS\Extensionmanager\Domain\Model\Extension */ $highestTerVersionExtension = $this->extensionRepository->findHighestAvailableVersion($extensionData->getExtensionKey()); if ($highestTerVersionExtension instanceof \TYPO3\CMS\Extensionmanager\Domain\Model\Extension) { $highestVersion = $highestTerVersionExtension->getIntegerVersion(); if ($highestVersion > $version) { return TRUE; } } return FALSE; }
/** * Returns the updateable version for an extension which also resolves dependencies. * * @internal * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extensionData * @return bool|\TYPO3\CMS\Extensionmanager\Domain\Model\Extension FALSE if no update available otherwise latest * possible update */ public function getUpdateableVersion(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extensionData) { // Only check for update for TER extensions $version = $extensionData->getIntegerVersion(); /** @var $extensionUpdates[] \TYPO3\CMS\Extensionmanager\Domain\Model\Extension */ $extensionUpdates = $this->extensionRepository->findByVersionRangeAndExtensionKeyOrderedByVersion($extensionData->getExtensionKey(), $version, 0, FALSE); if ($extensionUpdates->count() > 0) { foreach ($extensionUpdates as $extensionUpdate) { try { $this->dependencyUtility->checkDependencies($extensionUpdate); if (!$this->dependencyUtility->hasDependencyErrors()) { return $extensionUpdate; } } catch (ExtensionManagerException $e) { } } } return FALSE; }
/** * Checks if an update for an extension is available * * @internal * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extensionData * @return boolean */ public function isUpdateAvailable(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extensionData) { $isUpdateAvailable = FALSE; // Only check for update for TER extensions $version = $extensionData->getIntegerVersion(); /** @var $highestTerVersionExtension \TYPO3\CMS\Extensionmanager\Domain\Model\Extension */ $highestTerVersionExtension = $this->extensionRepository->findHighestAvailableVersion($extensionData->getExtensionKey()); if ($highestTerVersionExtension instanceof \TYPO3\CMS\Extensionmanager\Domain\Model\Extension) { $highestVersion = $highestTerVersionExtension->getIntegerVersion(); if ($highestVersion > $version) { $this->dependencyUtility->checkDependencies($highestTerVersionExtension); if (!$this->dependencyUtility->hasDependencyErrors()) { $isUpdateAvailable = TRUE; } } } return $isUpdateAvailable; }