MediaWiki
master
|
Various core parser functions, registered in every Parser. 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, MagicWordFactory $magicWordFactory=null) |
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,... $forms) |
static | grammar ( $parser, $case='', $word='') |
static | intFunction ( $parser, $part1='',... $params) |
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. 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='', $arg2='') |
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='',... $forms) |
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 $parser, ServiceOptions $options) |
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) |
Public Attributes | |
const | REGISTER_OPTIONS |
Various core parser functions, registered in every Parser.
Definition at line 37 of file CoreParserFunctions.php.
|
static |
Parser | $parser | |
string | $text |
Definition at line 1029 of file CoreParserFunctions.php.
References Parser\guessSectionNameFromWikiText(), Parser\killMarkers(), and Sanitizer\safeEncodeAttribute().
|
static |
Definition at line 765 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 773 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), wfEscapeWikiText(), and wfUrlencode().
|
static |
Parser | $parser | |
string | $text |
Definition at line 421 of file CoreParserFunctions.php.
References Parser\getFunctionLang().
|
static |
Definition at line 265 of file CoreParserFunctions.php.
References $s, and urlFunction().
|
static |
Definition at line 269 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 1481 of file CoreParserFunctions.php.
References $title, Parser\getTitle(), Parser\incrementExpensiveFunctionCount(), and Title\newFromText().
Referenced by CoreMagicVariables\expand().
|
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 1060 of file CoreParserFunctions.php.
References $magicWords, Parser\getMagicWordFactory(), Parser\getOutput(), Parser\getTargetLanguageConverter(), 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 434 of file CoreParserFunctions.php.
References $magicWords, $title, Parser\addTrackingCategory(), Sanitizer\checkCss(), Sanitizer\decodeCharReferencesAndNormalize(), Parser\doQuotes(), Parser\getMagicWordFactory(), Parser\getOutput(), Parser\getTargetLanguageConverter(), Parser\getTitle(), Parser\killMarkers(), Title\newFromText(), Message\plaintextParam(), Sanitizer\removeSomeTags(), Sanitizer\stripAllTags(), 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 1102 of file CoreParserFunctions.php.
References $file, Parser\parseWidthParam(), PROTO_RELATIVE, true, and wfExpandUrl().
|
static |
Parser | $parser | |
string | $date | |
string | null | $defaultPref |
Definition at line 134 of file CoreParserFunctions.php.
References $lang, Parser\getFunctionLang(), and Parser\getOptions().
|
static |
Parser | $parser | |
string | $num | |
string | null | $arg |
Definition at line 309 of file CoreParserFunctions.php.
References Parser\getFunctionLang(), Parser\getMagicWordFactory(), and Parser\markerSkipCallback().
|
static |
Formats a number according to a language.
int | float | $num | |
string | $raw | |
Language | StubUserLang | $language | |
MagicWordFactory | null | $magicWordFactory | To evaluate $raw |
Definition at line 553 of file CoreParserFunctions.php.
Referenced by numberingroup(), numberofactiveusers(), numberofadmins(), numberofarticles(), numberofedits(), numberoffiles(), numberofpages(), numberofusers(), pagesincategory(), pagesinnamespace(), and pagesize().
|
static |
Definition at line 717 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 725 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 252 of file CoreParserFunctions.php.
References $s, and urlFunction().
|
static |
Definition at line 256 of file CoreParserFunctions.php.
References $s, and urlFunction().
|
static |
Parser | $parser | |
string | $username | |
string | ...$forms What to output for each gender |
Definition at line 371 of file CoreParserFunctions.php.
|
static |
Parser | $parser | |
string | $case | |
string | $word |
Definition at line 360 of file CoreParserFunctions.php.
References Parser\getFunctionLang(), and Parser\killMarkers().
|
static |
Parser | $parser | |
string | $part1 | Message key |
mixed | ...$params To pass to wfMessage() |
Definition at line 117 of file CoreParserFunctions.php.
References Parser\getOptions(), 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 965 of file CoreParserFunctions.php.
References $lang, and LanguageCode\bcp47().
|
static |
Parser | $parser | |
string | $s |
Definition at line 226 of file CoreParserFunctions.php.
References $s, Parser\getContentLanguage(), and Parser\markerSkipCallback().
|
static |
Definition at line 213 of file CoreParserFunctions.php.
References $s, and Parser\getContentLanguage().
|
static |
Definition at line 239 of file CoreParserFunctions.php.
References $s, and urlFunction().
|
static |
Definition at line 243 of file CoreParserFunctions.php.
References $s, and urlFunction().
|
static |
Given a title, return the namespace name that would be given by the corresponding magic word.
namespace
parser function and magic variable, but namespace
was a reserved word before PHP 7. Parser | $parser | |
string | null | $title |
Definition at line 641 of file CoreParserFunctions.php.
References $title, and wfDeprecated().
|
static |
Definition at line 646 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfUrlencode().
|
static |
Definition at line 654 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
|
static |
Definition at line 152 of file CoreParserFunctions.php.
References Parser\getContentLanguage().
Referenced by nse().
|
static |
Definition at line 165 of file CoreParserFunctions.php.
References ns(), and wfUrlencode().
|
static |
Definition at line 607 of file CoreParserFunctions.php.
References formatRaw(), Parser\getFunctionLang(), and SiteStats\numberingroup().
|
static |
Definition at line 575 of file CoreParserFunctions.php.
References SiteStats\activeUsers(), formatRaw(), and Parser\getFunctionLang().
|
static |
Definition at line 587 of file CoreParserFunctions.php.
References formatRaw(), Parser\getFunctionLang(), and SiteStats\numberingroup().
|
static |
Definition at line 579 of file CoreParserFunctions.php.
References SiteStats\articles(), formatRaw(), and Parser\getFunctionLang().
|
static |
Definition at line 595 of file CoreParserFunctions.php.
References SiteStats\edits(), formatRaw(), and Parser\getFunctionLang().
|
static |
Definition at line 583 of file CoreParserFunctions.php.
References formatRaw(), Parser\getFunctionLang(), and SiteStats\images().
|
static |
Definition at line 567 of file CoreParserFunctions.php.
References formatRaw(), Parser\getFunctionLang(), and SiteStats\pages().
|
static |
Definition at line 571 of file CoreParserFunctions.php.
References formatRaw(), Parser\getFunctionLang(), and SiteStats\users().
|
static |
Unicode-safe str_pad with the restriction that $length is forced to be <= 500.
Parser | $parser | |
string | $string | |
string | $length | |
string | $padding | |
int | $direction |
Definition at line 983 of file CoreParserFunctions.php.
References Parser\killMarkers().
Referenced by padleft(), and padright().
|
static |
Definition at line 1016 of file CoreParserFunctions.php.
References pad().
|
static |
Definition at line 1020 of file CoreParserFunctions.php.
References pad().
|
static |
Get the pageid of a specified page.
Definition at line 1268 of file CoreParserFunctions.php.
References $t, $title, Parser\getOutput(), Parser\getTitle(), Parser\incrementExpensiveFunctionCount(), and Title\newFromText().
|
static |
Functions to get and normalize pagenames, corresponding to the magic words of the same names.
Parser | $parser | |
string | null | $title |
Definition at line 701 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 709 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 823 of file CoreParserFunctions.php.
References $cache, $magicWords, $title, $type, Category\COUNT_CONTENT_PAGES, formatRaw(), Parser\getContentLanguage(), Parser\getFunctionLang(), Parser\getMagicWordFactory(), Parser\incrementExpensiveFunctionCount(), Title\makeTitleSafe(), Category\newFromTitle(), and NS_CATEGORY.
|
static |
Definition at line 599 of file CoreParserFunctions.php.
References formatRaw(), Parser\getFunctionLang(), 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 | null | $raw | Should number be human readable with commas or just number |
Definition at line 890 of file CoreParserFunctions.php.
References $title, formatRaw(), Parser\getFunctionLang(), and Title\newFromText().
|
static |
Parser | $parser | |
string | $text | |
string | ...$forms What to output for each number (singular, dual, plural, etc.) |
Definition at line 409 of file CoreParserFunctions.php.
References Parser\getFunctionLang().
|
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 943 of file CoreParserFunctions.php.
References $title, $type, Parser\getTitle(), Parser\incrementExpensiveFunctionCount(), 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 919 of file CoreParserFunctions.php.
References $title, $type, Parser\getTitle(), Parser\incrementExpensiveFunctionCount(), and Title\newFromText().
|
static |
Parser | $parser | |
ServiceOptions | $options |
MWException |
Definition at line 56 of file CoreParserFunctions.php.
References Parser\setFunctionHook(), Parser\SFH_NO_HASH, and Parser\SFH_OBJECT_ARGS.
Referenced by Parser\__construct().
|
static |
Get the day from the last revision of a specified page.
Definition at line 1353 of file CoreParserFunctions.php.
References $t, $title, MWTimestamp\getLocalInstance(), and Title\newFromText().
|
static |
Get the day with leading zeros from the last revision of a specified page.
Definition at line 1370 of file CoreParserFunctions.php.
References $t, $title, MWTimestamp\getLocalInstance(), and Title\newFromText().
|
static |
Get the id from the last revision of a specified page.
Definition at line 1318 of file CoreParserFunctions.php.
References $t, $title, Parser\getOptions(), Parser\getOutput(), Parser\getRevisionId(), Parser\getTitle(), and Title\newFromText().
|
static |
Get the month with leading zeros from the last revision of a specified page.
Definition at line 1387 of file CoreParserFunctions.php.
References $t, $title, MWTimestamp\getLocalInstance(), and Title\newFromText().
|
static |
Get the month from the last revision of a specified page.
Definition at line 1404 of file CoreParserFunctions.php.
References $t, $title, MWTimestamp\getLocalInstance(), and Title\newFromText().
|
static |
Get the timestamp from the last revision of a specified page.
Definition at line 1438 of file CoreParserFunctions.php.
References $t, $title, MWTimestamp\getLocalInstance(), and Title\newFromText().
|
static |
Get the user from the last revision of a specified page.
Definition at line 1455 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
|
static |
Get the year from the last revision of a specified page.
Definition at line 1421 of file CoreParserFunctions.php.
References $t, $title, MWTimestamp\getLocalInstance(), and Title\newFromText().
|
static |
Definition at line 749 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 757 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), wfEscapeWikiText(), and wfUrlencode().
|
static |
Definition at line 1035 of file CoreParserFunctions.php.
References $title, SpecialPage\getTitleFor(), Title\makeTitleSafe(), and NS_SPECIAL.
|
static |
Definition at line 1048 of file CoreParserFunctions.php.
References wfUrlencode().
|
static |
Definition at line 797 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 805 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 678 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
|
static |
Definition at line 686 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfUrlencode().
|
static |
Definition at line 733 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 741 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Parser function to extension tag adaptor.
Definition at line 1143 of file CoreParserFunctions.php.
References $args, Parser\extensionSubstitution(), Parser\getStripList(), and PPFrame\STRIP_COMMENTS.
|
static |
Definition at line 781 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 789 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
|
static |
Definition at line 662 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
|
static |
Definition at line 670 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfUrlencode().
|
static |
Parser | $parser | |
string | $s |
Definition at line 235 of file CoreParserFunctions.php.
References $s, Parser\getContentLanguage(), and Parser\markerSkipCallback().
|
static |
Definition at line 217 of file CoreParserFunctions.php.
References $s, and Parser\getContentLanguage().
|
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 | null | $arg | (optional): The type of encoding. |
Definition at line 185 of file CoreParserFunctions.php.
References $magicWords, $s, Parser\getMagicWordFactory(), and Parser\killMarkers().
|
static |
Definition at line 278 of file CoreParserFunctions.php.
References $s, $title, Title\makeTitle(), Title\newFromText(), Title\newFromURL(), NS_FILE, and NS_MEDIA.
Referenced by canonicalurl(), canonicalurle(), fullurl(), fullurle(), localurl(), and localurle().
const CoreParserFunctions::REGISTER_OPTIONS |
Definition at line 42 of file CoreParserFunctions.php.
Referenced by Parser\__construct().