2017-05-05 22:39:39 +02:00
|
|
|
<?php
|
|
|
|
|
2017-05-14 14:40:20 +02:00
|
|
|
use Amp\ByteStream\ZlibInputStream;
|
2017-05-05 22:39:39 +02:00
|
|
|
use Amp\Loop;
|
2019-07-15 16:16:07 +02:00
|
|
|
use function Amp\ByteStream\getStdin;
|
|
|
|
use function Amp\ByteStream\getStdout;
|
2017-05-05 22:39:39 +02:00
|
|
|
|
2019-07-15 16:16:07 +02:00
|
|
|
require __DIR__."/../vendor/autoload.php";
|
2017-05-05 22:39:39 +02:00
|
|
|
|
|
|
|
Loop::run(function () {
|
2019-07-15 16:16:07 +02:00
|
|
|
$stdin = getStdin();
|
|
|
|
$stdout = getStdout();
|
2017-05-05 22:39:39 +02:00
|
|
|
|
2017-05-25 17:51:25 +02:00
|
|
|
$gzin = new ZlibInputStream($stdin, ZLIB_ENCODING_GZIP);
|
2017-05-05 22:39:39 +02:00
|
|
|
|
|
|
|
while (($chunk = yield $gzin->read()) !== null) {
|
|
|
|
yield $stdout->write($chunk);
|
|
|
|
}
|
2017-05-14 14:40:20 +02:00
|
|
|
});
|