MediaWiki
1.30.0
|
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 | bidi ( $parser, $text='') |
static | canonicalurl ( $parser, $s='', $arg=null) |
static | canonicalurle ( $parser, $s='', $arg=null) |
static | cascadingsources ( $parser, $title='') |
Returns the sources of any cascading protection acting on a specified page. More... | |
static | defaultsort ( $parser, $text, $uarg='') |
static | displaytitle ( $parser, $text='', $uarg='') |
Override the title of the page when viewed, provided we've been given a title which will normalise to the canonical title. More... | |
static | filepath ( $parser, $name='', $argA='', $argB='') |
Usage {{filepath|300}}, {{filepath|nowiki}}, {{filepath|nowiki|300}} or {{filepath|300|nowiki}} or {{filepath|300px}}, {{filepath|200x300px}}, {{filepath|nowiki|200x300px}}, {{filepath|200x300px|nowiki}}. More... | |
static | formatDate ( $parser, $date, $defaultPref=null) |
static | formatnum ( $parser, $num='', $arg=null) |
static | formatRaw ( $num, $raw, $language) |
Formats a number according to a language. More... | |
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. More... | |
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. More... | |
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 | pad ( $parser, $string, $length, $padding='0', $direction=STR_PAD_RIGHT) |
Unicode-safe str_pad with the restriction that $length is forced to be <= 500. More... | |
static | padleft ( $parser, $string='', $length=0, $padding='0') |
static | padright ( $parser, $string='', $length=0, $padding='0') |
static | pageid ( $parser, $title=null) |
Get the pageid of a specified page. More... | |
static | pagename ( $parser, $title=null) |
Functions to get and normalize pagenames, corresponding to the magic words of the same names. More... | |
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. More... | |
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. More... | |
static | plural ( $parser, $text='') |
static | protectionexpiry ( $parser, $type='', $title='') |
Returns the requested protection expiry for the current page. More... | |
static | protectionlevel ( $parser, $type='', $title='') |
Returns the requested protection level for the current page. More... | |
static | register ( $parser) |
static | revisionday ( $parser, $title=null) |
Get the day from the last revision of a specified page. More... | |
static | revisionday2 ( $parser, $title=null) |
Get the day with leading zeros from the last revision of a specified page. More... | |
static | revisionid ( $parser, $title=null) |
Get the id from the last revision of a specified page. More... | |
static | revisionmonth ( $parser, $title=null) |
Get the month with leading zeros from the last revision of a specified page. More... | |
static | revisionmonth1 ( $parser, $title=null) |
Get the month from the last revision of a specified page. More... | |
static | revisiontimestamp ( $parser, $title=null) |
Get the timestamp from the last revision of a specified page. More... | |
static | revisionuser ( $parser, $title=null) |
Get the user from the last revision of a specified page. More... | |
static | revisionyear ( $parser, $title=null) |
Get the year from the last revision of a specified page. More... | |
static | rootpagename ( $parser, $title=null) |
static | rootpagenamee ( $parser, $title=null) |
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. More... | |
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: (T24474) More... | |
static | urlFunction ( $func, $s='', $arg=null) |
Static Private Member Functions | |
static | getCachedRevisionObject ( $parser, $title=null) |
Fetched the current revision of the given title and return this. More... | |
static | matchAgainstMagicword ( $magicword, $value) |
Matches the given value against the value of given magic word. More... | |
Various core parser functions, registered in Parser::firstCallInit()
Definition at line 29 of file CoreParserFunctions.php.
|
static |
Parser | $parser | |
string | $text |
Definition at line 931 of file CoreParserFunctions.php.
References $parser.
|
static |
Definition at line 675 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 682 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), wfEscapeWikiText(), and wfUrlencode().
|
static |
Parser | $parser | |
string | $text |
Definition at line 376 of file CoreParserFunctions.php.
References $parser.
|
static |
Definition at line 254 of file CoreParserFunctions.php.
References $s, and urlFunction().
|
static |
Definition at line 258 of file CoreParserFunctions.php.
References $s, and urlFunction().
|
static |
Returns the sources of any cascading protection acting on a specified page.
Pages will not return their own title unless they transclude themselves. This is an expensive parser function and can't be called too many times per page, unless cascading protection sources for the page have already been loaded.
Parser | $parser | |
string | $title |
Definition at line 1328 of file CoreParserFunctions.php.
References $parser, $title, as, and Title\newFromText().
|
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 960 of file CoreParserFunctions.php.
References $magicWords, $parser, wfEscapeWikiText(), and wfMessage().
|
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 |
string | $uarg |
Definition at line 389 of file CoreParserFunctions.php.
References $magicWords, $params, $parser, $title, $wgRestrictDisplayTitle, global, Title\newFromText(), text, wfEscapeWikiText(), and wfMessage().
|
static |
Usage {{filepath|300}}, {{filepath|nowiki}}, {{filepath|nowiki|300}} or {{filepath|300|nowiki}} or {{filepath|300px}}, {{filepath|200x300px}}, {{filepath|nowiki|200x300px}}, {{filepath|200x300px|nowiki}}.
Parser | $parser | |
string | $name | |
string | $argA | |
string | $argB |
Definition at line 1001 of file CoreParserFunctions.php.
References $name, $parser, captcha-old\count, PROTO_RELATIVE, true, wfExpandUrl(), and wfFindFile().
|
static |
Parser | $parser | |
string | $date | |
string | $defaultPref |
Definition at line 119 of file CoreParserFunctions.php.
References $lang, $parser, and DateFormatter\getInstance().
|
static |
Parser | $parser | |
string | $num | |
string | $arg |
Definition at line 298 of file CoreParserFunctions.php.
References $parser.
|
static |
Formats a number according to a language.
int | float | $num | |
string | $raw | |
Language | StubUserLang | $language |
Definition at line 499 of file CoreParserFunctions.php.
Referenced by numberingroup(), numberofactiveusers(), numberofadmins(), numberofarticles(), numberofedits(), numberoffiles(), numberofpages(), numberofusers(), pagesincategory(), pagesinnamespace(), and pagesize().
|
static |
Definition at line 633 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 640 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 241 of file CoreParserFunctions.php.
References $s, and urlFunction().
|
static |
Definition at line 245 of file CoreParserFunctions.php.
References $s, and urlFunction().
|
static |
Parser | $parser | |
string | $username |
Definition at line 325 of file CoreParserFunctions.php.
References $parser, $ret, $title, $user, $username, captcha-old\count, User\getDefaultOption(), User\newFromName(), Title\newFromText(), and NS_USER.
|
staticprivate |
Fetched the current revision of the given title and return this.
Will increment the expensive function count and add a template link to get the value refreshed on changes. For a given title, which is equal to the current parser title, the revision object from the parser is used, when that is the current one
Parser | $parser | |
Title | $title |
Definition at line 1101 of file CoreParserFunctions.php.
References $parser, $rev, $title, and wfDebug().
Referenced by pagesize(), revisionday(), revisionday2(), revisionid(), revisionmonth(), revisionmonth1(), revisiontimestamp(), revisionuser(), and revisionyear().
|
static |
Parser | $parser | |
string | $case | |
string | $word |
Definition at line 315 of file CoreParserFunctions.php.
References $parser.
|
static |
Parser | $parser | |
string | $part1 |
Definition at line 96 of file CoreParserFunctions.php.
References $args, $parser, false, and wfMessage().
|
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 874 of file CoreParserFunctions.php.
References $code, $lang, Language\fetchLanguageName(), and wfBCP47().
|
static |
Parser | $parser | |
string | $s |
Definition at line 213 of file CoreParserFunctions.php.
References $parser, $s, $wgContLang, and global.
|
static |
Definition at line 198 of file CoreParserFunctions.php.
References $s, $wgContLang, and global.
|
static |
Definition at line 228 of file CoreParserFunctions.php.
References $s, and urlFunction().
|
static |
Definition at line 232 of file CoreParserFunctions.php.
References $s, and urlFunction().
|
staticprivate |
Matches the given value against the value of given magic word.
string | $magicword | Magic word key |
string | $value | Value to match |
Definition at line 482 of file CoreParserFunctions.php.
References $value, and MagicWord\get().
|
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.
Parser | $parser | |
string | $title |
Definition at line 562 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
|
static |
Definition at line 569 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfUrlencode().
|
static |
Definition at line 576 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
|
static |
Definition at line 137 of file CoreParserFunctions.php.
References $wgContLang, false, and global.
Referenced by TitleBlacklistEntry\newFromString(), and nse().
|
static |
Definition at line 151 of file CoreParserFunctions.php.
References $parser, $ret, ns(), and wfUrlencode().
|
static |
Definition at line 545 of file CoreParserFunctions.php.
References $name, $parser, formatRaw(), and SiteStats\numberingroup().
|
static |
Definition at line 514 of file CoreParserFunctions.php.
References $parser, SiteStats\activeUsers(), and formatRaw().
|
static |
Definition at line 526 of file CoreParserFunctions.php.
References $parser, formatRaw(), and SiteStats\numberingroup().
|
static |
Definition at line 518 of file CoreParserFunctions.php.
References $parser, SiteStats\articles(), and formatRaw().
|
static |
Definition at line 534 of file CoreParserFunctions.php.
References $parser, SiteStats\edits(), and formatRaw().
|
static |
Definition at line 522 of file CoreParserFunctions.php.
References $parser, formatRaw(), and SiteStats\images().
|
static |
Definition at line 507 of file CoreParserFunctions.php.
References $parser, formatRaw(), and SiteStats\pages().
|
static |
Definition at line 511 of file CoreParserFunctions.php.
References $parser, formatRaw(), and SiteStats\users().
|
static |
Unicode-safe str_pad with the restriction that $length is forced to be <= 500.
Parser | $parser | |
string | $string | |
int | $length | |
string | $padding | |
int | $direction |
Definition at line 890 of file CoreParserFunctions.php.
References $parser.
Referenced by padleft(), and padright().
|
static |
Definition at line 918 of file CoreParserFunctions.php.
|
static |
Definition at line 922 of file CoreParserFunctions.php.
|
static |
Get the pageid of a specified page.
Parser | $parser | |
string | $title | Title to get the pageid from |
Definition at line 1142 of file CoreParserFunctions.php.
References $parser, $t, $title, Title\newFromText(), and LinkCache\singleton().
|
static |
Functions to get and normalize pagenames, corresponding to the magic words of the same names.
Parser | $parser | |
string | $title |
Definition at line 619 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 626 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
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.
Parser | $parser | |
string | $name | |
string | $arg1 | |
string | $arg2 |
Definition at line 728 of file CoreParserFunctions.php.
References $cache, $magicWords, $name, $parser, $title, $type, $wgContLang, formatRaw(), global, Title\makeTitleSafe(), Category\newFromTitle(), NS_CATEGORY, and title.
|
static |
Definition at line 538 of file CoreParserFunctions.php.
References $parser, formatRaw(), and SiteStats\pagesInNs().
|
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.
Parser | $parser | |
string | $page | Name of page to check (Default: empty string) |
string | $raw | Should number be human readable with commas or just number |
Definition at line 795 of file CoreParserFunctions.php.
References $parser, $rev, $title, formatRaw(), getCachedRevisionObject(), and Title\newFromText().
|
static |
Parser | $parser | |
string | $text |
Definition at line 364 of file CoreParserFunctions.php.
References $parser.
|
static |
Returns the requested protection expiry for the current page.
This is an expensive parser function and can't be called too many times per page, unless the protection levels/expiries for the given title have already been retrieved
Parser | $parser | |
string | $type | |
string | $title |
Definition at line 850 of file CoreParserFunctions.php.
References $parser, $title, $type, and Title\newFromText().
|
static |
Returns the requested protection level for the current page.
This is an expensive parser function and can't be called too many times per page, unless the protection levels/expiries for the given title have already been retrieved
Parser | $parser | |
string | $type | |
string | $title |
Definition at line 824 of file CoreParserFunctions.php.
References $parser, $title, $type, and Title\newFromText().
|
static |
Parser | $parser |
Definition at line 34 of file CoreParserFunctions.php.
References $parser, $wgAllowDisplayTitle, $wgAllowSlowParserFunctions, as, global, SFH_NO_HASH, and SFH_OBJECT_ARGS.
|
static |
Get the day from the last revision of a specified page.
Parser | $parser | |
string | $title | Title to get the day from |
Definition at line 1204 of file CoreParserFunctions.php.
References $parser, $rev, $t, $title, format, getCachedRevisionObject(), MWTimestamp\getLocalInstance(), and Title\newFromText().
|
static |
Get the day with leading zeros from the last revision of a specified page.
Parser | $parser | |
string | $title | Title to get the day from |
Definition at line 1221 of file CoreParserFunctions.php.
References $parser, $rev, $t, $title, format, getCachedRevisionObject(), MWTimestamp\getLocalInstance(), and Title\newFromText().
|
static |
Get the id from the last revision of a specified page.
Parser | $parser | |
string | $title | Title to get the id from |
Definition at line 1187 of file CoreParserFunctions.php.
References $parser, $rev, $t, $title, getCachedRevisionObject(), and Title\newFromText().
|
static |
Get the month with leading zeros from the last revision of a specified page.
Parser | $parser | |
string | $title | Title to get the month from |
Definition at line 1238 of file CoreParserFunctions.php.
References $parser, $rev, $t, $title, format, getCachedRevisionObject(), MWTimestamp\getLocalInstance(), and Title\newFromText().
|
static |
Get the month from the last revision of a specified page.
Parser | $parser | |
string | $title | Title to get the month from |
Definition at line 1255 of file CoreParserFunctions.php.
References $parser, $rev, $t, $title, format, getCachedRevisionObject(), MWTimestamp\getLocalInstance(), and Title\newFromText().
|
static |
Get the timestamp from the last revision of a specified page.
Parser | $parser | |
string | $title | Title to get the timestamp from |
Definition at line 1289 of file CoreParserFunctions.php.
References $parser, $rev, $t, $title, format, getCachedRevisionObject(), MWTimestamp\getLocalInstance(), and Title\newFromText().
|
static |
Get the user from the last revision of a specified page.
Parser | $parser | |
string | $title | Title to get the user from |
Definition at line 1306 of file CoreParserFunctions.php.
References $parser, $rev, $t, $title, getCachedRevisionObject(), and Title\newFromText().
|
static |
Get the year from the last revision of a specified page.
Parser | $parser | |
string | $title | Title to get the year from |
Definition at line 1272 of file CoreParserFunctions.php.
References $parser, $rev, $t, $title, format, getCachedRevisionObject(), MWTimestamp\getLocalInstance(), and Title\newFromText().
|
static |
Definition at line 661 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 668 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), wfEscapeWikiText(), and wfUrlencode().
|
static |
Definition at line 936 of file CoreParserFunctions.php.
References $parser, $title, SpecialPage\getTitleFor(), list, Title\makeTitleSafe(), NS_SPECIAL, and SpecialPageFactory\resolveAlias().
|
static |
Definition at line 948 of file CoreParserFunctions.php.
References $parser, and wfUrlencode().
|
static |
Definition at line 703 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 710 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 597 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
|
static |
Definition at line 604 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfUrlencode().
|
static |
Definition at line 647 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 654 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Parser function to extension tag adaptor.
Definition at line 1042 of file CoreParserFunctions.php.
References $args, $name, $params, $parser, $value, as, captcha-old\count, and PPFrame\STRIP_COMMENTS.
|
static |
Definition at line 689 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 696 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 583 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
|
static |
Definition at line 590 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfUrlencode().
|
static |
Parser | $parser | |
string | $s |
Definition at line 223 of file CoreParserFunctions.php.
References $parser, $s, $wgContLang, and global.
|
static |
Definition at line 203 of file CoreParserFunctions.php.
References $s, $wgContLang, and global.
|
static |
urlencodes a string according to one of three patterns: (T24474)
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 | |
string | $s | The text to encode. |
string | $arg | (optional): The type of encoding. |
Definition at line 171 of file CoreParserFunctions.php.
References $magicWords, $parser, and $s.
|
static |
Definition at line 267 of file CoreParserFunctions.php.
References $s, $title, false, Title\makeTitle(), Title\newFromText(), Title\newFromURL(), NS_FILE, and NS_MEDIA.
Referenced by canonicalurl(), canonicalurle(), fullurl(), fullurle(), localurl(), and localurle().