ride/lib-archive
Composer 安装命令:
composer require ride/lib-archive
包简介
Abstraction library for (de)compression of archives.
README 文档
README
Ride library for abstraction of file archiving.
What's In This Library
Archive
The Archive interface is used to implement a compression algorithm. You can use it to compress files into an archive or to decompress an archive to your file system.
There are 2 implementations provided:
- PharArchive
- ZipArchive
Code Sample
Check this code sample to see how to use this library:
<?php use ride\library\archive\ZipArchive; use ride\library\system\file\FileSystem; function createArchive(FileSystem $fileSystem) { // create the archive $archiveFile = $fileSystem->getTemporaryFile(); $archive = new ZipArchive($archiveFile); // compress single file in the root of the archive $file = $fileSystem->getFile('/my/file'); $archive->compress($file); // compress multiple files in a folder in the archive $files = array( $fileSystem->getFile('/my/second-file'), $fileSystem->getFile('/my/third-file'), ); $archive->compress($files, 'path/in/archive'); // we're done here return $archiveFile; }
Installation
You can use Composer to install this library.
composer require ride/lib-archive
统计信息
- 总下载量: 50
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-05-01