class StreamManager (View source)

Traits

SingletonTrait

Methods

StreamInterface
create(mixed $input, string $mode = 'r')

Create a StreamInterface from any supported kind of input.

StreamInterface
createFromResource(resource $resource)

Create StreamInterface object from stream resource

StreamInterface
createFileStream(string $filename, string $mode = 'r')

Create a StreamInterface object from any stream URI or file path

resource
getStreamResource(StreamInterface $stream)

No description

Details

StreamInterface create(mixed $input, string $mode = 'r')

Create a StreamInterface from any supported kind of input.

Parameters

mixed $input Anything that can be a internal resource for a Stream.
string $mode Stream open mode (for string input)

Return Value

StreamInterface

Exceptions

InvalidArgumentException

StreamInterface createFromResource(resource $resource)

Create StreamInterface object from stream resource

Parameters

resource $resource Stream resource

Return Value

StreamInterface

Exceptions

InvalidArgumentException

StreamInterface createFileStream(string $filename, string $mode = 'r')

Create a StreamInterface object from any stream URI or file path

Parameters

string $filename File path or stream URI
string $mode File mode flags

Return Value

StreamInterface

Exceptions

RuntimeException

resource getStreamResource(StreamInterface $stream)

Parameters

StreamInterface $stream PSR-7 Stream

Return Value

resource