-
Notifications
You must be signed in to change notification settings - Fork 1
StreamFactory: createStreamFromFile Example
Terry L edited this page Jun 18, 2020
·
4 revisions
-
param
stringfilename*The filename or stream URI to use as basis of stream. -
param
stringmoderThe mode with which to open the underlying filename/stream. -
return
StreamInterface
Example:
$sourceFile = BOOTSTRAP_DIR . '/sample/shieldon_logo.png';
$streamFactory = new StreamFactory();
$stream = $streamFactory->createStreamFromFile($sourceFile);
echo $stream->getSize();
// Outputs: 15166composer require shieldon/psr-httpShieldon PSR HTTP implementation written by Terry L. from Taiwan.
