/** * @test */ public function getExtAffectedFilesLastVersion() { $extInfo['extkey'] = 'additional_reports'; $extInfo['type'] = 'L'; $emconf = tx_additionalreports_util::includeEMCONF(PATH_typo3conf . 'ext/additional_reports/ext_emconf.php', 'additional_reports'); $new = unserialize($emconf['_md5_values_when_last_written']); unset($new['ChangeLog']); $emconf['_md5_values_when_last_written'] = serialize($new); $extInfo['EM_CONF'] = $emconf; $extInfo['lastversion'] = tx_additionalreports_util::checkExtensionUpdate($extInfo); $this->testArray(tx_additionalreports_util::getExtAffectedFilesLastVersion($extInfo)); }
/** * Gathers all extensions in $path * * @param string $path Absolute path to local, global or system extensions * @param array $dbSchema array with all the tables * @return array "Returns" content by reference */ public static function getInstExtList($path, $dbSchema) { $list = array(); if (@is_dir($path)) { $extList = \TYPO3\CMS\Core\Utility\GeneralUtility::get_dirs($path); if (is_array($extList)) { foreach ($extList as $extKey) { if (@is_file($path . $extKey . '/ext_emconf.php')) { $emConf = self::includeEMCONF($path . $extKey . '/ext_emconf.php', $extKey); if (is_array($emConf)) { $currentExt = array(); $currentExt['extkey'] = $extKey; $currentExt['installed'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extKey); $currentExt['EM_CONF'] = $emConf; $currentExt['files'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getFilesInDir($path . $extKey, '', 0, '', null); $currentExt['lastversion'] = tx_additionalreports_util::checkExtensionUpdate($currentExt); $currentExt['affectedfiles'] = tx_additionalreports_util::getExtAffectedFiles($currentExt); $currentExt['icon'] = tx_additionalreports_util::getExtIcon($extKey); // db infos $fdFile = array(); $updateStatements = array(); tx_additionalreports_util::getExtSqlUpdateStatements($currentExt, $dbSchema, $fdFile, $updateStatements); $currentExt['fdfile'] = $fdFile; $currentExt['updatestatements'] = $updateStatements; if ($currentExt['installed']) { if ($currentExt['lastversion']) { $list['ter'][$extKey] = $currentExt; } else { $list['dev'][$extKey] = $currentExt; } } else { $list['unloaded'][$extKey] = $currentExt; } } } } } } return $list; }