phasync\Psr\ResourceStream class

Documentation

A PSR-7 StreamInterface which maps directly to a PHP stream resource.

This implementation integrates with phasync for read and write operations

Inheritance

Implements: Psr\Http\Message\StreamInterface Stringable

Properties (4)

protected bool $closed

True if the stream resource has been closed.

protected bool $detached

True if the stream resource has been detached.

protected mixed $resource

The stream resource or null if detached or closed.

private ?string $mode

Used to override the apparent mode of this stream resource.

Methods (17)

Construct a PSR compliant stream resource which integrates

Reinitialize the stream resource.

Reads all data from the stream into a string, from the beginning to end.

Closes the stream and any underlying resources.

Separates any underlying resources from the stream.

Get the size of the stream if known.

Returns the current position of the file read/write pointer

Returns true if the stream is at the end of the stream.

Returns whether or not the stream is seekable.

Seek to a position in the stream.

Seek to the beginning of the stream.

Returns whether or not the stream is writable.

Write data to the stream.

Returns whether or not the stream is readable.

Read data from the stream.

Returns the remaining contents in a string

Get stream metadata as an associative array or retrieve a specific key.

Source

src/Psr/ResourceStream.php:14-377