Documentation

InflateStream
in package
implements StreamInterface uses StreamDecoratorTrait

FinalYes

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.

Tags
see
https://datatracker.ietf.org/doc/html/rfc1950
https://datatracker.ietf.org/doc/html/rfc1952
https://www.php.net/manual/en/filters.compression.php

Table of Contents

Interfaces

StreamInterface
Describes a data stream.

Properties

$source  : StreamInterface|null
$stream  : StreamInterface

Methods

__call()  : mixed
Allow decorators to implement custom methods
__construct()  : mixed
__get()  : StreamInterface
Magic method used to create a new stream if streams are not added in the constructor of a decorator (e.g., LazyOpenStream).
__toString()  : string
close()  : void
Closes the stream and any underlying resources.
detach()  : resource|null
Separates any underlying resources from the stream.
eof()  : bool
getContents()  : string
getMetadata()  : mixed
getSize()  : int|null
isReadable()  : bool
isSeekable()  : bool
isWritable()  : bool
read()  : string
rewind()  : void
seek()  : void
Seek to a position in the stream.
tell()  : int
write()  : int
createStream()  : StreamInterface
Implement in subclasses to dynamically create streams when requested.
inflate()  : Stream

Properties

Methods

__call()

Allow decorators to implement custom methods

public __call(string $method, array<string|int, mixed> $args) : mixed
Parameters
$method : string
$args : array<string|int, mixed>

close()

Closes the stream and any underlying resources.

public close() : void

detach()

Separates any underlying resources from the stream.

public detach() : resource|null

After the stream has been detached, the stream is in an unusable state.

Return values
resource|null —

Underlying PHP stream, if any

getMetadata()

public getMetadata([mixed $key = null ]) : mixed
Parameters
$key : mixed = null

read()

public read(mixed $length) : string
Parameters
$length : mixed
Return values
string

seek()

Seek to a position in the stream.

public seek(mixed $offset[, mixed $whence = SEEK_SET ]) : void
Parameters
$offset : mixed

Stream offset

$whence : mixed = SEEK_SET

Specifies how the cursor position will be calculated based on the seek offset. Valid values are identical to the built-in PHP $whence values for fseek(). SEEK_SET: Set position equal to offset bytes SEEK_CUR: Set position to current location plus offset SEEK_END: Set position to end-of-stream plus offset.

write()

public write(mixed $string) : int
Parameters
$string : mixed
Return values
int
On this page

Search results