Download the PHP package virusphp/laravel-zip without Composer
On this page you can find all versions of the php package virusphp/laravel-zip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download virusphp/laravel-zip
More information about virusphp/laravel-zip
Files in virusphp/laravel-zip
Package laravel-zip
Short Description laravel-zip is the world's leading zip utility for file compression and backup.
License MIT
Homepage http://www.virusphp.net
Informations about the package laravel-zip
virusphp/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 virusphp/laravel-zip
After updating composer, add the ServiceProvider to the providers array in config/app.php
Virusphp\Zip\ZipServiceProvider::class,
You can optionally use the facade for shorter code. Add this to your facades:
'Zip' => Virusphp\Zip\Facades\Zip::class,
Zip usage
use Virusphp\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 content 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 \Virusphp\Zip\ZipManager
can handle multiple Virusphp\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