takuya/unar-wrapper
UnArchiver命令行工具的PHP包装器。
0.1
2021-03-02 10:02 UTC
Requires
- ext-json: *
- takuya/process: ^1.3
Requires (Dev)
- ext-json: *
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-09-29 06:02:56 UTC
README
解压缩命令行工具包装器
不压缩,仅用于提取。但可以使用许多格式。
为什么编写这个包。
处理多种归档格式(zip/tar/rar)。
支持格式。
依赖于unar(解压命令行工具)。
zip / rar(winrar) / tar.gz运行正常。
安装
composer require takuya/php-unar-wrapper
如何使用
<?php require_once 'vendor/autoload.php'; use SystemUtil\Archiver\UnArchiver; $sample_zip = 'sample.zip'; $ar = new UnArchiver(); $ar->open($sample_zip); foreach( $ar->list('*.jpg') as $name => $entry ){ var_dump([$name,$entry->contents()]); } ?>
要求
UnArchiver命令行工具。
sudo apt install unar
更多示例。
在仓库中的samples/中查看示例。