popphp/pop-archive
最新稳定版本:2.1.1p1
Composer 安装命令:
composer require popphp/pop-archive
包简介
Pop Archive Component for PHP Framework
README 文档
README
END OF LIFE
The pop-archive component v2.1.1 is now end-of-life and will no longer be maintained.
OVERVIEW
pop-archive provides a normalized interface and integrated adapters to let a user decompress,
extract, package and compress files in a common archive format. The supported formats are:
- tar
- tar.gz
- tar.bz2
- zip
pop-archive is a component of the Pop PHP Framework.
INSTALL
Install pop-archive using Composer.
composer require popphp/pop-archive
BASIC USAGE
Extract a zip archive
$archive = new Pop\Archive\Archive('test.zip'); $archive->extract('/path/to/extract/files');
Extract a tar.gz archive
// It will auto-detect and automatically decompress a compressed TAR file $archive = new Pop\Archive\Archive('test.tar.gz'); $archive->extract('/path/to/extract/files');
Add files to a zip archive
$archive = new Pop\Archive\Archive('test.zip'); $archive->addFiles('/path/to/single/file.txt'); $archive->addFiles([ '/path/to/multiple/files1.txt', '/path/to/multiple/files2.txt', '/path/to/multiple/files3.txt', ]);
Add files to a tar archive and compress
$archive = new Pop\Archive\Archive('test.tar'); $archive->addFiles('/path/to/folder/of/files'); // Creates the compressed archive file 'test.tar.bz2' $archive->compress('bz2');
统计信息
- 总下载量: 914
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: New
- 更新时间: 2014-12-07