Add stream context metadata options for compress.zlib:// protocol wrapper so that original mtime and name can be given
未关闭
还没有人认领这个 Issue。
Category: Streams
Extension: zlib
Feature
- 主要语言
- C
- 星标
- 40.4k
- 派生
- 8.1k
- 平均合并
- 2 天 13 小时
- 30 天内合并 PR
- 96
描述
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先检查 compress.zlib:// 协议包装器及其流上下文选项处理,然后对比 issue 中引用的现有 phar 上下文选项。确定应如何将 mtime 和原始文件名传递到 gzip 元数据中,并验证通过包装器写入时无需重新打开文件即可保留这两个值。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- c, php
- 领域
- api, backend
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100