Skip to content

lootils/archiver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lootils Archiver

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.

About

Abstraction library to interface with file archives

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages