From:             mmj048 at gmail dot com
Operating system: Windows Vista
PHP version:      5.2.6
PHP Bug Type:     Feature/Change Request
Bug description:  gzip functions don't read/write mtime header

Description:
------------
The gzencode and gzwrite functions, which implement RFC 1952
(http://www.gzip.org/zlib/rfc-gzip.html), don't read/write the mtime
header.
While this is not necessary for gzip compliance
(http://www.gzip.org/zlib/rfc-gzip.html#id-compliance) adding a function to
read/write the mtime header when compressing or reading compressed files
would be very useful in many cases.

I currently use custom code to read/write the gzip mtime header.

Read:

$gzmtime = end(unpack('V', file_get_contents($gzfile, null, null, 4,
4)));

Write:

$r = fopen($gzfile, 'r+');
fseek($r, 4);
fwrite($r, pack('V', $filemtime), 4);
fclose($r);


-- 
Edit bug report at http://bugs.php.net/?id=46577&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=46577&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=46577&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=46577&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=46577&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=46577&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=46577&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=46577&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=46577&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=46577&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=46577&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=46577&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=46577&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=46577&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=46577&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=46577&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=46577&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=46577&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=46577&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=46577&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=46577&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=46577&r=mysqlcfg

Reply via email to