[TYPO3-dev] Decompress t3x?

Steffen Kamper steffen at dislabs.de
Thu Apr 12 14:13:07 CEST 2007


"Bart" <bart at neeneenee.de> schrieb im Newsbeitrag 
news:mailman.138688.1176379369.21067.typo3-dev at lists.netfielders.de...
>
> Hi,
> does anbody know how to decompress a t3x extension file? I tried Zip and 
> GZip but it doesn't work.
>
> Thanx.
> Bart.
>
> http://typo3.area42.de/

Hi,

this can be found in em-code. Here is the function:

function decodeExchangeData($str) {
  $parts = explode(':',$str,3);
  if ($parts[1]=='gzcompress') {
   if (function_exists('gzuncompress')) {
    $parts[2] = gzuncompress($parts[2]);
   } else return 'Decoding Error: No decompressor available for compressed 
content. gzcompress()/gzuncompress() functions are not available!';
  }
  if (md5($parts[2]) == $parts[0]) {
   $output = unserialize($parts[2]);
   if (is_array($output)) {
    return array($output,'');
   } else return 'Error: Content could not be unserialized to an array. 
Strange (since MD5 hashes match!)';
  } else return '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)';
 }

vg  Steffen 






More information about the TYPO3-dev mailing list