2017 © Pedro Peláez
 

library distill

Smart compressed files extractor

image

raulfraile/distill

Smart compressed files extractor

  • Tuesday, December 15, 2015
  • by raulfraile
  • Repository
  • 9 Watchers
  • 225 Stars
  • 24,996 Installations
  • PHP
  • 11 Dependents
  • 0 Suggesters
  • 16 Forks
  • 9 Open issues
  • 31 Versions
  • 11 % Grown

The README.md

Distill: Smart compressed files extractor for PHP

Build Status Latest Stable Version Total Downloads Latest Unstable Version, (*1)

Distill extracts files from compressed archives., (*2)

Features:, (*3)

  • Extract files from ar, bz2, cab, chm, cpio, deb, dmg, epub, gz, phar, rar, shar, tar, tar.bz2, tar.gz, tar.xz, wim, 7z, xz, Z and zip archives.
  • Different decompression methods under the hood: PHP extensions, command line binaries, third-party libraries and even fallback methods in plain PHP.
  • Strategy to choose the right file in case there are more than one available format. Strategies can be based on minimizing bandwidth or optimizing decompression speed.

Installation

The recommended way to install Distill is through Composer. Require the raulfraile/distill package into your composer.json file:, (*4)

Latest Stable Version Latest Unstable Version, (*5)

``` json { "require": { "raulfraile/distill": "@stable" } }, (*6)


**Protip**: you should browse the [raulfraile/distill](https://packagist.org/packages/raulfraile/distill) page to choose a stable version to use, avoid the `@stable` meta constraint. Otherwise, install the library and setup the autoloader yourself. ## Example ```php use Distill\Distill; $distill = new Distill(); $distill->extract(__DIR__ . '/../tests/files/file_ok.zip', __DIR__ . '/extract');

Formats

Strategies

Distill allows to choose one format in case there are many available. For example, it can be useful for installers that want to reduce the bandwidth usage trying to choose compression formats with higher compression ratio and available in the client machine., (*7)

The library provides three strategies (more can be added):, (*8)

  • Minimum size (default): Choose files with higher compression ratio.
  • Uncompression speed: Choose files which are faster to uncompress.
  • Random: Gets a random file which can be uncompressed by the system.
use Distill\Distill;

$distill = new Distill();

$preferredFile = $distill
    ->getChooser()
    ->setStrategy(new \Distill\Strategy\MinimumSize())
    ->addFile('http://get.symfony.com/Symfony_Standard_Vendors_2.5.3.zip')
    ->addFile('http://get.symfony.com/Symfony_Standard_Vendors_2.5.3.tgz')
    ->getPreferredFile();

echo $preferredFile; // http://get.symfony.com/Symfony_Standard_Vendors_2.5.3.tgz
use Distill\Distill;

$distill = new Distill();

$preferredFile = $distill
    ->getChooser()
    ->setStrategy(new \Distill\Strategy\UncompressionSpeed())
    ->addFile('test.phar')
    ->addFile('test.zip')
    ->getPreferredFile();

echo $preferredFile; // test.zip

Command line tool

If you are looking for a command line tool to extract compressed files check out distill-cli, which uses this library:, (*9)

$ distill-cli extract archive.tar.gz path/

Contributing

See CONTRIBUTING file., (*10)

Running the Tests

Install the Composer dev dependencies:, (*11)

$ composer install --dev

Then, run the test suite using PHPUnit:, (*12)

$ phpunit

Credits

License

Distill is released under the MIT License. See the bundled LICENSE file for details., (*13)

The Versions

15/12 2015

dev-master

9999999-dev

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

15/12 2015

v0.9.10

0.9.10.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

17/10 2015

v0.9.9

0.9.9.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

17/10 2015

dev-feature/php7

dev-feature/php7

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

17/10 2015

dev-fix/current_dir

dev-fix/current_dir

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

06/01 2015

dev-feature/gzip-native

dev-feature/gzip-native

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

23/12 2014

v0.9.8

0.9.8.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

23/12 2014

v0.9.7

0.9.7.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

20/12 2014

v0.9.6

0.9.6.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

19/12 2014

v0.9.5

0.9.5.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

14/12 2014

v0.9.4

0.9.4.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

14/12 2014

v0.9.3

0.9.3.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

12/12 2014

v0.9.2

0.9.2.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

08/12 2014

v0.9.1

0.9.1.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

08/12 2014

v0.9.0

0.9.0.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

04/12 2014

v0.8.2

0.8.2.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

04/12 2014

v0.8.1

0.8.1.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip archive compression bzip rar strategy unzip gzip bz2 epub tar.gz xz tar.xz bzip2 7zip cab tgz

23/11 2014

v0.8.0

0.8.0.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip compression bzip rar gzip tar.gz xz tar.xz bzip2 7zip cab

22/11 2014

v0.7.6

0.7.6.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip compression bzip rar gzip tar.gz xz tar.xz bzip2 7zip cab

22/11 2014

v0.7.5

0.7.5.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip compression bzip rar gzip tar.gz xz tar.xz bzip2 7zip cab

21/11 2014

v0.7.4

0.7.4.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip compression bzip rar gzip tar.gz xz tar.xz bzip2 7zip cab

20/11 2014

v0.7.3

0.7.3.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip compression bzip rar gzip tar.gz xz tar.xz bzip2 7zip cab

20/11 2014

v0.7.2

0.7.2.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip compression bzip rar gzip tar.gz xz tar.xz bzip2 7zip cab

20/11 2014

v0.7.1

0.7.1.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip compression bzip rar gzip tar.gz xz tar.xz bzip2 7zip cab

19/11 2014

v0.7

0.7.0.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip compression bzip rar gzip tar.gz xz tar.xz bzip2 7zip cab

17/09 2014

v0.6

0.6.0.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip compression bzip rar gzip tar.gz xz tar.xz bzip2 7zip cab

17/09 2014

v0.5

0.5.0.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip compression bzip rar gzip tar.gz xz tar.xz bzip2 7zip cab

06/09 2014

v0.4

0.4.0.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip compression bzip rar gzip tar.gz xz tar.xz bzip2 7zip cab

01/09 2014

v0.3

0.3.0.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip compression bzip rar gzip tar.gz xz tar.xz bzip2 7zip

31/08 2014

v0.2

0.2.0.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar extractor zip compression bzip rar gzip tar.gz xz tar.xz bzip2 7zip

31/08 2014

v0.1

0.1.0.0

Smart compressed files extractor

  Sources   Download

MIT

The Requires

 

The Development Requires

phar zip compression rar gzip