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