• Stars
    star
    464
  • Rank 90,973 (Top 2 %)
  • Language
    PHP
  • License
    Other
  • Created over 11 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Zippy

License Packagist Travis Scrutinizer Packagist

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

Installation

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

composer require alchemy/zippy

Adapters

Zippy currently supports the following drivers and file formats:

  • 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:

<?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 !

License

This project is licensed under the MIT license.

More Repositories

1

Phraseanet

Digital Asset Management PHP app
PHP
230
star
2

BinaryDriver

Binary driver utilities
PHP
187
star
3

PHP-Unoconv

PHP
73
star
4

Media-Alchemyst

PHP
64
star
5

PHP-dataURI

A PHP dataURI library, RFC 2397 Compliant
PHP
59
star
6

GeonamesServer

A node Geonames server
CSS
42
star
7

RabbitMQ-Management-API-Client

A OO PHP client for the RabbitMQ Management Plugin API
PHP
40
star
8

PHP-XPDF

An object oriented wrapper for XPDF
PHP
37
star
9

PHPExiftool

A PHP Exiftool driver
PHP
31
star
10

Ghostscript-PHP

PHP
29
star
11

exiftool

Phraseanet dependency repository
Perl
27
star
12

PHPSwftools

PHP Swftools driver
PHP
20
star
13

PHP-MP4Box

PHP
15
star
14

Phraseanet-Docs

PHP
10
star
15

phrasea

Phrasea
PHP
9
star
16

gdata

Zend Gdata 1.11
PHP
8
star
17

phraseanet-docker

Phraseanet docker deployement
Shell
7
star
18

Phraseanet-PHP-SDK

PHP
7
star
19

GeonamesServer-PHP-Plugin

PHP
6
star
20

Phraseanet-Extension

PHP Extension for Phraseanet
C
6
star
21

PHPMailer_v5.1

Phraseanet dependency repository
PHP
6
star
22

google-plus-api-client

PHP
5
star
23

Phlickr

Phraseanet dependency repository
PHP
3
star
24

tcpdf

Phraseanet dependency repository
PHP
3
star
25

task-manager

PHP
3
star
26

zippy-svc

PHP
3
star
27

Phraseanet-Indexer

Phraseanet Indexer
C
3
star
28

lazy-command-bundle

Bundle for better dependency injection with Symfony commands
PHP
2
star
29

acl-bundle

PHP
2
star
30

resource-component

Resource component
PHP
2
star
31

Documentation-Boilerplate

A sphinx documentation boilerplate for Alchemy open source projects
Python
2
star
32

Blender

PHP
1
star
33

Phraseanet-PHP-SDK-Silex-Provider

Phraseanet PHP SDK Silex Provider
PHP
1
star
34

Phraseanet-Wordpress-Plugin

Wordpress Plugin for Phraseanet
JavaScript
1
star
35

Showcase

PHP
1
star
36

MoovRelocator

Phraseanet dependency repository
PHP
1
star
37

queue-component

Queue component
PHP
1
star
38

PHPShortener

Phraseanet dependency repository
PHP
1
star
39

pipeline-component

Pipeline component
PHP
1
star
40

phraseanet-bundle

Phraseanet Bundle
PHP
1
star
41

rest-bundle

PHP
1
star
42

SphinxSearch-PHP-SDK

Phraseanet dependency repository
PHP
1
star
43

grunt-js-render

Grunt plugin to embed JSRender templates in Javascript files
JavaScript
1
star
44

embed-bundle

TypeScript
1
star