PHP code example of jaeger-app / compress

1. Go to this page and download the library: Download jaeger-app/compress 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/ */

    

jaeger-app / compress example snippets


use \JaegerApp\Compress;

$backup_file = '/path/to/file.php';
$store_path = '/path/to/store';
$compress = new Compress();
$compress->setArchiveName($store_path)->archiveSingle($backup_file);


use \JaegerApp\Compress;

$backup_file = '/path/to/file.ext';
$store_path = '/path/to/store.zip';
$compress = new Compress();
$compress->setKeepOriginal(true)->setArchiveName($store_path)->archiveSingle($backup_file);


use \JaegerApp\Compress;

$store_path = '/path/to/store.zip';
$compress = new Compress();
$compress->create($store_path);
$compress->add('/path/to/file/test.php');
$compress->add('/path/to/dir2');
$compress->add('/path/to/dir3');
$path_to_archive = $compress->close();

use \JaegerApp\Compress;

$archive_path = '/path/to/archive.zip';
$destination = '/path/to/store/data';
$compress = new Compress();
$compress->extract($archive_path, $destination);