Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 1.37 KB

File metadata and controls

46 lines (30 loc) · 1.37 KB

clue/zlib-react Build Status

Streaming zlib compressor and decompressor, built on top of React PHP, supporting compression and decompression of the following formats:

Note: This project is in early alpha stage! Feel free to report any issues you encounter.

Quickstart example

Once installed, you can use the following code to pipe a readable gzip file stream into an decompressor which emits decompressed data events for each individual file chunk:

$loop = React\EventLoop\Factory::create();
$stream = new Stream(fopen('access.log.gz', 'r'), $loop);

$decompressor = ZlibFilterStream::createGzipDecompressor();

$decompressor->on('data', function ($data) {
    echo $data;
});

$stream->pipe($decompressor);

$loop->run();

See also the examples.

Install

The recommended way to install this library is through composer. New to composer?

$ composer require clue/zlib-react:dev-master

License

MIT