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.
- Full name:
\GuzzleHttp\Psr7\InflateStream
- This class is marked as final and can't be subclassed
- This class implements:
\Psr\Http\Message\StreamInterface
- This class is a Final class
See Also:
- http://tools.ietf.org/html/rfc1950 -
- http://tools.ietf.org/html/rfc1952 -
- http://php.net/manual/en/filters.compression.php -
private \Psr\Http\Message\StreamInterface $stream
public __construct(\Psr\Http\Message\StreamInterface $stream): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$stream |
\Psr\Http\Message\StreamInterface |
public __construct(\Psr\Http\Message\StreamInterface $stream): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$stream |
\Psr\Http\Message\StreamInterface | Stream to decorate |
Magic method used to create a new stream if streams are not added in the constructor of a decorator (e.g., LazyOpenStream).
public __get(string $name): \Psr\Http\Message\StreamInterface
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string |
public __toString(): string
public getContents(): string
Allow decorators to implement custom methods
public __call(string $method, array $args): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$method |
string | |
$args |
array |
public close(): void
{@inheritdoc}
public getMetadata(mixed $key = null): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$key |
mixed |
public detach(): mixed
public getSize(): ?int
public eof(): bool
public tell(): int
public isReadable(): bool
public isWritable(): bool
public isSeekable(): bool
public rewind(): void
public seek(mixed $offset, mixed $whence = SEEK_SET): void
Parameters:
Parameter | Type | Description |
---|---|---|
$offset |
mixed | |
$whence |
mixed |
public read(mixed $length): string
Parameters:
Parameter | Type | Description |
---|---|---|
$length |
mixed |
public write(mixed $string): int
Parameters:
Parameter | Type | Description |
---|---|---|
$string |
mixed |
Implement in subclasses to dynamically create streams when requested.
protected createStream(): \Psr\Http\Message\StreamInterface