Download the PHP package macellan/laravel-zip without Composer
On this page you can find all versions of the php package macellan/laravel-zip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download macellan/laravel-zip
More information about macellan/laravel-zip
Files in macellan/laravel-zip
Package laravel-zip
Short Description laravel-zip is the world's leading zip utility for file compression and backup.
License MIT
Homepage https://macellan.net
Informations about the package laravel-zip
Macellan/laravel-zip
laravel-zip is the world's leading zip utility for file compression and backup.
This library was written to simplify and automate Zip files management using PHP ZipArchive.
Installation
Require this package in your composer.json and update composer. This will download the package.
composer require macellan/laravel-zip
After updating composer, add the ServiceProvider to the providers array in config/app.php
Macellan\Zip\ZipServiceProvider::class,
You can optionally use the facade for shorter code. Add this to your facades:
'Zip' => Macellan\Zip\ZipFacade::class,
Zip usage
use Macellan\Zip\Zip
class only use Zip
is made to handle a zip file.
- include the Zip class at top:
Basic operations
-
Open zip file:
-
Create zip file:
-
Check zip file:
-
Extract zip file:
-
Check if zip has a file:
-
Add a file/directory to zip:
-
Add multiple files/directories to zip:
-
Delete a file/directory from zip:
-
Delete multiple files/directories from zip:
-
List content of zip file
- Close zip file
Additional methods
-
Skip hidden files while adding directories:
-
Use password for zip extraction:
- Use a mask != 0777 for created folders:
ZipManager usage
The \Macellan\Zip\ZipManager
can handle multiple Macellan\Zip\Zip
objects.
- include the Zip and ZipManager class at top:
Basic operations
-
Init the manager and register Zips:
-
Basic zips management:
-
Add files to all zips:
-
Extract zips:
-
Merge zips:
- Close zips:
Additional methods
-
Declare path from which add files:
- Use a mask != 0777 for created folders
Testing
All versions of laravel-zip with dependencies
ext-zip Version *