StringWrapper
in package
A stream wrapper that will treat a native PHP string as a stream.
Tags
Table of Contents
Constants
- WRAPPER_NAME = 'horde-stream-wrapper-string'
Properties
- $context : resource
- The current context.
- $pos : int
- String position.
- $string : string
- The string.
- $id : int
- Unique ID tracker for the streams.
Methods
- getStream() : resource|false
- Create a stream from a PHP string.
- stream_close() : void
- stream_eof() : bool
- stream_open() : bool
- stream_read() : string
- stream_seek() : bool
- stream_stat() : array<string|int, int>
- stream_tell() : int
- stream_write() : int
Constants
WRAPPER_NAME
public
mixed
WRAPPER_NAME
= 'horde-stream-wrapper-string'
Properties
$context
The current context.
public
resource
$context
$pos
String position.
protected
int
$pos
$string
The string.
protected
string
$string
$id
Unique ID tracker for the streams.
private
static int
$id
= 0
Methods
getStream()
Create a stream from a PHP string.
public
static getStream(string &$string) : resource|false
Parameters
- $string : string
-
A PHP string variable.
Tags
Return values
resource|false —A PHP stream pointing to the variable.
stream_close()
public
stream_close() : void
Tags
stream_eof()
public
stream_eof() : bool
Tags
Return values
boolstream_open()
public
stream_open(string $path, string $mode, int $options, string|null &$opened_path) : bool
Parameters
- $path : string
- $mode : string
- $options : int
- $opened_path : string|null
Tags
Return values
boolstream_read()
public
stream_read(int $count) : string
Parameters
- $count : int
Tags
Return values
stringstream_seek()
public
stream_seek(int $offset[, int $whence = SEEK_SET ]) : bool
Parameters
- $offset : int
- $whence : int = SEEK_SET
Tags
Return values
boolstream_stat()
public
stream_stat() : array<string|int, int>
Tags
Return values
array<string|int, int>stream_tell()
public
stream_tell() : int
Tags
Return values
intstream_write()
public
stream_write(string $data) : int
Parameters
- $data : string