linkus / php-archive
该包的最新版本(1.2.1)没有可用的许可证信息。
支持从多种格式提取归档
该包的官方仓库似乎已丢失,因此该包已被冻结。
1.2.1
2018-10-05 02:15 UTC
This package is not auto-updated.
Last update: 2023-01-11 22:20:34 UTC
README
通过统一界面管理不同格式的归档
用法
打开归档
$arch = new ArchiveManager();
$arch->open('path/to/archive');
提取文件
// some files:
$arch->extract('path/to/extract', 'file1.txt');
$arch->extract('path/to/extract', ['file1.txt', 'file2.txt']);
// extract all files:
$arch->extractAll('path/to/extract');
归档文件
// create a new archive from source:
$arch->compress('path/to/directory', 'path/to/archive');
注意:归档名称的扩展名决定了归档格式。
添加文件
$arch->add('path/to/file', 'filename');
测试归档完整性
$arch->test('path/to/file');