/** * Check integrity of repository entry in sys_ter * * @return void */ protected function checkRepository() { /** @var $repository tx_em_Repository */ $repository = t3lib_div::makeInstance('tx_em_Repository'); if ($repository->getLastUpdate() == 0) { $extCount = tx_em_Database::getExtensionCountFromRepository($repository); if ($extCount > 0) { $repository->setExtensionCount($extCount); $repository->setLastUpdate(time()); tx_em_Database::updateRepository($repository); } } }
/** * Update repository * * @param array $parameter * @return array */ public function repositoryUpdate($repositoryId) { if (!intval($repositoryId)) { return array('success' => FALSE, 'errors' => 'no repository choosen', 'rep' => 0); } /** @var $objRepository tx_em_Repository */ $objRepository = t3lib_div::makeInstance('tx_em_Repository', intval($repositoryId)); /** @var $objRepositoryUtility tx_em_Repository_Utility */ $objRepositoryUtility = t3lib_div::makeInstance('tx_em_Repository_Utility', $objRepository); $count = $objRepositoryUtility->updateExtList(); $time = $GLOBALS['EXEC_TIME']; if ($count) { $objRepository->setExtensionCount($count); $objRepository->setLastUpdate($time); tx_em_Database::updateRepository($objRepository); return array('success' => TRUE, 'data' => array('count' => $count, 'updated' => date('d/m/Y H:i', $time)), 'rep' => intval($repositoryId)); } else { return array('success' => FALSE, 'errormsg' => $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:repository_upToDate'), 'rep' => intval($repositoryId)); } }