PHPackages                             purpose-media/zipper - 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. purpose-media/zipper

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

purpose-media/zipper
====================

This is a little neat helper for the ZipArchive methods with handy functions

2.0.1(8y ago)017Apache2PHPPHP &gt;=5.3.0

Since Nov 25Pushed 8y ago2 watchersCompare

[ Source](https://github.com/purpose-media/Zipper)[ Packagist](https://packagist.org/packages/purpose-media/zipper)[ Docs](http://github.com/Chumper/zipper)[ RSS](/packages/purpose-media-zipper/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (4)Versions (12)Used By (0)

\#Zipper

[![Build Status](https://camo.githubusercontent.com/9bbc0529ee78158aae6353b1ed31e24a84f7b31c7d5b4a552c60513d4f5e0a9c/68747470733a2f2f7472617669732d63692e6f72672f4368756d7065722f5a69707065722e706e67)](https://travis-ci.org/Chumper/Zipper)

This is a simple Wrapper around the ZipArchive methods with some handy functions.

\##Installation

To install this package just require it in your `composer.json` with

```
"Chumper/Zipper": "dev-master"

```

This package also includes Laravel 4 support, to activate it add

```
'Chumper\Zipper\ZipperServiceProvider'

```

to the service providers in the `app.php`

You can then access Zipper with the `Zipper` alias.

\##Simple example

```
$zipper = new \Chumper\Zipper\Zipper;

$zipper->make('test.zip')->folder('test')->add('composer.json');
$zipper-zip('test.zip')->folder('test')->add('composer.json','test');

$zipper->remove('composer.lock');

$zipper->folder('mySuperPackage')->add(
    array(
        'vendor',
        'composer.json'
    ),
);

$zipper->getFileContent('mySuperPackage/composer.json');

$zipper->make('test.zip')->extractTo('',array('mySuperPackage/composer.json'),Zipper::WHITELIST);

```

You can easily chain most functions, functions that are not chainable are `getFileContent`, `close`, `extractTo` and `getStatus`

The main reason i wrote this little package is the `extractTo` method since it allows you to be very flexible when extracting zips. So you can for example implement an update method which will just override the changed files.

```
$zipper->make('test.zip')->extractTo('public', array('vendor'), Zipper::BLACKLIST);

```

This will extract the `test.zip` into the `public` folder except the folder `vendor` inside the zip will not be extracted.

```
$zipper->make('test.zip')->extractTo('public', array('vendor'), Zipper::WHITELIST);

```

This will extract the `test.zip` into the `public` folder but **only** the folder `vendor` inside the zip will be extracted.

```
$zipper->make('test.zip')->folder('test')->extractTo('foo');

```

This will go into the folder `test` in the zip file and extract the content of the folder to the folder `foo`. This command is really nice to get just a part of the zip file.

\##Functions

**make($pathToFile)**

create or open a zip archive; if the file does not exists it will create a new one. It will return the Zipper instance so you can chain easily

**extractTo($path, array $files = array(), $method = Zipper::BLACKLIST)**

Extracts the content of the zip archive to the specified location. You can specify an array or string of files that will be white listed or black listed based on the third parameter

**getFileContent($filePath)**

get the content of a file in the zip. This will return the content or false.

**add($pathToAdd)**

add a string or an array of files to the zip You can name files or folder, all files in the folder then will be added.

**getStatus()**

get the opening status of the zip as integer

**remove($fileToRemove)**

removes a single file or an array of files from the zip.

**close()**

closes the zip and writes all changes

**folder($folder)**

Sets the internal pointer to this folder

**home()**

Resets the folder pointer

**zip($fileName)**

USes the ZipRepository for file handling

\##Development

May it is a goot idea to add other compress functions like rar, phar or bzip2 etc... Everything is setup for that, if you want just fork and develop further.

If you need other functions or got errors, please leave an issue on github.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

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.

###  Release Activity

Cadence

Every ~129 days

Recently: every ~92 days

Total

10

Last Release

3025d ago

Major Versions

0.7.0 → v1.0.02017-01-30

v1.0.2 → 2.0.02018-02-01

PHP version history (3 changes)0.5.0PHP &gt;=5.3.0

0.7.0PHP &gt;=5.4.0

v1.0.1PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d3e1b7c99ce9b3476e34d32c986758d672fcd834d8d8dbfe76937393ea95be6?d=identicon)[purposemedia](/maintainers/purposemedia)

---

Top Contributors

[![Chumper](https://avatars.githubusercontent.com/u/919670?v=4)](https://github.com/Chumper "Chumper (17 commits)")[![aldas](https://avatars.githubusercontent.com/u/2320301?v=4)](https://github.com/aldas "aldas (12 commits)")[![rvitaliy](https://avatars.githubusercontent.com/u/1823711?v=4)](https://github.com/rvitaliy "rvitaliy (9 commits)")[![thecotne](https://avatars.githubusercontent.com/u/1606993?v=4)](https://github.com/thecotne "thecotne (3 commits)")[![actionm](https://avatars.githubusercontent.com/u/1145098?v=4)](https://github.com/actionm "actionm (2 commits)")[![bart](https://avatars.githubusercontent.com/u/5200235?v=4)](https://github.com/bart "bart (2 commits)")[![plantwebdesign](https://avatars.githubusercontent.com/u/838647?v=4)](https://github.com/plantwebdesign "plantwebdesign (2 commits)")[![snipe](https://avatars.githubusercontent.com/u/197404?v=4)](https://github.com/snipe "snipe (2 commits)")[![inov](https://avatars.githubusercontent.com/u/2234246?v=4)](https://github.com/inov "inov (1 commits)")[![lex111](https://avatars.githubusercontent.com/u/4408379?v=4)](https://github.com/lex111 "lex111 (1 commits)")[![vool](https://avatars.githubusercontent.com/u/441840?v=4)](https://github.com/vool "vool (1 commits)")[![xploSEoF](https://avatars.githubusercontent.com/u/7510900?v=4)](https://github.com/xploSEoF "xploSEoF (1 commits)")[![alesf](https://avatars.githubusercontent.com/u/1148574?v=4)](https://github.com/alesf "alesf (1 commits)")[![arthurprogramming](https://avatars.githubusercontent.com/u/4672300?v=4)](https://github.com/arthurprogramming "arthurprogramming (1 commits)")[![berdyshev](https://avatars.githubusercontent.com/u/539090?v=4)](https://github.com/berdyshev "berdyshev (1 commits)")[![bestmomo](https://avatars.githubusercontent.com/u/2959682?v=4)](https://github.com/bestmomo "bestmomo (1 commits)")[![eughenio-westwing](https://avatars.githubusercontent.com/u/11337410?v=4)](https://github.com/eughenio-westwing "eughenio-westwing (1 commits)")[![francescoassenza](https://avatars.githubusercontent.com/u/5212035?v=4)](https://github.com/francescoassenza "francescoassenza (1 commits)")[![heslil](https://avatars.githubusercontent.com/u/14540581?v=4)](https://github.com/heslil "heslil (1 commits)")

---

Tags

laravelarchivezip

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/purpose-media-zipper/health.svg)

```
[![Health](https://phpackages.com/badges/purpose-media-zipper/health.svg)](https://phpackages.com/packages/purpose-media-zipper)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)

PHPackages © 2026

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