function StreamFactoryInterface::createStreamFromFile
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.:
Return value
Throws
\RuntimeException If the file cannot be opened.
\InvalidArgumentException If the mode is invalid.
2 methods override StreamFactoryInterface::createStreamFromFile()
- HttpFactory::createStreamFromFile in vendor/
guzzlehttp/ psr7/ src/ HttpFactory.php - Create a stream from an existing file.
- Psr17Factory::createStreamFromFile in vendor/
php-http/ discovery/ src/ Psr17Factory.php - Create a stream from an existing file.
File
-
vendor/
psr/ http-factory/ src/ StreamFactoryInterface.php, line 33
Class
Namespace
Psr\Http\MessageCode
public function createStreamFromFile(string $filename, string $mode = 'r') : StreamInterface;