MediaWiki REL1_34
|
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. | |
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. | |
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}}. | |
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. | |
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. | |
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 | 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 | pageid ( $parser, $title=null) |
Get the pageid of a specified page. | |
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='',... $forms) |
static | protectionexpiry ( $parser, $type='', $title='') |
Returns the requested protection expiry for the current page. | |
static | protectionlevel ( $parser, $type='', $title='') |
Returns the requested protection level for the current page. | |
static | register ( $parser) |
static | revisionday ( $parser, $title=null) |
Get the day from the last revision of a specified page. | |
static | revisionday2 ( $parser, $title=null) |
Get the day with leading zeros from the last revision of a specified page. | |
static | revisionid ( $parser, $title=null) |
Get the id from the last revision of a specified page. | |
static | revisionmonth ( $parser, $title=null) |
Get the month with leading zeros from the last revision of a specified page. | |
static | revisionmonth1 ( $parser, $title=null) |
Get the month from the last revision of a specified page. | |
static | revisiontimestamp ( $parser, $title=null) |
Get the timestamp from the last revision of a specified page. | |
static | revisionuser ( $parser, $title=null) |
Get the user from the last revision of a specified page. | |
static | revisionyear ( $parser, $title=null) |
Get the year from the last revision of a specified page. | |
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. | |
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) | |
static | urlFunction ( $func, $s='', $arg=null) |
Static Private Member Functions | |
static | getCachedRevisionObject ( $parser, $title, $vary) |
Fetched the current revision of the given title and return this. | |
static | matchAgainstMagicword (MagicWordFactory $magicWordFactory, $magicword, $value) |
Matches the given value against the value of given magic word. | |
Various core parser functions, registered in Parser::firstCallInit()
Definition at line 29 of file CoreParserFunctions.php.
|
static |
Parser | $parser | |
string | $text |
Definition at line 953 of file CoreParserFunctions.php.
Referenced by Scribunto_LuaUriLibrary\anchorEncode().
|
static |
Definition at line 694 of file CoreParserFunctions.php.
References $t, $title, and wfEscapeWikiText().
|
static |
Definition at line 702 of file CoreParserFunctions.php.
References $t, $title, wfEscapeWikiText(), and wfUrlencode().
|
static |
Parser | $parser | |
string | $text |
Definition at line 367 of file CoreParserFunctions.php.
|
static |
Definition at line 245 of file CoreParserFunctions.php.
References $s, and urlFunction().
|
static |
Definition at line 249 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 1373 of file CoreParserFunctions.php.
References $title.
Referenced by Parser\expandMagicVariable().
|
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 984 of file CoreParserFunctions.php.
References $magicWords, 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 380 of file CoreParserFunctions.php.
References $magicWords, $title, $wgRestrictDisplayTitle, Title\hasFragment(), 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 1026 of file CoreParserFunctions.php.
References $file, PROTO_RELATIVE, true, and wfExpandUrl().
|
static |
Parser | $parser | |
string | $date | |
string | null | $defaultPref |
Definition at line 114 of file CoreParserFunctions.php.
References $lang.
|
static |
Parser | $parser | |
string | $num | |
string | null | $arg |
Definition at line 289 of file CoreParserFunctions.php.
|
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 495 of file CoreParserFunctions.php.
Referenced by numberingroup(), numberofactiveusers(), numberofadmins(), numberofarticles(), numberofedits(), numberoffiles(), numberofpages(), numberofusers(), pagesincategory(), pagesinnamespace(), and pagesize().
|
static |
Definition at line 646 of file CoreParserFunctions.php.
References $t, $title, and wfEscapeWikiText().
|
static |
Definition at line 654 of file CoreParserFunctions.php.
References $t, $title, and wfEscapeWikiText().
|
static |
Definition at line 232 of file CoreParserFunctions.php.
References $s, and urlFunction().
|
static |
Definition at line 236 of file CoreParserFunctions.php.
References $s, and urlFunction().
|
static |
Parser | $parser | |
string | $username | |
string | ...$forms What to output for each gender |
Definition at line 319 of file CoreParserFunctions.php.
|
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
Definition at line 1127 of file CoreParserFunctions.php.
References $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 308 of file CoreParserFunctions.php.
|
static |
Parser | $parser | |
string | $part1 | Message key |
mixed | ...$params To pass to wfMessage() |
Definition at line 97 of file CoreParserFunctions.php.
References wfMessage().
|
static |
|
static |
Parser | $parser | |
string | $s |
Definition at line 206 of file CoreParserFunctions.php.
References $s.
|
static |
Definition at line 193 of file CoreParserFunctions.php.
References $s.
|
static |
Definition at line 219 of file CoreParserFunctions.php.
References $s, and urlFunction().
|
static |
Definition at line 223 of file CoreParserFunctions.php.
References $s, and urlFunction().
|
staticprivate |
Matches the given value against the value of given magic word.
MagicWordFactory | $magicWordFactory | A factory to get the word from, e.g., from $parser->getMagicWordFactory() |
string | $magicword | Magic word key |
string | $value | Value to match |
Definition at line 475 of file CoreParserFunctions.php.
References MagicWordFactory\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 | null | $title |
Definition at line 567 of file CoreParserFunctions.php.
|
static |
Definition at line 575 of file CoreParserFunctions.php.
References $t, $title, and wfUrlencode().
|
static |
Definition at line 583 of file CoreParserFunctions.php.
|
static |
Definition at line 132 of file CoreParserFunctions.php.
Referenced by TitleBlacklistEntry\newFromString(), and nse().
|
static |
Definition at line 145 of file CoreParserFunctions.php.
References ns(), and wfUrlencode().
|
static |
Definition at line 550 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\numberingroup().
|
static |
Definition at line 518 of file CoreParserFunctions.php.
References SiteStats\activeUsers(), and formatRaw().
|
static |
Definition at line 530 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\numberingroup().
|
static |
Definition at line 522 of file CoreParserFunctions.php.
References SiteStats\articles(), and formatRaw().
|
static |
Definition at line 538 of file CoreParserFunctions.php.
References SiteStats\edits(), and formatRaw().
|
static |
Definition at line 526 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\images().
|
static |
Definition at line 510 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\pages().
|
static |
Definition at line 514 of file CoreParserFunctions.php.
References formatRaw(), 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 907 of file CoreParserFunctions.php.
Referenced by padleft(), and padright().
|
static |
Definition at line 940 of file CoreParserFunctions.php.
References pad().
|
static |
Definition at line 944 of file CoreParserFunctions.php.
References pad().
|
static |
|
static |
Functions to get and normalize pagenames, corresponding to the magic words of the same names.
Parser | $parser | |
string | null | $title |
Definition at line 630 of file CoreParserFunctions.php.
References $t, $title, and wfEscapeWikiText().
|
static |
Definition at line 638 of file CoreParserFunctions.php.
References $t, $title, 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 | null | $arg1 | |
string | null | $arg2 |
Definition at line 752 of file CoreParserFunctions.php.
References $cache, $magicWords, $title, $type, formatRaw(), and NS_CATEGORY.
|
static |
Definition at line 542 of file CoreParserFunctions.php.
References 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 | null | $raw | Should number be human readable with commas or just number |
Definition at line 818 of file CoreParserFunctions.php.
References $title, formatRaw(), and getCachedRevisionObject().
|
static |
Parser | $parser | |
string | $text | |
string | ...$forms What to output for each number (singular, dual, plural, etc.) |
Definition at line 356 of file CoreParserFunctions.php.
|
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 870 of file CoreParserFunctions.php.
|
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 847 of file CoreParserFunctions.php.
|
static |
Parser | $parser |
Definition at line 34 of file CoreParserFunctions.php.
References $wgAllowDisplayTitle, and $wgAllowSlowParserFunctions.
Referenced by Parser\firstCallInit().
|
static |
Get the day from the last revision of a specified page.
Definition at line 1249 of file CoreParserFunctions.php.
References $t, $title, and getCachedRevisionObject().
|
static |
Get the day with leading zeros from the last revision of a specified page.
Definition at line 1266 of file CoreParserFunctions.php.
References $t, $title, and getCachedRevisionObject().
|
static |
Get the id from the last revision of a specified page.
Definition at line 1232 of file CoreParserFunctions.php.
References $t, $title, and getCachedRevisionObject().
|
static |
Get the month with leading zeros from the last revision of a specified page.
Definition at line 1283 of file CoreParserFunctions.php.
References $t, $title, and getCachedRevisionObject().
|
static |
Get the month from the last revision of a specified page.
Definition at line 1300 of file CoreParserFunctions.php.
References $t, $title, and getCachedRevisionObject().
|
static |
Get the timestamp from the last revision of a specified page.
Definition at line 1334 of file CoreParserFunctions.php.
References $t, $title, and getCachedRevisionObject().
|
static |
Get the user from the last revision of a specified page.
Definition at line 1351 of file CoreParserFunctions.php.
References $t, $title, and getCachedRevisionObject().
|
static |
Get the year from the last revision of a specified page.
Definition at line 1317 of file CoreParserFunctions.php.
References $t, $title, and getCachedRevisionObject().
|
static |
Definition at line 678 of file CoreParserFunctions.php.
References $t, $title, and wfEscapeWikiText().
|
static |
Definition at line 686 of file CoreParserFunctions.php.
References $t, $title, wfEscapeWikiText(), and wfUrlencode().
|
static |
Definition at line 959 of file CoreParserFunctions.php.
References $title, NS_SPECIAL, and special().
Referenced by special().
|
static |
Definition at line 972 of file CoreParserFunctions.php.
References wfUrlencode().
|
static |
Definition at line 726 of file CoreParserFunctions.php.
References $t, $title, and wfEscapeWikiText().
|
static |
Definition at line 734 of file CoreParserFunctions.php.
References $t, $title, and wfEscapeWikiText().
|
static |
Definition at line 607 of file CoreParserFunctions.php.
|
static |
Definition at line 615 of file CoreParserFunctions.php.
References $t, $title, and wfUrlencode().
|
static |
Definition at line 662 of file CoreParserFunctions.php.
References $t, $title, and wfEscapeWikiText().
|
static |
Definition at line 670 of file CoreParserFunctions.php.
References $t, $title, and wfEscapeWikiText().
|
static |
|
static |
Definition at line 710 of file CoreParserFunctions.php.
References $t, $title, and wfEscapeWikiText().
|
static |
Definition at line 718 of file CoreParserFunctions.php.
References $t, $title, and wfEscapeWikiText().
|
static |
Definition at line 591 of file CoreParserFunctions.php.
|
static |
Definition at line 599 of file CoreParserFunctions.php.
References $t, $title, and wfUrlencode().
|
static |
Parser | $parser | |
string | $s |
Definition at line 215 of file CoreParserFunctions.php.
References $s.
|
static |
Definition at line 197 of file CoreParserFunctions.php.
References $s.
|
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 165 of file CoreParserFunctions.php.
References $magicWords, and $s.
|
static |
Definition at line 258 of file CoreParserFunctions.php.
References $s, $title, NS_FILE, and NS_MEDIA.
Referenced by canonicalurl(), canonicalurle(), fullurl(), fullurle(), localurl(), and localurle().