createStreamFromFile()
createStreamFromFile(string $filename, string $mode = 'r') : \Psr\Http\Message\StreamInterface
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()
.
Parameters
string |
$filename |
Filename or stream URI to use as basis of stream.
|
string |
$mode |
Mode with which to open the underlying filename/stream.
|
Throws
- \RuntimeException
If the file cannot be opened.
- \InvalidArgumentException
If the mode is invalid.
Returns
\Psr\Http\Message\StreamInterface
—