class StreamWrapper (View source)

Wraps PSR-7 Stream to a regular PHP stream resource using the PHP streamWriter protocol

Largely inspired by the Guzzle StreamWrapper class.

Constants

WRAPPER_SCHEME

WRAPPER_URI

Properties

resource $context

Methods

__construct()

No description

bool
stream_open(string $path, string $mode, int $options, string $unused_opened_path = null)

No description

string
stream_read(int $count)

No description

int
stream_write(string $data)

No description

int
stream_tell()

No description

bool
stream_eof()

No description

bool
stream_seek(int $offset, int $whence)

No description

boolean|resource|false
stream_cast(int $cast_as)

No description

array
stream_stat()

No description

array
url_stat(string $path, int $flags)

No description

Details

__construct()

bool stream_open(string $path, string $mode, int $options, string $unused_opened_path = null)

Parameters

string $path
string $mode Open mode flags
int $options
string $unused_opened_path

Return Value

bool

string stream_read(int $count)

Parameters

int $count Numberytes to read

Return Value

string Read data

int stream_write(string $data)

Parameters

string $data Bytes to write

Return Value

int Number of bytes written

int stream_tell()

Return Value

int Stream cursor position

bool stream_eof()

Return Value

bool TRUE if stream cursor is at end of stream

bool stream_seek(int $offset, int $whence)

Parameters

int $offset Movement offset
int $whence Movement starting point

Return Value

bool

boolean|resource|false stream_cast(int $cast_as)

Parameters

int $cast_as

Return Value

boolean|resource|false

array stream_stat()

Return Value

array int>

array url_stat(string $path, int $flags)

Parameters

string $path
int $flags

Return Value

array