markocupic/zip-bundle
最新稳定版本:1.1.2
Composer 安装命令:
composer require markocupic/zip-bundle
包简介
Provides a simple ZIP extension for zipping directories recursively.
关键字:
README 文档
README
Zip extension
This bundle provides a simple Zip class.
Usage
// Add dir recursive with unlimited depth, add dot files and folders too and store it to a given zip-file $zip = (new \Markocupic\ZipBundle\Zip\Zip()) ->ignoreDotFiles(false) ->stripSourcePath('path/to/source/dir') ->addDirRecursive('path/to/source/dir') ->run('path/to/destination/dir/myZip.zip'); // Add dir recursive depth: 1, collect only files and ignore empty folders $zip = (new \Markocupic\ZipBundle\Zip\Zip()) ->stripSourcePath('path/to/source/dir') ->addDirRecursive('path/to/source/dir', 1, true) ->run('path/to/destination/dir/myZip.zip'); // Add a file $zip = (new \Markocupic\ZipBundle\Zip\Zip()) ->stripSourcePath('path/to/source/dir') ->addFile('path/to/source/dir/myFile.txt') ->run('path/to/destination/dir/myZip.zip'); // Add files from a directory $zip = (new \Markocupic\ZipBundle\Zip\Zip()) ->stripSourcePath('path/to/source/dir') ->addDir('path/to/source/dir') ->run('path/to/destination/dir/myZip.zip'); // Add files from a directory $zip = (new \Markocupic\ZipBundle\Zip\Zip()) ->stripSourcePath('path') ->addDir('path/to/source/dir') ->addDir('path/toAnotherDir/source/dir') ->run('path/to/destination/dir/myZip.zip');
统计信息
- 总下载量: 9.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 5
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-08-02
