PHPackages                             valdeirpsr/fuel-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. [File &amp; Storage](/categories/file-storage)
4. /
5. valdeirpsr/fuel-zip

ActiveFuel-package[File &amp; Storage](/categories/file-storage)

valdeirpsr/fuel-zip
===================

Zip file manager

0.0.1(10y ago)032MITPHP

Since Apr 25Pushed 10y ago1 watchersCompare

[ Source](https://github.com/valdeirpsr/fuel-zip)[ Packagist](https://packagist.org/packages/valdeirpsr/fuel-zip)[ Docs](http://www.valdeirsantana.com.br)[ RSS](/packages/valdeirpsr-fuel-zip/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Fuel Zip package
================

[](#fuel-zip-package)

Install
-------

[](#install)

Via Composer

```
{
    "require": {
        "valdeirpsr/fuel-zip": "dev-master"
    }
}
```

Via Composer (Command Line)

```
composer require valdeirpsr/fuel-zip
```

Configuration
-------------

[](#configuration)

```
return [
  'default' => [
    'comment' => 'Created ' . date('c'),
    'password' => null,
    'save_to' => null,
    'password_generator' => [
      'enabled' => false,
      'length' => 8,
      'type' => 'alnum'
    ]
  ]
];
```

Translate
---------

[](#translate)

```
return [
    'error_0' => 'No error',
	'error_1' => 'Multi-disk zip archives not supported',
	'error_2' => 'Renaming temporary file failed',
	'error_3' => 'Closing zip archive failed',
	'error_4' => 'Seek error',
	'error_5' => 'Read error',
	'error_6' => 'Write error',
	'error_7' => 'CRC error',
	'error_8' => 'Containing zip archive was closed',
	'error_9' => 'No such file',
	'error_10' => 'File already exists',
	'error_11' => 'Can\'t open file',
	'error_12' => 'Failure to create temporary file',
	'error_13' => 'Zlib error',
	'error_14' => 'Malloc failure',
	'error_15' => 'Entry has been changed',
	'error_16' => 'Compression method not supported',
	'error_17' => 'Premature EOF',
	'error_18' => 'Invalid argument',
	'error_19' => 'Not a zip archive',
	'error_20' => 'Internal error',
	'error_21' => 'Zip archive inconsistent',
	'error_22' => 'Can\'t remove file',
	'error_23' => 'Entry has been deleted',
	'error_should_be_number' => 'A non well formed numeric value encountered',
	'error_method_unsupported' => 'Method \':method\' unsupported',
	'error_opsys_unsupported' => 'Operaciocnal System \':opsys\' unsupported',
	'error_flags_unsupported' => 'Flag unsupported',
	'error_name_required' => 'New name is required!',
];
```

Usage
-----

[](#usage)

```
Zip\Zip::forge();
Zip\Zip::open("teste.zip", Zip\Zip::CREATE);
Zip\Zip::addEmptyDir("new_folder");
Zip\Zip::addFile("index.php");
Zip\Zip::addFile("favicon.ico");
Zip\Zip::addDir(DOCROOT."files");
Zip\Zip::save();

// Or
$zip = new Zip\Zip;
$zip->open("teste2.zip", Zip\Zip::CREATE);
$zip->addEmptyDir("new_folder");
$zip->addFile("index.php");
$zip->addFile("favicon.ico");
$zip->addDir(DOCROOT."files");
$zip->save();
```

Creating directory in the zip file
----------------------------------

[](#creating-directory-in-the-zip-file)

```
$zip->createDir([
  'one',
  'two'
]);
$zip->createDir('three');
```

Creating file in the zip file
-----------------------------

[](#creating-file-in-the-zip-file)

```
$zip->createFile([
  'pass.pwd' => 'File content',
  'error_log.txt' => 'No error'
]);

$zip->createFile('music.txt', 'Na alegria, na tristeza, sempre lado a lado
Com carinho ensinou meus primeiro passos
Mais uma guerreira de pele escura, sofredora
Tenho muito orgulho de minha coroa
Sua garra, seu jeito simples de ser
Essas qualidades são exemplo pra viver
Seus conselhos foram forças pra nunca desistir
Muito obrigado por você existir

Link: http://www.vagalume.com.br/509-e/rainha-do-lar.html');
```

Deleting files
--------------

[](#deleting-files)

```
// By Index
$zip->delete(1);

// By Filename
$zip->delete([
  'music.txt',
  'file2.txt
]);
```

Renaming files
--------------

[](#renaming-files)

```
// Old Name, New Name
$zip->rename('error_log.txt', 'no_error.txt');

$zip->rename([
  'music.txt' => 'Rainha do Lar - 509-E.txt' // Old Name => New Name
]);
```

Describing files
----------------

[](#describing-files)

```
// Index, Description
$zip->setComment(1, 'First comment');

$zip->setComment([
  'Rainha do Lar - 509-E.txt' => 'Brazilian rap' //Filename => Description
]);

// Comment the zip
$zip->setArchiveComment("new comment");
```

Adding directories
------------------

[](#adding-directories)

```
$zip->addDir(DOCROOT."files/music");

// Or
$zip->addDir([
  DOCROOT."files/music",
  DOCROOT."files/photo",
  DOCROOT."files/videos"
]);

// Or with filter
$zip->addDir([
  DOCROOT."files/music",
  DOCROOT."files/photo",
  DOCROOT."files/videos"
], 0, [
  '!^\.', // no hidden files/dirs
  '!^private' => 'dir', // no private dirs
  '\.png$' => 'file', // only get png's
  '\.css$' => 'file', // or css files
  '!^_', // exclude everything that starts with an underscore.
]);
```

Adding files
------------

[](#adding-files)

```
$zip->addFile(DOCROOT."music1.mp3");
$zip->addFile(DOCROOT."music2.mp3");
$zip->addFile(DOCROOT."music3.mp3");

// Or
$zip->addFile([
  DOCROOT."music1.mp3",
  DOCROOT."music2.mp3" => "new_dir",
  DOCROOT."music3.mp3" => "new_dir/music"
]);
```

Set the compression
-------------------

[](#set-the-compression)

```
$zip->setCompression("my_file.txt", Zip\Zip::CM_DEFLATE);
```

List of all the zip files
-------------------------

[](#list-of-all-the-zip-files)

```
// All files
$zip->listFiles();

// Filter files in the directory music/
$zip->listFiles("music/");

// Filter files in the directory music/ and image/
$zip->listFiles([
  "music",
  "image"
]);
```

Open File
---------

[](#open-file)

```
$zip->open("psr.zip", Zip\Zip::CREATE);
```

Save file changes
-----------------

[](#save-file-changes)

```
$zip->save();
```

extract
-------

[](#extract)

```
$zip->extract(DOCROOT."extracted");
```

Credits
-------

[](#credits)

- [Valdeir Santana](http://www.valdeirsantana.com.br)
- [All Contributors](https://github.com/valdeirpsr/Zip/graphs/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/valdeirpsr/Zip/blob/master/LICENSE) for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3667d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9604a5dfd3946f51c56d7e73c5190a3a197e1b6d4dc26a8b6aa8f6c2157c2d1e?d=identicon)[valdeirpsr](/maintainers/valdeirpsr)

---

Top Contributors

[![valdeirpsr](https://avatars.githubusercontent.com/u/12245226?v=4)](https://github.com/valdeirpsr "valdeirpsr (1 commits)")

---

Tags

fuelphpzipcompressziparchivefuelfuel-phpzip file

### Embed Badge

![Health badge](/badges/valdeirpsr-fuel-zip/health.svg)

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

###  Alternatives

[maennchen/zipstream-php

ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.

1.9k286.3M147](/packages/maennchen-zipstream-php)[nelexa/zip

PhpZip is a php-library for extended work with ZIP-archives. Open, create, update, delete, extract and get info tool. Supports appending to existing ZIP files, WinZip AES encryption, Traditional PKWARE Encryption, BZIP2 compression, external file attributes and ZIP64 extensions. Alternative ZipArchive. It does not require php-zip extension.

4967.4M112](/packages/nelexa-zip)[zanysoft/laravel-zip

laravel-zip is the world's leading zip utility for file compression and backup.

3142.8M15](/packages/zanysoft-laravel-zip)[madnest/madzipper

Easier zip file handling for Laravel applications.

1382.3M6](/packages/madnest-madzipper)[wapmorgan/unified-archive

UnifiedArchive - an archive manager with unified interface of working with all popular archive formats (zip/7z/rar/gz/bz2/xz/cab/tar/tar.gz/tar.bz2/tar.x/tar.Z/...) for PHP with ability for listing, reading, extracting and creation + built-in console archive manager.

2791.6M7](/packages/wapmorgan-unified-archive)[wgenial/s3-objects-stream-zip-php

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

2086.7k](/packages/wgenial-s3-objects-stream-zip-php)

PHPackages © 2026

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