Library to ease the usage of compression, wrapper around multiple low level compression tools pigz/zip/tar
Simple library for archiving and un-archiving files using several compression utilities
Following types are supported currently:
- Pigz
- Zip
- Targz
- Rar
- Bz2
When using package for compressing file.
$adapter = new Pigz();
$compressionService = new Compression($adapter);
$outoutFile = '/path/to/output/file';
$compressionService->compress($inputFile, $outputFile);
Detecting compression types when dealing with files directly from third parties.
$adapter = AdapterFactory::createFromFile('/path/to/compressed/file');
$compressionService = new Compression($adapter);
$outoutFile = '/path/to/output/file';
$compressionService->decompress($inputFile, $outputFile);
Checking if the file was compressed and has the valid extension
$compressionService->isCompressed('/path/to/input/file');
composer require har256b/compress
Following are the dependencies for package and should be available in the $PATH
pigz
zip unzip
rar unrar
bzip2
$ ./vendor/bin/phpunit
$ composer coverage
- Add directory support to
Pigz
- Implement Zip adapter
- Support for more custom arguments
- Support for compression level selection