Julio Montoya a36c89bb3a Updating vendors 11 年之前
..
docs a36c89bb3a Updating vendors 11 年之前
src a36c89bb3a Updating vendors 11 年之前
tests a36c89bb3a Updating vendors 11 年之前
.gitignore 5f7d19f3e7 Updating vendors 11 年之前
.travis.yml a36c89bb3a Updating vendors 11 年之前
CHANGELOG.md a36c89bb3a Updating vendors 11 年之前
LICENSE da821fb9fc Updating vendors 11 年之前
README.md a36c89bb3a Updating vendors 11 年之前
composer.json a36c89bb3a Updating vendors 11 年之前
composer.lock a36c89bb3a Updating vendors 11 年之前
phpunit-functional.xml.dist da821fb9fc Updating vendors 11 年之前
phpunit.xml.dist da821fb9fc Updating vendors 11 年之前

README.md

Zippy

A Object-Oriented PHP library to manipulate any archive format (de)compression through commandline utilities or PHP extension.

Build Status

Adapters

Zippy currently supports

  • zip
  • PHP zip
  • GNU tar
  • BSD tar

Which brings support to file types

  • .tar
  • .zip
  • .tar.gz
  • .tar.bz2

API Example

Archive listing and extraction :

use Alchemy\Zippy\Zippy;

$zippy = Zippy::load();
$zippy->create('archive.zip', '/path/to/folder');

$archive = $zippy->open('build.tar');

// extract content to `/tmp`
$archive->extract('/tmp');

// iterates through members
foreach ($archive as $member) {
    echo "archive contains $member \n";
}

Archive creation

use Alchemy\Zippy\Zippy;

$zippy = Zippy::load();
// creates an archive.zip that contains a directory "folder" that contains
// files contained in "/path/to/directory" recursively
$archive = $zippy->create('archive.zip', array(
    'folder' => '/path/to/directory'
), recursive = true);

Customize file and directory names inside archive

use Alchemy\Zippy\Zippy;

$zippy = Zippy::load();
$archive = $zippy->create('archive.zip', array(
    'folder' => '/path/to/directory',            // will create a folder at root
    'http://www.google.com/logo.jpg',            // will create a logo.jpg file at root
    fopen('https://www.facebook.com/index.php'), // will create an index.php at root
    'directory/image.jpg' => 'image.jpg',        // will create a image.jpg in 'directory' folder
));

##API Browser

Documentation

Documentation hosted at read the docs !

##License

This project is licensed under the MIT license.