An abstraction library to interface with file archives.
Install Lootils Archiver by adding lootils/archiver
to your composer.json
file.
{
"require": {
"lootils/archiver": "*"
}
}
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 . ' ';
}
In order to interact with tar archives, make sure to add pear/archive_tar
to
your composer.json file.
To install development tools, run the following:
curl -s http://getcomposer.org/installer | php
php composer.phar install
Run tests:
phpunit
This library is available under a MIT license.