MediaWiki REL1_32
|
Static Public Member Functions | |
static | clearState ( $parser) |
static | expr ( $parser, $expr='') |
static & | getExprParser () |
static | ifeqObj ( $parser, $frame, $args) |
static | iferror ( $parser, $test='', $then='', $else=false) |
static | iferrorObj ( $parser, $frame, $args) |
static | ifexistCommon ( $parser, $frame, $titletext='', $then='', $else='') |
static | ifexistObj ( $parser, $frame, $args) |
static | ifexpr ( $parser, $expr='', $then='', $else='') |
static | ifexprObj ( $parser, $frame, $args) |
static | ifObj ( $parser, $frame, $args) |
static | localTime ( $parser, $format='', $date='', $language='') |
static | localTimeObj ( $parser, $frame, $args) |
static | registerClearHook () |
Register ParserClearState hook. | |
static | rel2abs ( $parser, $to='', $from='') |
Returns the absolute path to a subpage, relative to the current article title. | |
static | runCount ( $parser, $inStr='', $inSubStr='') |
{{#count: string | substr }} | |
static | runExplode ( $parser, $inStr='', $inDiv='', $inPos=0, $inLim=null) |
{{#explode:string | delimiter | position | limit}} | |
static | runLen ( $parser, $inStr='') |
{{#len:string}} | |
static | runPos ( $parser, $inStr='', $inNeedle='', $inOffset=0) |
{{#pos: string | needle | offset}} | |
static | runReplace ( $parser, $inStr='', $inReplaceFrom='', $inReplaceTo='', $inLimit=-1) |
{{replace:string | from | to | limit }} | |
static | runRPos ( $parser, $inStr='', $inNeedle='') |
{{#rpos: string | needle}} | |
static | runSub ( $parser, $inStr='', $inStart=0, $inLength=0) |
{{#sub: string | start | length }} | |
static | runUrlDecode ( $parser, $inStr='') |
{{#urldecode:string}} | |
static | switchObj ( $parser, $frame, $args) |
static | time ( $parser, $format='', $date='', $language='', $local=false) |
static | timeCommon ( $parser, $frame=null, $format='', $date='', $language='', $local=false) |
static | timeObj ( $parser, $frame, $args) |
static | titleparts ( $parser, $title='', $parts=0, $offset=0) |
Obtain a specified number of slash-separated parts of a title, e.g. | |
Static Public Attributes | |
static | $mExprParser |
static | $mMaxTimeChars = 6000 |
static | $mTimeCache = [] |
static | $mTimeChars = 0 |
Static Private Member Functions | |
static | checkLength ( $text) |
Verifies parameter is less than max string length. | |
static | decodeTrimExpand ( $obj, $frame, &$trimExpanded=null) |
Take a PPNode (-ish thing), expand it, remove entities, and trim. | |
static | tooLongError () |
Generates error message. | |
Definition at line 5 of file ExtParserFunctions.php.
|
staticprivate |
Verifies parameter is less than max string length.
string | $text |
Definition at line 598 of file ExtParserFunctions.php.
|
static |
|
staticprivate |
Take a PPNode (-ish thing), expand it, remove entities, and trim.
For use when doing string comparisions, where user expects entities to be equal for what they stand for (e.g. comparisions with {{PAGENAME}})
PPNode | string | $obj | Thing to expand |
PPFrame | $frame | |
string | &$trimExpanded | Expanded and trimmed version of PPNode, but with char refs intact |
Definition at line 893 of file ExtParserFunctions.php.
Referenced by ifeqObj(), and switchObj().
|
static |
Parser | $parser | |
string | $expr |
Definition at line 49 of file ExtParserFunctions.php.
References $e, and getExprParser().
|
static |
Definition at line 37 of file ExtParserFunctions.php.
References $mExprParser.
Referenced by Scribunto_LuaParserFunctionsLibrary\expr(), expr(), and ifexpr().
|
static |
Definition at line 118 of file ExtParserFunctions.php.
References $args, and decodeTrimExpand().
|
static |
Parser | $parser | |
string | $test | |
string | $then | |
bool | $else |
Definition at line 138 of file ExtParserFunctions.php.
Referenced by iferrorObj().
|
static |
|
static |
Definition at line 314 of file ExtParserFunctions.php.
References $parser, $wgContLang, NS_MEDIA, and wfFindFile().
Referenced by ifexistObj().
|
static |
Definition at line 380 of file ExtParserFunctions.php.
References $args, $parser, and ifexistCommon().
|
static |
Parser | $parser | |
string | $expr | |
string | $then | |
string | $else |
Definition at line 64 of file ExtParserFunctions.php.
References $e, $ret, and getExprParser().
Referenced by ifexprObj().
|
static |
|
static |
|
static |
Parser | $parser | |
string | $format | |
string | $date | |
string | $language |
Definition at line 543 of file ExtParserFunctions.php.
References $parser, and timeCommon().
|
static |
Definition at line 553 of file ExtParserFunctions.php.
References $args, $parser, and timeCommon().
|
static |
Register ParserClearState hook.
We defer this until needed to avoid the loading of the code of this file when no parser function is actually called.
Definition at line 25 of file ExtParserFunctions.php.
References $wgHooks.
Referenced by timeCommon().
|
static |
Returns the absolute path to a subpage, relative to the current article title.
Treats titles as slash-separated paths.
Following subpage link syntax instead of standard path syntax, an initial slash is treated as a relative path, and vice versa.
Parser | $parser | |
string | $to | |
string | $from |
Definition at line 250 of file ExtParserFunctions.php.
References $parser, and wfMessage().
|
static |
{{#count: string | substr }}
Returns number of occurrences of "substr" in "string".
Note: If "substr" is empty, a single space is used.
Parser | $parser | |
string | $inStr | |
string | $inSubStr |
Definition at line 738 of file ExtParserFunctions.php.
References $parser, $result, and tooLongError().
|
static |
{{#explode:string | delimiter | position | limit}}
Breaks "string" into chunks separated by "delimiter" and returns the chunk identified by "position".
Note: Negative position can be used to specify tokens from the end. Note: If the divider is an empty string, single space is used instead. Note: Empty string is returned if there are not enough exploded chunks.
Parser | $parser | |
string | $inStr | |
string | $inDiv | |
int | $inPos | |
int | null | $inLim |
Definition at line 834 of file ExtParserFunctions.php.
References $matches, $parser, $result, and tooLongError().
|
static |
{{#len:string}}
Reports number of characters in string.
Parser | $parser | |
string | $inStr |
Definition at line 621 of file ExtParserFunctions.php.
References $parser.
|
static |
{{#pos: string | needle | offset}}
Finds first occurrence of "needle" in "string" starting at "offset".
Note: If the needle is an empty string, single space is used instead. Note: If the needle is not found, empty string is returned.
Parser | $parser | |
string | $inStr | |
int | string | $inNeedle | |
int | $inOffset |
Definition at line 639 of file ExtParserFunctions.php.
References $parser, and tooLongError().
|
static |
{{replace:string | from | to | limit }}
Replaces each occurrence of "from" in "string" with "to". At most "limit" replacements are performed.
Note: Armored against replacements that would generate huge strings. Note: If "from" is an empty string, single space is used instead.
Parser | $parser | |
string | $inStr | |
string | $inReplaceFrom | |
string | $inReplaceTo | |
int | $inLimit |
Definition at line 771 of file ExtParserFunctions.php.
References $parser, $result, StringUtils\escapeRegexReplacement(), and tooLongError().
|
static |
{{#rpos: string | needle}}
Finds last occurrence of "needle" in "string".
Note: If the needle is an empty string, single space is used instead. Note: If the needle is not found, -1 is returned.
Parser | $parser | |
string | $inStr | |
int | string | $inNeedle |
Definition at line 672 of file ExtParserFunctions.php.
References $parser, and tooLongError().
|
static |
{{#sub: string | start | length }}
Returns substring of "string" starting at "start" and having "length" characters.
Note: If length is zero, the rest of the input is returned. Note: A negative value for "start" operates from the end of the "string". Note: A negative value for "length" returns a string reduced in length by that amount.
Parser | $parser | |
string | $inStr | |
int | $inStart | |
int | $inLength |
Definition at line 711 of file ExtParserFunctions.php.
References $parser, $result, and tooLongError().
|
static |
{{#urldecode:string}}
Decodes URL-encoded (like%20that) strings.
Parser | $parser | |
string | $inStr |
Definition at line 872 of file ExtParserFunctions.php.
References $parser, and tooLongError().
|
static |
Definition at line 175 of file ExtParserFunctions.php.
References $args, $parser, decodeTrimExpand(), and MagicWord\get().
|
static |
Parser | $parser | |
string | $format | |
string | $date | |
string | $language | |
string | bool | $local |
Definition at line 516 of file ExtParserFunctions.php.
References $parser, and timeCommon().
|
static |
Parser | $parser | |
PPFrame | null | $frame | |
string | $format | |
string | $date | |
string | $language | |
string | bool | $local |
Definition at line 402 of file ExtParserFunctions.php.
References $parser, $result, $wgLocaltimezone, registerClearHook(), StubObject\unstub(), and wfMessage().
Referenced by localTime(), localTimeObj(), time(), and timeObj().
|
static |
Definition at line 528 of file ExtParserFunctions.php.
References $args, $parser, and timeCommon().
|
static |
Obtain a specified number of slash-separated parts of a title, e.g.
{{titleparts:Hello/World|1}} => "Hello"
Parser | $parser | Parent parser |
string | $title | Title to split |
int | $parts | Number of parts to keep |
int | $offset | Offset starting at 1 |
Definition at line 570 of file ExtParserFunctions.php.
References $title.
|
staticprivate |
Generates error message.
Called when string is too long.
Definition at line 607 of file ExtParserFunctions.php.
References wfMessage().
Referenced by runCount(), runExplode(), runPos(), runReplace(), runRPos(), runSub(), and runUrlDecode().
|
static |
Definition at line 6 of file ExtParserFunctions.php.
Referenced by getExprParser().
|
static |
Definition at line 9 of file ExtParserFunctions.php.
|
static |
Definition at line 7 of file ExtParserFunctions.php.
|
static |
Definition at line 8 of file ExtParserFunctions.php.