2017 © Pedro Peláez
 

library php-zip

PHP ZIP Utilities

image

hugsbrugs/php-zip

PHP ZIP Utilities

  • Thursday, April 6, 2017
  • by hugsbrugs
  • Repository
  • 1 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

php-zip

Wrapper around PHP Zippy library to zip/unzip archives files, (*1)

Build Status Coverage Status, (*2)

Install

Install package with composer, (*3)

composer require hugsbrugs/php-zip

In your PHP code, load librairy, (*4)

require_once __DIR__ . '/../vendor/autoload.php';
use Hug\Zip\Zip as Zip;

Usage

Compress File or Folder

$result = Zip::compress($source, $destination);

Outputs, (*5)

[status] => success
[message] => 
[exception] => 
[source] => /var/www/php-utils/php-zip
[destination] => /tmp/test.zip
[source_size] => 16723777
[source_size_hr] => 15.95 MB
[destination_size] => 7827516
[destination_size_hr] => 7.46 MB
[compression] => 53.195285969192

Uncompress File or Folder

$result = Zip::extract($source, $destination);

Outputs, (*6)

[status] => success
[message] => 
[exception] => 
[source] => /tmp/test.zip
[destination] => /var/www/php-utils/php-zip/data
[source_size] => 7827516
[source_size_hr] => 7.46 MB
[destination_size] => 16731969
[destination_size_hr] => 15.96 MB
[decompression] => 113.76

Possible errors : SOURCE_NOT_READABLE INVALID_FILE_TYPE UNKNOWN_ERROR, (*7)

Unit Tests

composer exec phpunit

Author

Hugo Maugey visit my website ;), (*8)

The Versions

06/04 2017