SDK for PHP 3.x

StreamWrapper
in package

FinalYes

Converts Guzzle streams into PHP stream resources.

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

Table of Contents

Properties

$context  : resource

Methods

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{dev: int, ino: int, mode: int, nlink: int, uid: int, gid: int, rdev: int, size: int, atime: int, mtime: int, ctime: int, blksize: int, blocks: int}|false
stream_tell()  : int
stream_write()  : int
url_stat()  : array{dev: int, ino: int, mode: int, nlink: int, uid: int, gid: int, rdev: int, size: int, atime: int, mtime: int, ctime: int, blksize: int, blocks: int}

Properties

$context

public resource $context

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

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|null &$opened_path = null ]) : bool
Parameters
$path : string
$mode : string
$options : int
$opened_path : string|null = 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{dev: int, ino: int, mode: int, nlink: int, uid: int, gid: int, rdev: int, size: int, atime: int, mtime: int, ctime: int, blksize: int, blocks: int}|false
Return values
array{dev: int, ino: int, mode: int, nlink: int, uid: int, gid: int, rdev: int, size: int, atime: int, mtime: int, ctime: int, blksize: int, blocks: int}|false

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{dev: int, ino: int, mode: int, nlink: int, uid: int, gid: int, rdev: int, size: int, atime: int, mtime: int, ctime: int, blksize: int, blocks: int}
Parameters
$path : string
$flags : int
Return values
array{dev: int, ino: int, mode: int, nlink: int, uid: int, gid: int, rdev: int, size: int, atime: int, mtime: int, ctime: int, blksize: int, blocks: int}
On this page