lootils/archiver

An abstraction library to interface with file archives.

0.3.0 2013-10-07 16:36 UTC

This package is auto-updated.

Last update: 2024-10-10 08:54:09 UTC


README

An abstraction library to interface with file archives.

Build Status

Installation

Install Lootils Archiver by adding lootils/archiver to your composer.json file.

{
    "require": {
        "lootils/archiver": "*"
    }
}

Usage

Create a zip file:

$archive = \Lootils\Archiver\ZipArchive('myarchive.zip');
$archive->add('myfile.png');

Extract a .tar archive:

$archive = \Lootils\Archiver\TarArchive('myarchive.tar');
$archive->extract('destination');

List the contents of a .phar file:

$archive = \Lootils\Archiver\PharArchive('myarchive.phar');
$files = $archive->contents();
foreach ($files as $filename => $data) {
    echo $filename . ' ';
}

Dependencies

In order to interact with tar archives, make sure to add pear/archive_tar to your composer.json file.

Development

To install development tools, run the following:

curl -s http://getcomposer.org/installer | php
php composer.phar install

Run tests:

phpunit

License

This library is available under a MIT license.