|
MediaWiki
REL1_21
|
Various core parser functions, registered in Parser::firstCallInit() More...
Static Public Member Functions | |
| static | anchorencode ($parser, $text) |
| static | basepagename ($parser, $title=null) |
| static | basepagenamee ($parser, $title=null) |
| static | canonicalurl ($parser, $s= '', $arg=null) |
| static | canonicalurle ($parser, $s= '', $arg=null) |
| static | defaultsort ($parser, $text, $uarg= '') |
| static | displaytitle ($parser, $text= '') |
| Override the title of the page when viewed, provided we've been given a title which will normalise to the canonical title. | |
| static | filepath ($parser, $name= '', $argA= '', $argB= '') |
| static | formatDate ($parser, $date, $defaultPref=null) |
| static | formatnum ($parser, $num= '', $arg=null) |
| static | formatRaw ($num, $raw) |
| static | fullpagename ($parser, $title=null) |
| static | fullpagenamee ($parser, $title=null) |
| static | fullurl ($parser, $s= '', $arg=null) |
| static | fullurle ($parser, $s= '', $arg=null) |
| static | gender ($parser, $username) |
| static | grammar ($parser, $case= '', $word= '') |
| static | intFunction ($parser, $part1= '') |
| static | language ($parser, $code= '', $inLanguage= '') |
| Gives language names. | |
| static | lc ($parser, $s= '') |
| static | lcfirst ($parser, $s= '') |
| static | localurl ($parser, $s= '', $arg=null) |
| static | localurle ($parser, $s= '', $arg=null) |
| static | mwnamespace ($parser, $title=null) |
| Given a title, return the namespace name that would be given by the corresponding magic word Note: function name changed to "mwnamespace" rather than "namespace" to not break PHP 5.3. | |
| static | namespacee ($parser, $title=null) |
| static | namespacenumber ($parser, $title=null) |
| static | ns ($parser, $part1= '') |
| static | nse ($parser, $part1= '') |
| static | numberingroup ($parser, $name= '', $raw=null) |
| static | numberofactiveusers ($parser, $raw=null) |
| static | numberofadmins ($parser, $raw=null) |
| static | numberofarticles ($parser, $raw=null) |
| static | numberofedits ($parser, $raw=null) |
| static | numberoffiles ($parser, $raw=null) |
| static | numberofpages ($parser, $raw=null) |
| static | numberofusers ($parser, $raw=null) |
| static | numberofviews ($parser, $raw=null) |
| static | pad ($parser, $string, $length, $padding= '0', $direction=STR_PAD_RIGHT) |
| Unicode-safe str_pad with the restriction that $length is forced to be <= 500. | |
| static | padleft ($parser, $string= '', $length=0, $padding= '0') |
| static | padright ($parser, $string= '', $length=0, $padding= '0') |
| static | pagename ($parser, $title=null) |
| Functions to get and normalize pagenames, corresponding to the magic words of the same names. | |
| static | pagenamee ($parser, $title=null) |
| static | pagesincategory ($parser, $name= '', $arg1=null, $arg2=null) |
| Return the number of pages, files or subcats in the given category, or 0 if it's nonexistent. | |
| static | pagesinnamespace ($parser, $namespace=0, $raw=null) |
| static | pagesize ($parser, $page= '', $raw=null) |
| Return the size of the given page, or 0 if it's nonexistent. | |
| static | plural ($parser, $text= '') |
| static | protectionlevel ($parser, $type= '', $title= '') |
| Returns the requested protection level for the current page. | |
| static | register ($parser) |
| static | special ($parser, $text) |
| static | speciale ($parser, $text) |
| static | subjectpagename ($parser, $title=null) |
| static | subjectpagenamee ($parser, $title=null) |
| static | subjectspace ($parser, $title=null) |
| static | subjectspacee ($parser, $title=null) |
| static | subpagename ($parser, $title=null) |
| static | subpagenamee ($parser, $title=null) |
| static | tagObj ($parser, $frame, $args) |
| Parser function to extension tag adaptor. | |
| static | talkpagename ($parser, $title=null) |
| static | talkpagenamee ($parser, $title=null) |
| static | talkspace ($parser, $title=null) |
| static | talkspacee ($parser, $title=null) |
| static | uc ($parser, $s= '') |
| static | ucfirst ($parser, $s= '') |
| static | urlencode ($parser, $s= '', $arg=null) |
| urlencodes a string according to one of three patterns: (bug 22474) | |
| static | urlFunction ($func, $s= '', $arg=null) |
Static Private Member Functions | |
| static | matchAgainstMagicword ($magicword, $value) |
| Matches the given value against the value of given magic word. | |
Various core parser functions, registered in Parser::firstCallInit()
Definition at line 28 of file CoreParserFunctions.php.
| static CoreParserFunctions::anchorencode | ( | $ | parser, |
| $ | text | ||
| ) | [static] |
| $parser | Parser |
| $text |
Definition at line 754 of file CoreParserFunctions.php.
References $parser.
| static CoreParserFunctions::basepagename | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 536 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::basepagenamee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 542 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::canonicalurl | ( | $ | parser, |
| $ | s = '', |
||
| $ | arg = null |
||
| ) | [static] |
Definition at line 242 of file CoreParserFunctions.php.
References $s, and urlFunction().
| static CoreParserFunctions::canonicalurle | ( | $ | parser, |
| $ | s = '', |
||
| $ | arg = null |
||
| ) | [static] |
Definition at line 243 of file CoreParserFunctions.php.
References $s, and urlFunction().
| static CoreParserFunctions::defaultsort | ( | $ | parser, |
| $ | text, | ||
| $ | uarg = '' |
||
| ) | [static] |
| $parser | Parser | |
| string | $text | The sortkey to use |
| string | $uarg | Either "noreplace" or "noerror" (in en) both suppress errors, and noreplace does nothing if a default sortkey already exists. |
Definition at line 781 of file CoreParserFunctions.php.
References $magicWords, $parser, array(), and wfMessage().
| static CoreParserFunctions::displaytitle | ( | $ | parser, |
| $ | text = '' |
||
| ) | [static] |
Override the title of the page when viewed, provided we've been given a title which will normalise to the canonical title.
| $parser | Parser: parent parser | |
| string | $text | desired title text |
Definition at line 359 of file CoreParserFunctions.php.
References $parser, $title, array(), global, Parser\MARKER_SUFFIX, Title\newFromText(), Sanitizer\normalizeCharReferences(), Sanitizer\removeHTMLtags(), and Sanitizer\stripAllTags().
| static CoreParserFunctions::filepath | ( | $ | parser, |
| $ | name = '', |
||
| $ | argA = '', |
||
| $ | argB = '' |
||
| ) | [static] |
Definition at line 807 of file CoreParserFunctions.php.
References $file, $name, $parser, $url, array(), wfExpandUrl(), and wfFindFile().
| static CoreParserFunctions::formatDate | ( | $ | parser, |
| $ | date, | ||
| $ | defaultPref = null |
||
| ) | [static] |
| $parser | Parser | |
| $date | ||
| null | $defaultPref |
Definition at line 131 of file CoreParserFunctions.php.
References $parser, array(), and DateFormatter\getInstance().
| static CoreParserFunctions::formatnum | ( | $ | parser, |
| $ | num = '', |
||
| $ | arg = null |
||
| ) | [static] |
| $parser | Parser | |
| string | $num | |
| string | $arg |
Definition at line 275 of file CoreParserFunctions.php.
| static CoreParserFunctions::formatRaw | ( | $ | num, |
| $ | raw | ||
| ) | [static] |
Definition at line 406 of file CoreParserFunctions.php.
References $wgContLang, and global.
Referenced by numberingroup(), numberofactiveusers(), numberofadmins(), numberofarticles(), numberofedits(), numberoffiles(), numberofpages(), numberofusers(), numberofviews(), pagesincategory(), pagesinnamespace(), and pagesize().
| static CoreParserFunctions::fullpagename | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 512 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::fullpagenamee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 518 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::fullurl | ( | $ | parser, |
| $ | s = '', |
||
| $ | arg = null |
||
| ) | [static] |
Definition at line 240 of file CoreParserFunctions.php.
References $s, and urlFunction().
| static CoreParserFunctions::fullurle | ( | $ | parser, |
| $ | s = '', |
||
| $ | arg = null |
||
| ) | [static] |
Definition at line 241 of file CoreParserFunctions.php.
References $s, and urlFunction().
| static CoreParserFunctions::gender | ( | $ | parser, |
| $ | username | ||
| ) | [static] |
| $parser | Parser |
| $username | string |
Definition at line 302 of file CoreParserFunctions.php.
References $parser, $ret, $title, $user, User\getDefaultOption(), User\newFromName(), Title\newFromText(), GenderCache\singleton(), wfProfileIn(), and wfProfileOut().
| static CoreParserFunctions::grammar | ( | $ | parser, |
| $ | case = '', |
||
| $ | word = '' |
||
| ) | [static] |
| $parser | Parser | |
| string | $case | |
| string | $word |
Definition at line 292 of file CoreParserFunctions.php.
References $parser.
| static CoreParserFunctions::intFunction | ( | $ | parser, |
| $ | part1 = '' |
||
| ) | [static] |
| $parser | Parser | |
| string | $part1 |
Definition at line 115 of file CoreParserFunctions.php.
References $parser, array(), and wfMessage().
| static CoreParserFunctions::language | ( | $ | parser, |
| $ | code = '', |
||
| $ | inLanguage = '' |
||
| ) | [static] |
Gives language names.
| $parser | Parser | |
| string | $code | Language code (of which to get name) |
| string | $inLanguage | Language code (in which to get name) |
Definition at line 706 of file CoreParserFunctions.php.
References Language\fetchLanguageName(), and wfBCP47().
| static CoreParserFunctions::lc | ( | $ | parser, |
| $ | s = '' |
||
| ) | [static] |
| $parser | Parser | |
| string | $s |
Definition at line 223 of file CoreParserFunctions.php.
References $parser, $s, $wgContLang, array(), and global.
| static CoreParserFunctions::lcfirst | ( | $ | parser, |
| $ | s = '' |
||
| ) | [static] |
Definition at line 208 of file CoreParserFunctions.php.
References $s, $wgContLang, and global.
| static CoreParserFunctions::localurl | ( | $ | parser, |
| $ | s = '', |
||
| $ | arg = null |
||
| ) | [static] |
Definition at line 238 of file CoreParserFunctions.php.
References $s, and urlFunction().
| static CoreParserFunctions::localurle | ( | $ | parser, |
| $ | s = '', |
||
| $ | arg = null |
||
| ) | [static] |
Definition at line 239 of file CoreParserFunctions.php.
References $s, and urlFunction().
| static CoreParserFunctions::matchAgainstMagicword | ( | $ | magicword, |
| $ | value | ||
| ) | [static, private] |
Matches the given value against the value of given magic word.
| string | $magicword | magic word key |
| mixed | $value | value to match |
Definition at line 398 of file CoreParserFunctions.php.
References $value, and MagicWord\get().
| static CoreParserFunctions::mwnamespace | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Given a title, return the namespace name that would be given by the corresponding magic word Note: function name changed to "mwnamespace" rather than "namespace" to not break PHP 5.3.
Definition at line 452 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
| static CoreParserFunctions::namespacee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 458 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfUrlencode().
| static CoreParserFunctions::namespacenumber | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 464 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
| static CoreParserFunctions::ns | ( | $ | parser, |
| $ | part1 = '' |
||
| ) | [static] |
Definition at line 148 of file CoreParserFunctions.php.
References $wgContLang, array(), and global.
Referenced by nse().
| static CoreParserFunctions::nse | ( | $ | parser, |
| $ | part1 = '' |
||
| ) | [static] |
Definition at line 162 of file CoreParserFunctions.php.
References $parser, $ret, ns(), and wfUrlencode().
| static CoreParserFunctions::numberingroup | ( | $ | parser, |
| $ | name = '', |
||
| $ | raw = null |
||
| ) | [static] |
Definition at line 441 of file CoreParserFunctions.php.
References $name, formatRaw(), and SiteStats\numberingroup().
| static CoreParserFunctions::numberofactiveusers | ( | $ | parser, |
| $ | raw = null |
||
| ) | [static] |
Definition at line 420 of file CoreParserFunctions.php.
References SiteStats\activeUsers(), and formatRaw().
| static CoreParserFunctions::numberofadmins | ( | $ | parser, |
| $ | raw = null |
||
| ) | [static] |
Definition at line 429 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\numberingroup().
| static CoreParserFunctions::numberofarticles | ( | $ | parser, |
| $ | raw = null |
||
| ) | [static] |
Definition at line 423 of file CoreParserFunctions.php.
References SiteStats\articles(), and formatRaw().
| static CoreParserFunctions::numberofedits | ( | $ | parser, |
| $ | raw = null |
||
| ) | [static] |
Definition at line 432 of file CoreParserFunctions.php.
References SiteStats\edits(), and formatRaw().
| static CoreParserFunctions::numberoffiles | ( | $ | parser, |
| $ | raw = null |
||
| ) | [static] |
Definition at line 426 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\images().
| static CoreParserFunctions::numberofpages | ( | $ | parser, |
| $ | raw = null |
||
| ) | [static] |
Definition at line 414 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\pages().
| static CoreParserFunctions::numberofusers | ( | $ | parser, |
| $ | raw = null |
||
| ) | [static] |
Definition at line 417 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\users().
| static CoreParserFunctions::numberofviews | ( | $ | parser, |
| $ | raw = null |
||
| ) | [static] |
Definition at line 435 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\views().
| static CoreParserFunctions::pad | ( | $ | parser, |
| $ | string, | ||
| $ | length, | ||
| $ | padding = '0', |
||
| $ | direction = STR_PAD_RIGHT |
||
| ) | [static] |
Unicode-safe str_pad with the restriction that $length is forced to be <= 500.
Definition at line 717 of file CoreParserFunctions.php.
References $parser.
Referenced by padleft(), and padright().
| static CoreParserFunctions::padleft | ( | $ | parser, |
| $ | string = '', |
||
| $ | length = 0, |
||
| $ | padding = '0' |
||
| ) | [static] |
Definition at line 741 of file CoreParserFunctions.php.
| static CoreParserFunctions::padright | ( | $ | parser, |
| $ | string = '', |
||
| $ | length = 0, |
||
| $ | padding = '0' |
||
| ) | [static] |
Definition at line 745 of file CoreParserFunctions.php.
| static CoreParserFunctions::pagename | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Functions to get and normalize pagenames, corresponding to the magic words of the same names.
Definition at line 500 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::pagenamee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 506 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::pagesincategory | ( | $ | parser, |
| $ | name = '', |
||
| $ | arg1 = null, |
||
| $ | arg2 = null |
||
| ) | [static] |
Return the number of pages, files or subcats in the given category, or 0 if it's nonexistent.
This is an expensive parser function and can't be called too many times per page.
Definition at line 579 of file CoreParserFunctions.php.
References $cache, $count, $magicWords, $name, $parser, $title, array(), formatRaw(), Title\makeTitleSafe(), Category\newFromTitle(), and title.
| static CoreParserFunctions::pagesinnamespace | ( | $ | parser, |
| $ | namespace = 0, |
||
| $ | raw = null |
||
| ) | [static] |
Definition at line 438 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\pagesInNs().
| static CoreParserFunctions::pagesize | ( | $ | parser, |
| $ | page = '', |
||
| $ | raw = null |
||
| ) | [static] |
Return the size of the given page, or 0 if it's nonexistent.
This is an expensive parser function and can't be called too many times per page.
FIXME: This doesn't work correctly on preview for getting the size of the current page.
FIXME: Title::getLength() documentation claims that it adds things to the link cache, so the local cache here should be unnecessary, but in fact calling getLength() repeatedly for the same $page does seem to run one query for each call?
Document parameters
| $parser | Parser | |
| string | $page | TODO DOCUMENT (Default: empty string) |
| $raw | TODO DOCUMENT (Default: null) |
Definition at line 652 of file CoreParserFunctions.php.
References $cache, $page, $parser, $rev, $title, array(), formatRaw(), Title\newFromText(), Revision\newFromTitle(), and IDBAccessObject\READ_NORMAL.
| static CoreParserFunctions::plural | ( | $ | parser, |
| $ | text = '' |
||
| ) | [static] |
| $parser | Parser | |
| string | $text |
Definition at line 344 of file CoreParserFunctions.php.
References $parser.
| static CoreParserFunctions::protectionlevel | ( | $ | parser, |
| $ | type = '', |
||
| $ | title = '' |
||
| ) | [static] |
Returns the requested protection level for the current page.
| Parser | $parser | |
| string | $type | |
| string | $title |
Definition at line 688 of file CoreParserFunctions.php.
References $parser, $title, and Title\newFromText().
| static CoreParserFunctions::register | ( | $ | parser | ) | [static] |
| $parser | Parser |
Definition at line 33 of file CoreParserFunctions.php.
References $parser, array(), and global.
Referenced by Parser_LinkHooks\firstCallInit().
| static CoreParserFunctions::special | ( | $ | parser, |
| $ | text | ||
| ) | [static] |
Definition at line 759 of file CoreParserFunctions.php.
References $page, $title, SpecialPage\getTitleFor(), list, SpecialPageFactory\resolveAlias(), and wfMessage().
| static CoreParserFunctions::speciale | ( | $ | parser, |
| $ | text | ||
| ) | [static] |
Definition at line 769 of file CoreParserFunctions.php.
References $parser, and wfUrlencode().
| static CoreParserFunctions::subjectpagename | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 560 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::subjectpagenamee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 566 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::subjectspace | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 482 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
| static CoreParserFunctions::subjectspacee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 488 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfUrlencode().
| static CoreParserFunctions::subpagename | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 524 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::subpagenamee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 530 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::tagObj | ( | $ | parser, |
| $ | frame, | ||
| $ | args | ||
| ) | [static] |
Parser function to extension tag adaptor.
Definition at line 845 of file CoreParserFunctions.php.
References $name, $params, $parser, $value, array(), as, PPFrame\STRIP_COMMENTS, and wfMessage().
| static CoreParserFunctions::talkpagename | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 548 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::talkpagenamee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 554 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::talkspace | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 470 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
| static CoreParserFunctions::talkspacee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 476 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfUrlencode().
| static CoreParserFunctions::uc | ( | $ | parser, |
| $ | s = '' |
||
| ) | [static] |
| $parser | Parser | |
| string | $s |
Definition at line 233 of file CoreParserFunctions.php.
References $parser, $s, $wgContLang, array(), and global.
| static CoreParserFunctions::ucfirst | ( | $ | parser, |
| $ | s = '' |
||
| ) | [static] |
Definition at line 213 of file CoreParserFunctions.php.
References $s, $wgContLang, and global.
| static CoreParserFunctions::urlencode | ( | $ | parser, |
| $ | s = '', |
||
| $ | arg = null |
||
| ) | [static] |
urlencodes a string according to one of three patterns: (bug 22474)
By default (for HTTP "query" strings), spaces are encoded as '+'. Or to encode a value for the HTTP "path", spaces are encoded as '%20'. For links to "wiki"s, or similar software, spaces are encoded as '_',
| $parser | Parser object | |
| string | $s | The text to encode. |
| string | $arg | (optional): The type of encoding. |
Definition at line 182 of file CoreParserFunctions.php.
References $magicWords, $parser, $s, and array().
| static CoreParserFunctions::urlFunction | ( | $ | func, |
| $ | s = '', |
||
| $ | arg = null |
||
| ) | [static] |
Definition at line 245 of file CoreParserFunctions.php.
References $s, $title, array(), Title\makeTitle(), Title\newFromText(), and Title\newFromURL().
Referenced by canonicalurl(), canonicalurle(), fullurl(), fullurle(), localurl(), and localurle().