PHPackages                             hugsbrugs/php-zip - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hugsbrugs/php-zip

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hugsbrugs/php-zip
=================

PHP ZIP Utilities

181PHP

Since Feb 20Pushed 7y ago1 watchersCompare

[ Source](https://github.com/hugsbrugs/php-zip)[ Packagist](https://packagist.org/packages/hugsbrugs/php-zip)[ RSS](/packages/hugsbrugs-php-zip/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-zip
-------

[](#php-zip)

Wrapper around PHP [Zippy](https://github.com/alchemy-fr/Zippy) library to zip/unzip archives files

[![Build Status](https://camo.githubusercontent.com/7b0eeb7e8a7d774bd5f4246098c1162c77fc0984d345921d18cc15b532b2a94a/68747470733a2f2f7472617669732d63692e6f72672f6875677362727567732f7068702d7a69702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/hugsbrugs/php-zip)[![Coverage Status](https://camo.githubusercontent.com/202c055342f8fbe5aeb7dca21618d5c4500919b8e9b7c7634e6141d777557ba1/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6875677362727567732f7068702d7a69702f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/hugsbrugs/php-zip?branch=master)

Install
-------

[](#install)

Install package with composer

```
composer require hugsbrugs/php-zip

```

In your PHP code, load librairy

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

Usage
-----

[](#usage)

### Compress File or Folder

[](#compress-file-or-folder)

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

Outputs

```
[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

[](#uncompress-file-or-folder)

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

Outputs

```
[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

Unit Tests
----------

[](#unit-tests)

```
composer exec phpunit

```

Author
------

[](#author)

Hugo Maugey [visit my website ;)](https://hugo.maugey.fr)

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/cc04033020c3e5219ac30edf7d7362952e88ea64a0de2f41b89559f849f09901?d=identicon)[hugsbrugs](/maintainers/hugsbrugs)

---

Top Contributors

[![hugsbrugs](https://avatars.githubusercontent.com/u/4385090?v=4)](https://github.com/hugsbrugs "hugsbrugs (5 commits)")

---

Tags

phpphp-zipzipzippy

### Embed Badge

![Health badge](/badges/hugsbrugs-php-zip/health.svg)

```
[![Health](https://phpackages.com/badges/hugsbrugs-php-zip/health.svg)](https://phpackages.com/packages/hugsbrugs-php-zip)
```

###  Alternatives

[hackzilla/ticket-bundle

This Bundle provides multilingual ticketing functionality for Symfony applications.

6429.3k1](/packages/hackzilla-ticket-bundle)[tantek/cassis

1321.0k3](/packages/tantek-cassis)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
