[php-src] Issue #10222: Add stream context metadata options for compress.zlib:// protocol wrapper so that original mtime and name can be given

From: Date: Wed, 04 Jan 2023 20:36:40 +0000
Subject: [php-src] Issue #10222: Add stream context metadata options for compress.zlib:// protocol wrapper so that original mtime and name can be given
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-243334@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/10222
Author: cmanley

### Description

Currently, when writing to a gz file using the compress.zlib:// protocol wrapper it is not possible
to pass the mtime or name of the original file. It would be nice if we could do so without having to
reopen the gzip file in write mode for write the metadata directly into it as in this bug report https://bugs.php.net/bug.php?id=46577
I believe that this can be done by adding new stream context options for zlib (similar to those for
phar). See https://www.php.net/manual/en/context.php

The gzip file format supports the following meta data:
- compression method
- itype (text or binary)
- **mtime (nice to have)**
- size (thankfully set by compress.zlib:// )
- os
- **original file name (nice to have)**
- comment


Thread (1 message)

  • cmanley
« previous php.bugs (#243334) next »