forked from rebillar/site-accueil-insa
.. | ||
libs | ||
src | ||
LICENSE | ||
README.md |
Matomo/Decompress
Component providing several adapters to decompress files.
It supports the following compression formats:
- Zip
- Gzip
- Bzip
- Tar (gzip or bzip)
With the following adapters:
PclZip
, based on the PclZip libraryZipArchive
, based on PHP's Zip extensionGzip
, based on PHP's native Gzip functionsBzip
, based on PHP's native Bzip functionsTar
, based on the Archive_Tar library from PEAR
Installation
With Composer:
{
"require": {
"matomo/decompress": "*"
}
}
Usage
All adapters have the same API as they implement Matomo\Decompress\DecompressInterface
:
$extractor = new \Matomo\Decompress\Gzip('file.gz');
$extractedFiles = $extractor->extract('some/directory');
if ($extractedFiles === 0) {
echo $extractor->errorInfo();
}
License
The Decompress component is released under the LGPL v3.0.