dablach/zip-stream-reader 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dablach/zip-stream-reader

Composer 安装命令:

composer require dablach/zip-stream-reader

包简介

Stream reader for extracting zip archives on the fly.

关键字:

README 文档

README

Read ZIP files from stream in a memory efficient way without first downloading the whole file.

Note

ZIP files can contain entries with no size set in the local file header. These entries can only be read after parsing the central directory which is at the end of the file, making it impossible to read such a file in a streaming fashion. When ZipStreamReader encounters such an entry in an unseekable stream, it wil load the remaining contents into php://temp and read the rest from there.

Usage

$reader = ZipStreamReader::open("https://...");

foreach ($reader as $entry) {
  echo "Name: " . $entry->getName() . "\n";
  echo "Modified: " . $entry->getMtime()->format('r') . "\n";

  $handle = $entry->getStream();
  // $handle is a resource you can use to read the file content (e.g. fread, fgetcsv ..)
}

统计信息

  • 总下载量: 23
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2024-12-13