mapsight/pulp-zip 问题修复 & 功能扩展

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

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

mapsight/pulp-zip

Composer 安装命令:

composer require mapsight/pulp-zip

包简介

ZIP helpers for Pulp packages.

README 文档

README

ZIP helpers for Pulp packages and scripts.

Features

  • Unzip in pipelines: Expand ZIP payloads from a Pulp File into regular Pulp files.
  • Zip in pipelines: Collect regular Pulp files into one ZIP archive.
  • Temporary file handling: Uses temporary files internally because PHP ZipArchive works with paths.

Installation

composer require mapsight/pulp-zip

Requires PHP ext-zip.

Usage

Use PulpZip::unzip() after any source handler that emits ZIP bytes:

use OpenMapsight\Pulp;
use OpenMapsight\PulpZip;

Pulp::start()
    ->pipe(Pulp::srcHttp('GET', $url, [], 'data.zip'))
    ->pipe(PulpZip::unzip('.*\.csv'))
    ->pipe(Pulp::dest(__DIR__ . '/result'))
    ->run();

unzip($patterns) emits each matching archive entry as a normal Pulp File. Patterns use Pulp's regular-expression file matching, the same as Pulp::fileSwitch().

Use PulpZip::zip() to collect incoming files into one archive:

Pulp::start()
    ->pipe(Pulp::src('.*\.json', __DIR__ . '/data'))
    ->pipe(PulpZip::zip('export.zip'))
    ->pipe(Pulp::dest(__DIR__ . '/result'))
    ->run();

Error Handling

The handlers throw RuntimeException when:

  • A temporary ZIP file cannot be created.
  • The ZIP archive cannot be opened.
  • A ZIP entry path is unsafe, for example an absolute path or a path containing ...
  • A cache or temp file cannot be read or written by the caller.

Notes

  • This package intentionally keeps the API small. It is not a full archive extraction library.
  • For large ZIP files, prefer combining this package with mapsight/pulp-cache so downloads are cached before parsing.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2026-06-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固