Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
|
Functions | |
__construct ( $data) | |
Constructor. | |
__construct (&$string) | |
Constructor. | |
__construct () | |
Constructor. | |
__get ($key) | |
__isset ($key) | |
Checks the existance of $key in this array. | |
__set ($key, $value) | |
__unset ($key) | |
Removes $key from this array. | |
_andition ($string) | |
_directReplacements ($string) | |
easy/direct replacements | |
_fractionalAddition ($string) | |
_getRealOffset ($offset) | |
Determines the actual array offset given the input offset. | |
_hideAHalf ($string) | |
take the 'a' out so it doesn't turn into a 1, save the half for the end | |
_replaceBigPrefixes ($string) | |
hundreds, thousands, millions, etc. | |
_replaceTenPrefixes ($string) | |
ten, twenty, etc. | |
_splitHyphenatedWords ($string) | |
will mutilate hyphenated-words but shouldn't matter for date extraction | |
_splitHyphenateWords ($string) | |
will mutilate hyphenated-words but shouldn't matter for date extraction | |
camelize ($word, $firstLetter='upper') | |
Camel-cases a word. | |
classify ($tableName) | |
Creates a class name from a table name like Rails does for table names to models. | |
clear () | |
Clear out the array. | |
clearCache () | |
Clears the inflection cache. | |
count () | |
Count the number of elements. | |
dasherize ($underscoredWord) | |
Replaces underscores with dashes in the string. | |
demodulize ($classNameInModule) | |
Removes the module part from the expression in the string. | |
fopen () | |
Return a stream handle to this stream. | |
foreignKey ($className, $separateClassNameAndIdWithUnderscore=true) | |
Creates a foreign key name from a class name. | |
get ($key, $default=null) | |
getCache ($word, $rule) | |
Retuns a cached inflection. | |
getData () | |
Return a reference to the data. | |
getFileObject () | |
Return an SplFileObject representing this stream. | |
getIterator () | |
getKeys () | |
Get the keys in the array. | |
getOrSet ($offset, $default=null) | |
Gets the value at $offset. | |
& | getString () |
Return a reference to the wrapped string. | |
getValues () | |
Get the values in the array. | |
humanize ($lowerCaseAndUnderscoredWord) | |
Capitalizes the first word and turns underscores into spaces and strips _id. | |
installWrapper () | |
Install the horde-combine stream wrapper if it isn't already registered. | |
numerize ( $string) | |
Rules: | |
offsetExists ($offset) | |
Checks the existence of $offset in this array. | |
offsetGet ($offset) | |
Gets the value of $offset in this array. | |
offsetSet ($offset, $value) | |
Sets the value of $offset to $value. | |
offsetUnset ($offset) | |
Removes $offset from this array. | |
ordinalize ($number) | |
Turns a number into an ordinal string used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th. | |
pluralize ($word) | |
Singular English word to pluralize. | |
pop ($offset, $default=null) | |
Gets the value at $offset and deletes it from the array. | |
pop () | |
Pop the latest tracker and return the difference with the current memory situation. | |
push () | |
Push a new tracker on the stack. | |
setCache ($word, $rule, $value) | |
Caches an inflection. | |
singularize ($word) | |
Plural English word to singularize. | |
tableize ($className) | |
Creates the name of a table like Rails does for models to table names. | |
titleize ($word) | |
Capitalizes all the words and replaces some characters in the string to create a nicer looking title. | |
uncountable ($word) | |
Adds an uncountable word. | |
underscore ($camelCasedWord) | |
The reverse of camelize(). | |
update ($array) | |
Update the array with the key/value pairs from $array. | |
Variables | |
integer | $_idx = 0 |
Current index for stacked trackers. | |
array | $_pluralizationRules |
Rules for pluralizing English nouns. | |
array | $_singularizationRules |
Rules for singularizing English nouns. | |
string | $_string |
String data. | |
array | $_uncountables |
An array of words with the same singular and plural spellings. | |
$BIG_PREFIXES | |
$BIG_PREFIXES | |
$BIG_PREFIXES | |
* | $elapsed = $t->pop() |
**< code > * | $id = (string)new Horde_Support_Randomid() |
*< code > * | $t = new Horde_Support_Memory |
*< code > * | $t = new Horde_Support_Timer |
*author Chuck Hagenbuch< chuck @horde.org > *license | $TEN_PREFIXES |
*author Chuck Hagenbuch< chuck @horde.org > *author Jan Schneider< jan @horde.org > *license | $TEN_PREFIXES |
*license | $TEN_PREFIXES |
*< code > * | $uid = (string)new Horde_Support_Guid([$opts = array()]) |
* | $used = $t->pop() |
*< code > * | $uuid = (string)new Horde_Support_Uuid |
*todo Incorporate stuff from Horde_Array | Countable |
*category Horde *copyright Horde LLC *license | Countable |
*</code > **Do not expect too much of this memory tracker Profiling memory is not *trivial as your placement of the measurements may obscure important *information As a trivial | example |
*todo Incorporate stuff from Horde_Array * | http |
*See the enclosed file LICENSE for license information(BSD). If you *did not receive this file see | http |
*author Michael Slusarz< slusarz @horde.org > *license | http |
*category Horde *ingroup Support *license | http |
*author Chuck Hagenbuch< chuck @horde.org > *license | http |
*author Chuck Hagenbuch< chuck @horde.org > *license | http |
*author Chuck Hagenbuch< chuck @horde.org > *author Jan Schneider< jan @horde.org > *license | http |
*license | http |
*author Chuck Hagenbuch< chuck @horde.org > *category Horde *license | http |
*category Horde *copyright Horde LLC *license | http |
*todo Incorporate stuff from Horde_Array | IteratorAggregate |
*and also the original | paper |
__construct | ( | $data | ) |
Constructor.
array | $data | An array of strings and/or streams to combine into a single stream. |
__construct | ( | & | $string | ) |
Constructor.
string | &$string | Reference to the string to wrap as a stream |
__construct | ( | ) |
Constructor.
Stores a map of the uncountable words for quicker checks.
|
protected |
Determines the actual array offset given the input offset.
string | $offset | Input offset. |
string | Real offset or null. |
camelize | ( | $word, | |
$firstLetter = 'upper' ) |
Camel-cases a word.
string | $word | The word to camel-case. |
string | $firstLetter | Whether to upper or lower case the first. letter of each slash-separated section. |
string | Camelized $word |
classify | ( | $tableName | ) |
Creates a class name from a table name like Rails does for table names to models.
Examples:
count | ( | ) |
Count the number of elements.
integer |
dasherize | ( | $underscoredWord | ) |
Replaces underscores with dashes in the string.
Example:
demodulize | ( | $classNameInModule | ) |
Removes the module part from the expression in the string.
Examples:
fopen | ( | ) |
Return a stream handle to this stream.
Return a stream handle to this string stream.
resource |
foreignKey | ( | $className, | |
$separateClassNameAndIdWithUnderscore = true ) |
Creates a foreign key name from a class name.
$separateClassNameAndIdWithUnderscore sets whether the method should put '_' between the name and 'id'.
Examples:
getCache | ( | $word, | |
$rule ) |
Retuns a cached inflection.
string | | false |
getData | ( | ) |
Return a reference to the data.
array |
getFileObject | ( | ) |
Return an SplFileObject representing this stream.
Return an SplFileObject representing this string stream.
SplFileObject |
getKeys | ( | ) |
Get the keys in the array.
array |
getOrSet | ( | $offset, | |
$default = null ) |
Gets the value at $offset.
If no value exists at that offset, or the value $offset is NULL, then $default is set as the value of $offset.
string | $offset | Offset to retrieve and set if unset |
string | $default | Default value if $offset does not exist |
mixed | Value at $offset or $default |
& getString | ( | ) |
Return a reference to the wrapped string.
string |
getValues | ( | ) |
Get the values in the array.
array |
humanize | ( | $lowerCaseAndUnderscoredWord | ) |
Capitalizes the first word and turns underscores into spaces and strips _id.
Like titleize(), this is meant for creating pretty output.
Examples:
installWrapper | ( | ) |
Install the horde-combine stream wrapper if it isn't already registered.
Install the stream wrapper if it isn't already registered.
Exception |
numerize | ( | $string | ) |
Rules:
offsetExists | ( | $offset | ) |
Checks the existence of $offset in this array.
offsetGet | ( | $offset | ) |
Gets the value of $offset in this array.
offsetSet | ( | $offset, | |
$value ) |
Sets the value of $offset to $value.
offsetUnset | ( | $offset | ) |
Removes $offset from this array.
ordinalize | ( | $number | ) |
Turns a number into an ordinal string used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th.
Examples:
pluralize | ( | $word | ) |
Singular English word to pluralize.
string | $word | Word to pluralize. |
string | Plural form of $word. |
pop | ( | $offset, | |
$default = null ) |
Gets the value at $offset and deletes it from the array.
If no value exists at $offset, or the value at $offset is null, then $default will be returned.
string | $offset | Offset to pop |
string | $default | Default value |
mixed | Value at $offset or $default |
pop | ( | ) |
Pop the latest tracker and return the difference with the current memory situation.
array | The change in memory allocated via emalloc() in between the push() and the pop() call. The array holds four values: the first one indicates the change in current usage of memory while the second value indicates any changes in the peak amount of memory used. The third and fourth value show current and peak usage as well but indicate the real memory usage and not just the part allocated via emalloc(), |
setCache | ( | $word, | |
$rule, | |||
$value ) |
Caches an inflection.
string | $word | The word being inflected. |
string | $rule | The inflection rule. |
string | $value | The inflected value of $word. |
string | The inflected value |
singularize | ( | $word | ) |
Plural English word to singularize.
string | $word | Word to singularize. |
string | Singular form of $word. |
tableize | ( | $className | ) |
Creates the name of a table like Rails does for models to table names.
This method uses the pluralize() method on the last word in the string.
Examples:
titleize | ( | $word | ) |
Capitalizes all the words and replaces some characters in the string to create a nicer looking title.
Titleize is meant for creating pretty output.
See:
Examples:
uncountable | ( | $word | ) |
Adds an uncountable word.
string | $word | The uncountable word. |
underscore | ( | $camelCasedWord | ) |
The reverse of camelize().
Makes an underscored form from the expression in the string.
Examples:
underscore("ActiveRecord_Errors") => "active_record_errors"
update | ( | $array | ) |
Update the array with the key/value pairs from $array.
array | $array | Key/value pairs to set/change in the array. |
|
protected |
Rules for pluralizing English nouns.
|
protected |
An array of words with the same singular and plural spellings.
$BIG_PREFIXES |
$BIG_PREFIXES |
$BIG_PREFIXES |
* author Chuck Hagenbuch<chuck@horde.org>* license $TEN_PREFIXES |
* author Chuck Hagenbuch<chuck@horde.org>* author Jan Schneider<jan@horde.org>* license $TEN_PREFIXES |
* license $TEN_PREFIXES |
* todo Incorporate stuff from Horde_Array IteratorAggregate |