예제 #1
0
 /**
  * @test
  */
 public function downloadT3x()
 {
     $content = tx_additionalreports_util::downloadT3x('additional_reports', '2.6.4', 'ext_tables.php');
     $this->assertTrue(!empty($content));
 }
$extVersion = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('extVersion');
$file1 = realpath(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extKey, $extFile));
$realPathExt = realpath(PATH_site . 'typo3conf/ext/' . $extKey);
if ($mode === null) {
    $mode = 'compareFile';
}
switch ($mode) {
    case 'compareFile':
        if (strstr($file1, $realPathExt) === false) {
            die('Access denied.');
        }
        $terFileContent = tx_additionalreports_util::downloadT3x($extKey, $extVersion, $extFile);
        t3Diff(\TYPO3\CMS\Core\Utility\GeneralUtility::getURL($file1), $terFileContent);
        break;
    case 'compareExtension':
        $t3xfiles = tx_additionalreports_util::downloadT3x($extKey, $extVersion);
        $diff = 0;
        foreach ($t3xfiles['FILES'] as $filePath => $file) {
            $currentFileContent = \TYPO3\CMS\Core\Utility\GeneralUtility::getURL($realPathExt . '/' . $filePath);
            if ($file['content_md5'] !== md5($currentFileContent)) {
                $diff++;
                echo '<h1>' . $filePath . '</h1>';
                t3Diff($currentFileContent, $file['content']);
            }
        }
        if (empty($diff)) {
            echo 'No diff to show';
        }
        break;
}
function t3Diff($file1, $file2)