MediaWiki REL1_34
|
Public Member Functions | |
__construct ( $engine) | |
register () | |
Called to register the library. | |
ustringByteoffset ( $s, $l=1, $i=1) | |
Handler for byteoffset. | |
ustringChar () | |
Handler for char. | |
ustringCodepoint ( $s, $i=1, $j=null) | |
Handler for codepoint. | |
ustringFind ( $s, $pattern, $init=1, $plain=false) | |
Handler for find. | |
ustringGcodepointInit ( $s, $i=1, $j=null) | |
Handler for gcodepointInit. | |
ustringGmatchCallback ( $s, $re, $capt, $pos) | |
Handler for gmatchCallback. | |
ustringGmatchInit ( $s, $pattern) | |
Handler for gmatchInit. | |
ustringGsub ( $s, $pattern, $repl, $n=null) | |
Handler for gsub. | |
ustringIsUtf8 ( $s) | |
Handler for isUtf8. | |
ustringLen ( $s) | |
Handler for len. | |
ustringLower ( $s) | |
Handler for lower. | |
ustringMatch ( $s, $pattern, $init=1) | |
Handler for match. | |
ustringSub ( $s, $i=1, $j=-1) | |
Handler for sub. | |
ustringToNFC ( $s) | |
Handler for toNFC. | |
ustringToNFD ( $s) | |
Handler for toNFD. | |
ustringToNFKC ( $s) | |
Handler for toNFKC. | |
ustringToNFKD ( $s) | |
Handler for toNFKD. | |
ustringUpper ( $s) | |
Handler for upper. | |
Public Member Functions inherited from Scribunto_LuaLibraryBase | |
__construct (Scribunto_LuaEngine $engine) | |
incrementExpensiveFunctionCount () | |
Increment the expensive function count, and throw if limit exceeded. | |
Private Member Functions | |
addCapturesFromMatch ( $arr, $s, $m, $capt, $m0_if_no_captures) | |
bracketedCharSetToRegex ( $pat, $i, $len, $brcharsets) | |
checkPattern ( $name, $pattern) | |
checkString ( $name, $s, $checkEncoding=true) | |
handlePCREError ( $error, $pattern) | |
Handle a PCRE error. | |
patternToRegex ( $pattern, $anchor, $name) | |
Private Attributes | |
integer | $patternLengthLimit = 10000 |
Limit on pattern lengths, in bytes not characters. | |
MapCacheLRU | $patternRegexCache = null |
A cache of patterns and the regexes they generate. | |
boolean | $phpBug53823 = false |
PHP until 5.6.9 are buggy when the regex in preg_replace an preg_match_all matches the empty string. | |
integer null | $stringLengthLimit = null |
Limit on string lengths, in bytes not characters If null, $wgMaxArticleSize * 1024 will be used. | |
Additional Inherited Members | |
Protected Member Functions inherited from Scribunto_LuaLibraryBase | |
checkType ( $name, $argIdx, $arg, $expectType) | |
Check the type of a variable. | |
checkTypeOptional ( $name, $argIdx, &$arg, $expectType, $default) | |
Check the type of a variable, with default if null. | |
getEngine () | |
Get the engine. | |
getInterpreter () | |
Get the interpreter. | |
getLuaType ( $var) | |
Get the Lua type corresponding to the type of the variable. | |
getParser () | |
Get the parser. | |
getParserOptions () | |
Get the parser options. | |
getTitle () | |
Get the title. | |
Definition at line 5 of file UstringLibrary.php.
Scribunto_LuaUstringLibrary::__construct | ( | $engine | ) |
Definition at line 32 of file UstringLibrary.php.
References Scribunto_LuaLibraryBase\$engine, and $wgMaxArticleSize.
|
private |
Definition at line 591 of file UstringLibrary.php.
References $s.
Referenced by ustringFind(), ustringGmatchCallback(), ustringGsub(), and ustringMatch().
|
private |
Definition at line 541 of file UstringLibrary.php.
Referenced by patternToRegex().
|
private |
Definition at line 338 of file UstringLibrary.php.
References Scribunto_LuaLibraryBase\checkType(), and Scribunto_LuaLibraryBase\getLuaType().
Referenced by patternToRegex(), and ustringFind().
|
private |
Definition at line 85 of file UstringLibrary.php.
References $s, Scribunto_LuaLibraryBase\checkType(), and Scribunto_LuaLibraryBase\getLuaType().
Referenced by ustringByteoffset(), ustringCodepoint(), ustringFind(), ustringGmatchInit(), ustringGsub(), ustringIsUtf8(), ustringLen(), ustringLower(), ustringMatch(), ustringSub(), ustringToNFC(), ustringToNFD(), ustringToNFKC(), ustringToNFKD(), and ustringUpper().
|
private |
Handle a PCRE error.
int | $error | From preg_last_error() |
string | $pattern | Pattern being matched |
Scribunto_LuaError |
Definition at line 882 of file UstringLibrary.php.
Referenced by ustringGsub().
|
private |
Definition at line 354 of file UstringLibrary.php.
References bracketedCharSetToRegex(), checkPattern(), and serialize().
Referenced by ustringFind(), ustringGmatchInit(), ustringGsub(), and ustringMatch().
Scribunto_LuaUstringLibrary::register | ( | ) |
Called to register the library.
This should do any necessary setup and then call $this->getEngine()->registerInterface(). The value returned by that call should be returned from this function, and must be for 'deferLoad' libraries to work right.
Reimplemented from Scribunto_LuaLibraryBase.
Definition at line 44 of file UstringLibrary.php.
References Scribunto_LuaLibraryBase\getEngine().
Scribunto_LuaUstringLibrary::ustringByteoffset | ( | $s, | |
$l = 1, | |||
$i = 1 ) |
Handler for byteoffset.
Definition at line 120 of file UstringLibrary.php.
References $s, checkString(), and Scribunto_LuaLibraryBase\checkTypeOptional().
Scribunto_LuaUstringLibrary::ustringChar | ( | ) |
Handler for char.
Definition at line 250 of file UstringLibrary.php.
References $args, $s, and Scribunto_LuaLibraryBase\checkType().
Scribunto_LuaUstringLibrary::ustringCodepoint | ( | $s, | |
$i = 1, | |||
$j = null ) |
Handler for codepoint.
Definition at line 156 of file UstringLibrary.php.
References $s, checkString(), and Scribunto_LuaLibraryBase\checkTypeOptional().
Referenced by ustringGcodepointInit().
Scribunto_LuaUstringLibrary::ustringFind | ( | $s, | |
$pattern, | |||
$init = 1, | |||
$plain = false ) |
Handler for find.
Definition at line 616 of file UstringLibrary.php.
References $s, addCapturesFromMatch(), checkPattern(), checkString(), Scribunto_LuaLibraryBase\checkTypeOptional(), and patternToRegex().
Scribunto_LuaUstringLibrary::ustringGcodepointInit | ( | $s, | |
$i = 1, | |||
$j = null ) |
Handler for gcodepointInit.
Definition at line 185 of file UstringLibrary.php.
References $s, and ustringCodepoint().
Scribunto_LuaUstringLibrary::ustringGmatchCallback | ( | $s, | |
$re, | |||
$capt, | |||
$pos ) |
Handler for gmatchCallback.
Definition at line 712 of file UstringLibrary.php.
References $s, and addCapturesFromMatch().
Scribunto_LuaUstringLibrary::ustringGmatchInit | ( | $s, | |
$pattern ) |
Handler for gmatchInit.
Definition at line 696 of file UstringLibrary.php.
References $s, checkString(), and patternToRegex().
Scribunto_LuaUstringLibrary::ustringGsub | ( | $s, | |
$pattern, | |||
$repl, | |||
$n = null ) |
Handler for gsub.
Definition at line 729 of file UstringLibrary.php.
References $args, $s, $type, addCapturesFromMatch(), checkString(), Scribunto_LuaLibraryBase\checkType(), Scribunto_LuaLibraryBase\checkTypeOptional(), Scribunto_LuaLibraryBase\getInterpreter(), Scribunto_LuaLibraryBase\getLuaType(), handlePCREError(), and patternToRegex().
Scribunto_LuaUstringLibrary::ustringIsUtf8 | ( | $s | ) |
Handler for isUtf8.
Definition at line 107 of file UstringLibrary.php.
References $s, and checkString().
Scribunto_LuaUstringLibrary::ustringLen | ( | $s | ) |
Handler for len.
Definition at line 279 of file UstringLibrary.php.
References $s, and checkString().
Scribunto_LuaUstringLibrary::ustringLower | ( | $s | ) |
Handler for lower.
Definition at line 333 of file UstringLibrary.php.
References $s, and checkString().
Scribunto_LuaUstringLibrary::ustringMatch | ( | $s, | |
$pattern, | |||
$init = 1 ) |
Handler for match.
Definition at line 666 of file UstringLibrary.php.
References $s, addCapturesFromMatch(), checkString(), Scribunto_LuaLibraryBase\checkTypeOptional(), and patternToRegex().
Scribunto_LuaUstringLibrary::ustringSub | ( | $s, | |
$i = 1, | |||
$j = -1 ) |
Handler for sub.
Definition at line 295 of file UstringLibrary.php.
References $s, checkString(), and Scribunto_LuaLibraryBase\checkTypeOptional().
Scribunto_LuaUstringLibrary::ustringToNFC | ( | $s | ) |
Handler for toNFC.
Definition at line 195 of file UstringLibrary.php.
References $s, and checkString().
Scribunto_LuaUstringLibrary::ustringToNFD | ( | $s | ) |
Handler for toNFD.
Definition at line 209 of file UstringLibrary.php.
References $s, and checkString().
Scribunto_LuaUstringLibrary::ustringToNFKC | ( | $s | ) |
Handler for toNFKC.
Definition at line 223 of file UstringLibrary.php.
References $s, and checkString().
Scribunto_LuaUstringLibrary::ustringToNFKD | ( | $s | ) |
Handler for toNFKD.
Definition at line 237 of file UstringLibrary.php.
References $s, and checkString().
Scribunto_LuaUstringLibrary::ustringUpper | ( | $s | ) |
Handler for upper.
Definition at line 322 of file UstringLibrary.php.
References $s, and checkString().
|
private |
Limit on pattern lengths, in bytes not characters.
Definition at line 10 of file UstringLibrary.php.
|
private |
A cache of patterns and the regexes they generate.
Definition at line 30 of file UstringLibrary.php.
|
private |
PHP until 5.6.9 are buggy when the regex in preg_replace an preg_match_all matches the empty string.
Definition at line 24 of file UstringLibrary.php.
|
private |
Limit on string lengths, in bytes not characters If null, $wgMaxArticleSize * 1024 will be used.
Definition at line 17 of file UstringLibrary.php.