alchemy/zippy
Zippy is a PHP library to read, create, list, and extract archives using CLI tools or PHP extensions. Supports ZIP plus GNU/BSD tar formats (.tar, .tar.gz, .tar.bz2) via a simple API for opening, iterating members, extracting, and creating archives.

A PHP library to read, create, and extract archives in various formats via command line utilities or PHP extensions
The only supported installation method is via Composer. Run the following command to require Zippy in your project:
composer require alchemy/zippy
filesystem, process, http-client) ^6.0 || ^7.0Zippy currently supports the following drivers and file formats:
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();
// Open an archive
$archive = $zippy->open('build.tar');
// Iterate through members
foreach ($archive as $member) {
echo "Archive contains $member" . PHP_EOL;
}
// Open an archive
$archive = $zippy->open('build.tar');
// Extract archive contents to `/tmp`
$archive->extract('/tmp');
// 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);
$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
));
Remote http/https resources are downloaded transparently using the
Symfony HttpClient component.
This project is licensed under the MIT license.
How can I help you explore Laravel packages today?