Documentation

StreamWrapper
in package

Converts Guzzle streams into PHP stream resources.

Tags
see
https://www.php.net/streamwrapper

Table of Contents

$context  : resource
$mode  : string
$stream  : StreamInterface
createStreamContext()  : resource
Creates a stream context that can be used to open a stream as a php stream resource.
getResource()  : resource
Returns a resource representing the stream.
register()  : void
Registers the stream wrapper if needed
stream_cast()  : resource|false
stream_eof()  : bool
stream_open()  : bool
stream_read()  : string
stream_seek()  : bool
stream_stat()  : array<int|string, int>
stream_tell()  : int
stream_write()  : int
url_stat()  : array<int|string, int>

Properties

Methods

createStreamContext()

Creates a stream context that can be used to open a stream as a php stream resource.

public static createStreamContext(StreamInterface $stream) : resource
Parameters
$stream : StreamInterface
Return values
resource

getResource()

Returns a resource representing the stream.

public static getResource(StreamInterface $stream) : resource
Parameters
$stream : StreamInterface

The stream to get a resource for

Tags
throws
InvalidArgumentException

if stream is not readable or writable

Return values
resource

register()

Registers the stream wrapper if needed

public static register() : void
Return values
void

stream_cast()

public stream_cast(int $cast_as) : resource|false
Parameters
$cast_as : int
Return values
resource|false

stream_eof()

public stream_eof() : bool
Return values
bool

stream_open()

public stream_open(string $path, string $mode, int $options[, string &$opened_path = null ]) : bool
Parameters
$path : string
$mode : string
$options : int
$opened_path : string = null
Return values
bool

stream_read()

public stream_read(int $count) : string
Parameters
$count : int
Return values
string

stream_seek()

public stream_seek(int $offset, int $whence) : bool
Parameters
$offset : int
$whence : int
Return values
bool

stream_stat()

public stream_stat() : array<int|string, int>
Return values
array<int|string, int>

stream_tell()

public stream_tell() : int
Return values
int

stream_write()

public stream_write(string $data) : int
Parameters
$data : string
Return values
int

url_stat()

public url_stat(string $path, int $flags) : array<int|string, int>
Parameters
$path : string
$flags : int
Return values
array<int|string, int>

Search results