Mailinglisten-Archive |
hi
hab mal ne frage zur gzLib:
folgendes Script hab ich gefunden , nur verstehe ich nicht die SubstrZeile,
die gzipHeader und Payloadfooter Zeile !!!! Kann mir einr erklären was das
machen soll ?????? Nehm ich die weg funzt nix mehr ...
ob_start();
// hier mein ganzer Output !!!!!
$buffer=ob_get_contents();
ob_end_clean();
Header("Content-Encoding: gzip");
Header("X-Compressed-by: PHPgzip");
$time=time();
$gzipheader =sprintf("%c%c%c%c%c%c%c%c%c%c",
31, /*id[1]*/
139, /*id[2]*/
8, /*method*/
0, /*flags*/
($time & (0xff)), /*time*/
($time & (0xff<<8))>>8,
($time & (0xff<<16))>>16,
($time & (0xff<<24))>>24,
0, /*xflags*/
3 /*os*/
);
$payload =gzcompress($buffer);
$payload =substr($payload,2,strlen($payload)-6);
$crc=crc32($buffer);
$len=strlen($buffer);
$payloadfooter =sprintf("%c%c%c%c%c%c%c%c",
($crc & (0xff)) , /*crc32*/
($crc & (0xff<<8))>>8,
($crc & (0xff<<16))>>16,
($crc & (0xff<<24))>>24,
($len & (0xff)) , /*len*/
($len & (0xff<<8))>>8,
($len & (0xff<<16))>>16,
($len & (0xff<<24))>>24);
echo $gzipheader;
echo $payload;
Danke
Tobias
www.traffic-eye.de
php::bar PHP Wiki - Listenarchive