StreamFactory
class StreamFactory (View source)
Has the ability to create streams for requests and responses.
Methods
StreamInterface
createStream(string $content = '')
Create a new stream from a string.
StreamInterface
createStreamFromFile(string $filename, string $mode = 'r')
Create a stream from an existing file.
StreamInterface
createStreamFromResource(resource $resource)
Create a new stream from an existing resource.
Details
at line 33
StreamInterface
createStream(string $content = '')
Create a new stream from a string.
The stream SHOULD be created with a temporary resource.
at line 53
StreamInterface
createStreamFromFile(string $filename, string $mode = 'r')
Create a stream from an existing file.
The file MUST be opened using the given mode, which may be any mode
supported by the fopen
function.
The $filename
MAY be any string supported by fopen()
.
at line 67
StreamInterface
createStreamFromResource(resource $resource)
Create a new stream from an existing resource.
The stream MUST be readable and may be writable.