PHP 8.3.30
Preview: InflateStream.php Size: 1.38 KB
/home/getspomw/itechservicellc.com/vendor/guzzlehttp/psr7/src/InflateStream.php

<?php

declare(strict_types=1);

namespace GuzzleHttp\Psr7;

use Psr\Http\Message\StreamInterface;

/**
 * Uses PHP's zlib.inflate filter to inflate zlib (HTTP deflate, RFC1950) or gzipped (RFC1952) content.
 *
 * This stream decorator converts the provided stream to a PHP stream resource,
 * then appends the zlib.inflate filter. The stream is then converted back
 * to a Guzzle stream resource to be used as a Guzzle stream.
 *
 * @see https://datatracker.ietf.org/doc/html/rfc1950
 * @see https://datatracker.ietf.org/doc/html/rfc1952
 * @see https://www.php.net/manual/en/filters.compression.php
 */
final class InflateStream implements StreamInterface
{
    use StreamDecoratorTrait;

    /** @var StreamInterface */
    private $stream;

    public function __construct(StreamInterface $stream)
    {
        $resource = StreamWrapper::getResource($stream);
        // Specify window=15+32, so zlib will use header detection to both gzip (with header) and zlib data
        // See https://www.zlib.net/manual.html#Advanced definition of inflateInit2
        // "Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection"
        // Default window size is 15.
        stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ, ['window' => 15 + 32]);
        $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource));
    }
}

Directory Contents

Dirs: 1 × Files: 30

Name Size Perms Modified Actions
Exception DIR
- drwxr-xr-x 2025-11-18 19:23:52
Edit Download
5.81 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
3.14 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
4.49 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
1.17 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
4.21 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
3.85 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
3.00 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
1.38 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
1.06 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
4.20 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
8.14 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
7.56 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
53.75 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
5.06 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
524 B lrw-r--r-- 2025-10-28 20:22:14
Edit Download
4.49 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
3.95 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
3.82 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
4.79 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
661 B lrw-r--r-- 2025-10-28 20:22:14
Edit Download
9.33 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
7.21 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
3.24 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
4.53 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
4.98 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
21.44 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
1.12 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
8.26 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
8.38 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download
15.57 KB lrw-r--r-- 2025-10-28 20:22:14
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).