lootils / archiver
An abstraction library to interface with file archives.
0.3.0
2013-10-07 16:36 UTC
Requires
- php: >=5.3.0
Requires (Dev)
- pear/archive_tar: 1.3.*
Suggests
- pear/archive_tar: Allows interfacing with tar archives.
- zip: Allows interfacing with zip archives.
README
An abstraction library to interface with file archives.
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.