Zipper is a facilitator for creating Zip Files in an uncomplicated way, with features of Download, Insert Files, Extraction and Creation of Zip with multiple in one!
Zipper é um facilitador para criação de Arquivos Zip de maneira descomplicada, contando com recursos de Download, inserção de Arquivos, Extração e Criação de Zipagem com múltiplos em um só!
Você pode saber mais clicando aqui.
- Simple installation (Instalação simples)
- You can Extract Zip Files (Você pode extrair arquivos zip)
- You can Create a Zip File with how many you want (É possível criar Arquivos Zip com quantos arquivos desejar)
- There is a layer to show error messages (Possui mensagens, caso um erro impeça a execução desejada)
- With Zipper is so easy force a download of any file with only one line of code (Com o Zipper é uito fácil forçar o download de qualquer arquivo com somente uma linha de código)
- Facilitates how to handle zip files by writing less code (Facilita a manipulação de Arquivos Zip escrevendo menos código)
- Composer ready and PSR-2 compliant (Pronto para o composer e compatível com PSR-2)
Zipper is available via Composer:
"sergiodanilojr/zipper": "^1.0"
or run
composer require sergiodanilojr/zipper
For details on how to use, see a sample folder in the zipper directory. In it you will have an example of use for each class. It works like this:
Para mais detalhes sobre como usar, veja uma pasta de exemplo no diretório do zipper. Nela terá um exemplo de uso para cada classe. Ele funciona assim:
<?php
require __DIR__ . "/vendor/autoload.php";
use SergioDaniloJr\Zipper\Zipper;
$zipper = new Zipper();
$fileExample = __DIR__."/assets/files/example-file.txt";
$single = $zipper->zipFile($fileExample);
//It'll bring the way of the zip File
echo $single;
<?php
require __DIR__ . "/vendor/autoload.php";
use SergioDaniloJr\Zipper\Zipper;
$zipper = new Zipper();
$fileOne = __DIR__."/assets/files/example-file.txt";
$fileTwo = __DIR__."/assets/files/example-file-two.txt";
$files = [
$fileOne,
$fileTwo
];
//Here I'll set a new folder that not exists yet.
$path = __DIR__."/assets/files/ZipperFiles";
$several = $zipper->zipFiles($files, "MadeWithZipper", $path);
echo $several;
<?php
require __DIR__ . "/vendor/autoload.php";
use SergioDaniloJr\Zipper\Zipper;
$zipper = new Zipper();
$fileToExtract = __DIR__ . "/assets/files/MadeWithZipper.zip";
//Here I'll set a new folder that not exists yet. But You can set a existent folder.
$destiny = __DIR__ . "/assets/files/Storage";
$extracted = $zipper->extract($fileToExtract,$destiny);
echo $extracted;
<?php
require __DIR__ . "/vendor/autoload.php";
use SergioDaniloJr\Zipper\Zipper;
$zipper = new Zipper();
$fileExample = __DIR__ . "/assets/files/example-file.txt";
//This method don't return, obvly, a way!
$zipper->download($fileExample);
<?php
require __DIR__ . "/vendor/autoload.php";
use SergioDaniloJr\Zipper\Zipper;
$path = __DIR__."/ZipperFolder";
// Like that you can set a default folder for save the zip files generated with the methods above.
$zipper = new Zipper($path);
// NOTE: If you set a folder that not exist, Zipper understanding this and will create a new folder like you want! Zipper's Wonderful, no?!
<?php
require __DIR__ . "/vendor/autoload.php";
use SergioDaniloJr\Zipper\Zipper;
$zipper = new Zipper();
//When there'is an error, you can calll the message method for show the error message, it comes like a 'string' type
$zipper->message();
- When you set a folder that not exists, the Zipper Component create the folder for you easyly!
Please see CONTRIBUTING for details.
Security: If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Se você descobrir algum problema relacionado à segurança, envie um e-mail para [email protected] em vez de usar o rastreador de problemas.
The Develoer pretends continue improving this component!
Thank you
- Sérgio Danilo Jr. (Developer)
- All Contributors
The MIT License (MIT). Please see License File for more information.