1. Go to this page and download the library: Download dimsav/unix-zipper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dimsav / unix-zipper example snippets
// Instantiate the class
$zipper = new UnixZipper();
// Add absolute paths of directories or files for compression
$zipper->add('/absolute/path/to/some/directory');
$zipper->add('/absolute/path/to/file.txt');
// Exclude directories and files
$zipper->exclude('/absolute/path/to/some/directory');
$zipper->exclude('/absolute/path/to/some/file.txt');
// Add a password if you wish
$zipper->setPassword('my_password');
// The path of the file that will be generated
// If the given path doesn't exist, it will be created automatically.
$zipper->setDestination('/file/after/compression/test.zip');
// Do the magic
$zipper->compress();
$zipper = new UnixZipper();
// Set base path
$zipper->setAbsolutePathAsBase('/absolute/projects');
// Add relative paths of directories or files for compression
$zipper->add('project-1'); // /absolute/projects/project-1
$zipper->add('logs/file.txt'); // /absolute/projects/logs/file.txt
$zipper->setDestination('/file/after/compression/test.zip');
// Compress
$zipper->compress();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.