markocupic/zip-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

markocupic/zip-bundle

最新稳定版本:1.1.2

Composer 安装命令:

composer require markocupic/zip-bundle

包简介

Provides a simple ZIP extension for zipping directories recursively.

README 文档

README

Alt text

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-02