GithubHelp home page GithubHelp logo

pborreli / zippy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alchemy-fr/zippy

0.0 1.0 0.0 6.03 MB

PHP zip/tar/bz2 archives (de)compression library with commandline or extensions

License: Other

Shell 1.47% JavaScript 7.21% Python 6.39% PHP 84.93%

zippy's Introduction

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');

$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.

zippy's People

Contributors

nlegoff avatar romainneutron avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.