Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
|
Functions | |
__clone () | |
__construct (array $opts=array()) | |
Constructor. | |
__get ($name) | |
__serialize () | |
__set ($name, $value) | |
__toString () | |
String representation of object. | |
__unserialize ($data) | |
_init () | |
Initialization method. | |
add ($data, $reset=false) | |
Adds data to the stream. | |
close () | |
Close the stream. | |
end ($offset=0) | |
Move internal pointer to the end of the stream. | |
eof () | |
Has the end of the stream been reached? | |
getChar () | |
Return a character from the string. | |
getEOL () | |
Auto-determine the EOL string. | |
getString ($start=null, $end=null) | |
Returns the stream (or a portion of it) as a string. | |
getToChar ($end, $all=true) | |
Get a string up to a certain character (or EOF). | |
length ($utf8=false) | |
Returns the length of the data. | |
peek ($length=1) | |
Return the current character(s) without moving the pointer. | |
pos () | |
Return the current stream pointer position. | |
rewind () | |
Rewind the internal stream to the beginning. | |
search ($char, $reverse=false, $reset=true) | |
Search for character(s) and return its position. | |
seek ($offset=0, $curr=true, $char=false) | |
Move internal pointer. | |
serialize () | |
substring ($start=0, $length=null, $char=false) | |
Return part of the stream as a string. | |
unserialize ($data) | |
Variables | |
array | $_params |
Configuration parameters. | |
boolean | $_utf8_char = false |
Parse character as UTF-8 data instead of single byte. | |
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see | http |
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see | http |
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see | http |
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see | http |
*See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see | http |
$this | stream = $opts['stream'] |
$this | stream = Horde_Stream_Wrapper_String::getStream($opts['string']) |
__construct | ( | array | $opts = array() | ) |
Constructor.
array | $opts | Configuration options. |
__serialize | ( | ) |
array |
__toString | ( | ) |
String representation of object.
string | The full stream converted to a string. |
__unserialize | ( | $data | ) |
array | $data |
void |
|
protected |
Initialization method.
Horde_Stream_Exception |
add | ( | $data, | |
$reset = false ) |
Adds data to the stream.
mixed | $data | Data to add to the stream. Can be a resource, Horde_Stream object, or a string(-ish) value. |
boolean | $reset | Reset stream pointer to initial position after adding? |
close | ( | ) |
Close the stream.
end | ( | $offset = 0 | ) |
Move internal pointer to the end of the stream.
integer | $offset | Move this offset from the end. |
boolean | True if successful. |
eof | ( | ) |
Has the end of the stream been reached?
boolean | True if the end of the stream has been reached. |
getChar | ( | ) |
Return a character from the string.
string | Character (single byte, or UTF-8 character if $utf8_char is true). |
getEOL | ( | ) |
Auto-determine the EOL string.
string | The EOL string, or null if no EOL found. |
getString | ( | $start = null, | |
$end = null ) |
Returns the stream (or a portion of it) as a string.
Position values are the byte position in the stream.
integer | $start | The starting position. If positive, start from this position. If negative, starts this length back from the current position. If null, starts from the current position. |
integer | $end | The ending position relative to the beginning of the stream (if positive). If negative, end this length back from the end of the stream. If null, reads to the end of the stream. |
string | A string. |
getToChar | ( | $end, | |
$all = true ) |
Get a string up to a certain character (or EOF).
string | $end | The character to stop reading at. As of 1.4.0, $char can be a multi-character UTF-8 string. |
boolean | $all | If true, strips all repetitions of $end from the end. If false, stops at the first instance of $end. ( |
string | The string up to $end (stream is positioned after the end character(s), all of which are stripped from the return data). |
length | ( | $utf8 = false | ) |
Returns the length of the data.
Does not change the stream position.
boolean | $utf8 | If true, determines the UTF-8 length of the stream (as of 1.4.0). If false, determines the byte length of the stream. |
integer | Stream size. |
Horde_Stream_Exception |
peek | ( | $length = 1 | ) |
Return the current character(s) without moving the pointer.
integer | $length | The peek length (since 1.4.0). |
string | The current character. |
pos | ( | ) |
Return the current stream pointer position.
mixed | The current position (integer), or false. |
rewind | ( | ) |
Rewind the internal stream to the beginning.
boolean | True if successful. |
search | ( | $char, | |
$reverse = false, | |||
$reset = true ) |
Search for character(s) and return its position.
string | $char | The character to search for. As of 1.4.0, $char can be a multi-character UTF-8 string. |
boolean | $reverse | Do a reverse search? |
boolean | $reset | Reset the pointer to the original position? |
mixed | The start position of the search string (integer), or null if character not found. |
seek | ( | $offset = 0, | |
$curr = true, | |||
$char = false ) |
Move internal pointer.
integer | $offset | The offset. |
boolean | $curr | If true, offset is from current position. If false, offset is from beginning of stream. |
boolean | $char | If true, $offset is the length in characters. If false, $offset is the length in bytes. |
boolean | True if successful. |
substring | ( | $start = 0, | |
$length = null, | |||
$char = false ) |
Return part of the stream as a string.
integer | $start | Start, as an offset from the current postion. |
integer | $length | Length of string to return. If null, returns rest of the stream. If negative, this many characters will be omitted from the end of the stream. |
boolean | $char | If true, $start/$length is the length in characters. If false, $start/$length is the length in bytes. |
string | The substring. |