Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
PHP Class to create archives of compressed files in ZIP format.
PHP
branch: master

This branch is 2 commits ahead, 40 commits behind Grandt:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Docs
.gitignore
README
REVISION.TXT
Zip.Example1.php
Zip.Example2.php
Zip.Test1.php
Zip.php
ZipStream.Example1.php
ZipStream.Example1s.php
ZipStream.Example2.php
ZipStream.Example2s.php
ZipStream.php
composer.json

README

A pair of PHP classes to generate zip files.

The projects that started these two classes are hosted on PHPClasses.org at the addresses:
Zip      : http://www.phpclasses.org/package/6110
ZipStream: http://www.phpclasses.org/package/6616

Zip.php generates the Zip file in memory (or tempfile) allowing the parent script to save the final Zip file elsewhere, and/or send it to the user.
ZipStream has much of the same features and functions of Zip.php, with a few notable differences, it does not cache and build the zip file on the server, instead it'll send the file to the user as a stream.

See the examples for example usage. The php files have "some" doumentation in them in the form of Javadoc style function headers.

NOTE: Please ensure that output buffering is disabled when using especially ZipStream. It defeats the purpose of the class, and large zip files may cause a memory exceeded exception.
NOTE2: THe Zip and ZipStream classes support UTF-8 in file paths and file comments, and will autodetect UTF-8 strings to that end, however it is up to the user to ensure that other Multibyte chracter sets aren't sent to the class.

TODO:
* Add compression level (at least "compress or store") to ZipStream, and to the Large file option on Zip.php
* Documentation, no one reads it, but everyone complains if it is missing.
* Better examples to fully cover the capabilities of the Zip classes.
* more TODO's.

Something went wrong with that request. Please try again.