/** * Update extension list from TER * * @param boolean $forceUpdateCheck * @return void */ public function updateExtensionListFromTerAction($forceUpdateCheck = FALSE) { $updated = FALSE; $errorMessage = ''; if ($this->extensionRepository->countAll() === 0 || $forceUpdateCheck) { try { $updated = $this->repositoryHelper->updateExtList(); } catch (\TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException $e) { $errorMessage = $e->getMessage(); } } /** @var $repository \TYPO3\CMS\Extensionmanager\Domain\Model\Repository */ $repository = $this->repositoryRepository->findByUid((int) $this->settings['repositoryUid']); $this->view->assign('updated', $updated)->assign('repository', $repository)->assign('errorMessage', $errorMessage); }
/** * Update extension list from TER * * @param bool $forceUpdateCheck * @return void */ public function updateExtensionListFromTerAction($forceUpdateCheck = false) { $updated = false; $errorMessage = ''; if ($this->extensionRepository->countAll() === 0 || $forceUpdateCheck) { try { $updated = $this->repositoryHelper->updateExtList(); } catch (\TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException $e) { $errorMessage = $e->getMessage(); } } /** @var $repository \TYPO3\CMS\Extensionmanager\Domain\Model\Repository */ $repository = $this->repositoryRepository->findByUid((int) $this->settings['repositoryUid']); $timeFormat = $this->getLanguageService()->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:extensionList.updateFromTer.lastUpdate.fullTimeFormat'); $lastUpdateTime = $repository->getLastUpdate(); if (null === $lastUpdateTime) { $lastUpdatedSince = $this->getLanguageService()->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:extensionList.updateFromTer.never'); $lastUpdateTime = date($timeFormat); } else { $lastUpdatedSince = \TYPO3\CMS\Backend\Utility\BackendUtility::calcAge(time() - $lastUpdateTime->format('U'), $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.minutesHoursDaysYears')); $lastUpdateTime = $lastUpdateTime->format($timeFormat); } $this->view->assign('value', ['updated' => $updated, 'lastUpdateTime' => $lastUpdateTime, 'timeSinceLastUpdate' => $lastUpdatedSince, 'errorMessage' => $errorMessage]); }