2017 © Pedro Peláez
 

library zippy

Zippy, the archive manager companion

image

alchemy/zippy

Zippy, the archive manager companion

  • Thursday, February 22, 2018
  • by bburnichon
  • Repository
  • 18 Watchers
  • 344 Stars
  • 2,550,037 Installations
  • PHP
  • 43 Dependents
  • 0 Suggesters
  • 53 Forks
  • 32 Open issues
  • 24 Versions
  • 12 % Grown

The README.md

Zippy

License Packagist Travis Scrutinizer Packagist, (*1)

A PHP library to read, create, and extract archives in various formats via command line utilities or PHP extensions, (*2)

Installation

The only supported installation method is via Composer. Run the following command to require Zippy in your project:, (*3)

composer require alchemy/zippy

Adapters

Zippy currently supports the following drivers and file formats:, (*4)

  • zip
    • .zip
  • PHP zip extension
    • .zip
  • GNU tar
    • .tar
    • .tar.gz
    • .tar.bz2
  • BSD tar
    • .tar
    • .tar.gz
    • .tar.bz2

Getting started

All the following code samples assume that Zippy is loaded and available as $zippy. You need the following code (or variation of) to load Zippy:, (*5)

<?php

use Alchemy\Zippy\Zippy;

// Require Composer's autoloader
require __DIR__ . '/vendor/autoload.php';

// Load Zippy
$zippy = Zippy::load();

List an archive's contents:

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

// Iterate through members
foreach ($archive as $member) {
    echo "Archive contains $member" . PHP_EOL;
}

Extract an archive to a specific directory:

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

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

Create a new archive

// 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'
), true);

Customize file and directory names inside archive

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

Documentation

Documentation hosted at read the docs !, (*6)

License

This project is licensed under the MIT license., (*7)

The Versions

03/11 2016

0.4.4

0.4.4.0

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

03/11 2016

0.4.3

0.4.3.0

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

05/08 2016

0.4.2

0.4.2.0

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

05/08 2016

0.4.1

0.4.1.0

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

05/08 2016

dev-clean/teleporters

dev-clean/teleporters

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

19/07 2016

0.4.0

0.4.0.0

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

29/06 2016

v0.5.x-dev

0.5.9999999.9999999-dev

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

15/02 2016

0.3.5

0.3.5.0

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

10/02 2016

dev-feature/scrutinizer-config

dev-feature/scrutinizer-config

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

02/02 2016

0.3.4

0.3.4.0

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

27/01 2016

0.3.3

0.3.3.0

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

12/01 2016

0.3.2

0.3.2.0

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

15/12 2015

0.3.1

0.3.1.0

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

15/12 2015

0.3.0

0.3.0.0

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

10/12 2014

0.2.1

0.2.1.0

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

04/04 2014

0.2.0

0.2.0.0

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

12/04 2013

0.1.1

0.1.1.0

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip

11/03 2013

0.1.0

0.1.0.0

Zippy, the archive manager companion

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compression tar bzip