45 public function fetchExtension($extensionKey, $version, $expectedMd5, $mirrorUrl)
48 (
bool)GeneralUtility::makeInstance(ExtensionConfiguration::class)->
get(
'extensionmanager',
'offlineMode')
53 $extensionPath = strtolower($extensionKey);
54 $mirrorUrl .= $extensionPath[0] .
'/' . $extensionPath[1] .
'/' . $extensionPath .
'_' . $version .
'.t3x';
55 $t3x = \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($mirrorUrl);
58 throw new ExtensionManagerException(sprintf(
'The T3X file "%s" could not be fetched. Possible reasons: network problems, allow_url_fopen is off, cURL is not enabled in Install Tool.', $mirrorUrl), 1334426097);
60 if ($md5 === $expectedMd5) {
64 throw new ExtensionManagerException(
'Error: MD5 hash of downloaded file not as expected: ' . $md5 .
' != ' . $expectedMd5, 1334426098);
66 return $extensionData;
83 $parts = explode(
':', $externalData, 4);
84 $dat = base64_decode($parts[2]);
87 if (ltrim($parts[0]) == md5($dat)) {
88 if ($parts[1] ===
'gzcompress') {
89 if (function_exists(
'gzuncompress')) {
90 $dat = gzuncompress($dat);
92 throw new ExtensionManagerException(
'Decoding Error: No decompressor available for compressed content. gzuncompress() function is not available!', 1342859463);
95 $listArr = unserialize($dat, [
'allowed_classes' =>
false]);
96 if (!is_array($listArr)) {
115 $parts = explode(
':', $stream, 3);
116 if ($parts[1] ===
'gzcompress') {
117 if (function_exists(
'gzuncompress')) {
118 $parts[2] = gzuncompress($parts[2]);
120 throw new ExtensionManagerException(
'Decoding Error: No decompressor available for compressed content. gzcompress()/gzuncompress() ' .
'functions are not available!', 1344761814);
123 if (hash_equals($parts[0], md5($parts[2]))) {
124 $output = unserialize($parts[2], [
'allowed_classes' =>
false]);
126 throw new ExtensionManagerException(
'Error: Content could not be unserialized to an array. Strange (since MD5 hashes match!)', 1344761938);
129 throw new ExtensionManagerException(
'Error: MD5 mismatch. Maybe the extension file was downloaded and saved as a text file by the ' .
'browser and thereby corrupted!? (Always select "All" filetype when saving extensions)', 1344761991);