alchemy/zippy
Composer 安装命令:
composer require alchemy/zippy
包简介
Zippy, the archive manager companion
关键字:
README 文档
README
A PHP library to read, create, and extract archives in various formats via command line utilities or PHP extensions
Installation
The only supported installation method is via Composer. Run the following command to require Zippy in your project:
composer require alchemy/zippy
Requirements
- PHP >= 8.1
- Symfony components (
filesystem,process,http-client)^6.0 || ^7.0
Adapters
Zippy currently supports the following drivers and file formats:
- zip
- .zip
- PHP zip extension
- .zip
- GNU tar
- .tar
- .tar.gz
- .tar.bz2
- BSD tar
- .tar
- .tar.gz
- .tar.bz2
Getting started
All the following code samples assume that Zippy is loaded and available as $zippy. You need the following code (or variation of) to load Zippy:
<?php
use Alchemy\Zippy\Zippy;
// Require Composer's autoloader
require __DIR__ . '/vendor/autoload.php';
// Load Zippy
$zippy = Zippy::load();
List an archive's contents:
// Open an archive $archive = $zippy->open('build.tar'); // Iterate through members foreach ($archive as $member) { echo "Archive contains $member" . PHP_EOL; }
Extract an archive to a specific directory:
// Open an archive $archive = $zippy->open('build.tar'); // Extract archive contents to `/tmp` $archive->extract('/tmp');
Create a new archive
// Creates an archive.zip that contains a directory "folder" that contains // files contained in "/path/to/directory" recursively $archive = $zippy->create('archive.zip', array( 'folder' => '/path/to/directory' ), true);
Customize file and directory names inside archive
$archive = $zippy->create('archive.zip', array( 'folder' => '/path/to/directory', // will create a folder at root 'http://www.google.com/logo.jpg', // will create a logo.jpg file at root fopen('https://www.facebook.com/index.php'), // will create an index.php at root 'directory/image.jpg' => 'image.jpg', // will create a image.jpg in 'directory' folder ));
Remote http/https resources are downloaded transparently using the
Symfony HttpClient component.
License
This project is licensed under the MIT license.
alchemy/zippy 适用场景与选型建议
alchemy/zippy 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 23.5M 次下载、GitHub Stars 达 476, 最近一次更新时间为 2013 年 01 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「compression」 「zip」 「tar」 「bzip」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 alchemy/zippy 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 alchemy/zippy 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 alchemy/zippy 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A library for dynamically streaming dynamic tar files without the need to have the complete file stored on the server.
A library for dynamically streaming dynamic tar files without the need to have the complete file stored on the server.
Asset Management for PHP
Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools.
Allow packages to be installed from a repository or tarball bundle that have multiple packages in the sub-folders
Streaming parser to extract tarballs with ReactPHP.
统计信息
- 总下载量: 23.5M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 508
- 点击次数: 43
- 依赖项目数: 61
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2013-01-23
