定制 spm/zipper 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

spm/zipper

Composer 安装命令:

composer require spm/zipper

包简介

Zip to all files in a folder and its subfolders recursively

README 文档

README

ZPM Zipper is a laravel package.

Its main function are: 1 - recursively zip files from a folder and its subfolders. The structure of the zip will coincide with that of the route sent to the package.

2 - Unzip a zip file to a specific path

Installation

Use composer to install ZPM Zipper.

composer require spm/zipper

Usage

# Providers to add

Spm\Zipper\ZipperServiceProvider:class

#Facade to add

'Zipper' => Spm\Zipper\Facades\Zipper::class

# Set the path and name of the new zip file

$zip_file_name = public_path() . '\exports\file_name.zip';

Zipper::setFileName($zip_file_name)

# Add all folders to zip file
# They can be in different locations as long as they are indicated in the array

$folders_to_zip = [
   public_path() . '\storage\general',
   public_path() . '\storage\home',
];

Zipper::setFoldersToZip($folders_to_zip)

# Make the zip file

Zipper::makeZip();

# Set path to the zip file to unzip

$path_to_zipFile = $request->file('excel-file')->path();

Zipper::setPathToZipFile($path_to_zipFile)

# Set path to the unzipped file result

$path_to_unZip = public_path('storage\import');

Zipper::setPathToUnzip($path_to_unZip)

# Make de unzip file

Zipper::unZipFile()

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

统计信息

  • 总下载量: 18
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-08-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固