nguyenanhung / zip-helper
PHP Zip Helper - Basic, Simple and Lightweight
Installs: 24 035
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
- alchemy/zippy: ^0.4 || ^1.0
- nguyenanhung/filesystem-helper: >=2.0
Requires (Dev)
- kint-php/kint: >=3.0
README
Zip Helper
PHP Zip Helper - Basic, Simple and Lightweight
Version
- V1.x support all PHP version
>=5.6
- V2.x support all PHP version
>=7.0
How to use
Setup helper
Install helper with Composer
composer require nguyenanhung/zip-helper
Code
You can write your app, and see example code same bellow
<?php use nguyenanhung\Libraries\Zip\Zip; require_once __DIR__ . '/vendor/autoload.php'; $fileTest = __DIR__ . '/tmp/test-file.zip'; $zip = new Zip(); $zip->setFilename($fileTest); $zip->setDataList( array( __DIR__ . '/docs', // Your Path __DIR__ . '/docs/README.md' // Your file ) ); // Compress with ZIP $result = $zip->zip(); // Add all data in $dataList to $filename d($result); d(directory_map(__DIR__ . '/tmp')); // Extract Zip file $zip->setExtractFolder(__DIR__ . '/tmp'); $extract = $zip->unzip(); d($extract); d(directory_map(__DIR__ . '/tmp'));
Contact & Support
If any question & request, please contact following information
From Vietnam with Love <3