MediaWiki  REL1_19
CoreParserFunctions Class Reference

Various core parser functions, registered in Parser::firstCallInit() More...

List of all members.

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= '', $raw=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 isRaw ($param)
static language ($parser, $code= '', $language= '')
 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 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= '', $raw=null)
 Return the number of pages in the given category, or 0 if it's nonexis- tent.
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= '')
 Returns the requested protection level for the current page.
static register ($parser)
static special ($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)

Detailed Description

Various core parser functions, registered in Parser::firstCallInit()

Definition at line 12 of file CoreParserFunctions.php.


Member Function Documentation

static CoreParserFunctions::anchorencode ( parser,
text 
) [static]
Parameters:
$parserParser
$text
Returns:
string

Definition at line 677 of file CoreParserFunctions.php.

static CoreParserFunctions::basepagename ( parser,
title = null 
) [static]

Definition at line 501 of file CoreParserFunctions.php.

References $t, $title, Title\newFromText(), and wfEscapeWikiText().

Here is the call graph for this function:

static CoreParserFunctions::basepagenamee ( parser,
title = null 
) [static]

Definition at line 507 of file CoreParserFunctions.php.

References $t, $title, Title\newFromText(), and wfEscapeWikiText().

Here is the call graph for this function:

static CoreParserFunctions::canonicalurl ( parser,
s = '',
arg = null 
) [static]

Definition at line 222 of file CoreParserFunctions.php.

References urlFunction().

Here is the call graph for this function:

static CoreParserFunctions::canonicalurle ( parser,
s = '',
arg = null 
) [static]

Definition at line 223 of file CoreParserFunctions.php.

References urlFunction().

Here is the call graph for this function:

static CoreParserFunctions::defaultsort ( parser,
text,
uarg = '' 
) [static]
Parameters:
$parserParser
$textString The sortkey to use
$uargString Either "noreplace" or "noerror" (in en) both suppress errors, and noreplace does nothing if a default sortkey already exists.
Returns:
string

Definition at line 700 of file CoreParserFunctions.php.

References $magicWords, and wfMsgForContent().

Here is the call graph for this function:

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.

Parameters:
$parserParser: parent parser
$textString: desired title text
Returns:
String

Definition at line 334 of file CoreParserFunctions.php.

References $title, $wgRestrictDisplayTitle, Parser\MARKER_SUFFIX, Title\newFromText(), Sanitizer\normalizeCharReferences(), Sanitizer\removeHTMLtags(), and Sanitizer\stripAllTags().

Here is the call graph for this function:

static CoreParserFunctions::filepath ( parser,
name = '',
argA = '',
argB = '' 
) [static]

Definition at line 727 of file CoreParserFunctions.php.

References $file, $size, $url, wfExpandUrl(), and wfFindFile().

Here is the call graph for this function:

static CoreParserFunctions::formatDate ( parser,
date,
defaultPref = null 
) [static]
Parameters:
$parserParser
$date
null$defaultPref
Returns:
mixed|string

Definition at line 113 of file CoreParserFunctions.php.

References DateFormatter\getInstance().

Here is the call graph for this function:

static CoreParserFunctions::formatnum ( parser,
num = '',
raw = null 
) [static]
Parameters:
$parserParser
string$num
null$raw
Returns:

Definition at line 255 of file CoreParserFunctions.php.

static CoreParserFunctions::fullpagename ( parser,
title = null 
) [static]

Definition at line 477 of file CoreParserFunctions.php.

References $t, $title, Title\newFromText(), and wfEscapeWikiText().

Here is the call graph for this function:

static CoreParserFunctions::fullpagenamee ( parser,
title = null 
) [static]

Definition at line 483 of file CoreParserFunctions.php.

References $t, $title, Title\newFromText(), and wfEscapeWikiText().

Here is the call graph for this function:

static CoreParserFunctions::fullurl ( parser,
s = '',
arg = null 
) [static]

Definition at line 220 of file CoreParserFunctions.php.

References urlFunction().

Here is the call graph for this function:

static CoreParserFunctions::fullurle ( parser,
s = '',
arg = null 
) [static]

Definition at line 221 of file CoreParserFunctions.php.

References urlFunction().

Here is the call graph for this function:

static CoreParserFunctions::gender ( parser,
username 
) [static]
Parameters:
$parserParser
$usernamestring
Returns:

Definition at line 280 of file CoreParserFunctions.php.

References $title, $user, User\getDefaultOption(), User\newFromName(), Title\newFromText(), wfProfileIn(), and wfProfileOut().

Here is the call graph for this function:

static CoreParserFunctions::grammar ( parser,
case = '',
word = '' 
) [static]
Parameters:
$parserParser
string$case
string$word
Returns:

Definition at line 270 of file CoreParserFunctions.php.

static CoreParserFunctions::intFunction ( parser,
part1 = '' 
) [static]
Parameters:
$parserParser
string$part1
Returns:
array

Definition at line 97 of file CoreParserFunctions.php.

References wfMessage().

Here is the call graph for this function:

static CoreParserFunctions::isRaw ( param) [static]

Definition at line 366 of file CoreParserFunctions.php.

References MagicWord\get().

Here is the call graph for this function:

static CoreParserFunctions::language ( parser,
code = '',
language = '' 
) [static]

Gives language names.

Parameters:
$parserParser
$codeString Language code
$languageString Language code
Returns:
String

Definition at line 623 of file CoreParserFunctions.php.

References $language, $wgContLang, Language\getTranslatedLanguageNames(), and wfBCP47().

Here is the call graph for this function:

static CoreParserFunctions::lc ( parser,
s = '' 
) [static]
Parameters:
$parserParser
string$s
Returns:

Definition at line 203 of file CoreParserFunctions.php.

References $wgContLang.

static CoreParserFunctions::lcfirst ( parser,
s = '' 
) [static]

Definition at line 188 of file CoreParserFunctions.php.

References $wgContLang.

static CoreParserFunctions::localurl ( parser,
s = '',
arg = null 
) [static]

Definition at line 218 of file CoreParserFunctions.php.

References urlFunction().

Here is the call graph for this function:

static CoreParserFunctions::localurle ( parser,
s = '',
arg = null 
) [static]

Definition at line 219 of file CoreParserFunctions.php.

References urlFunction().

Here is the call graph for this function:

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 424 of file CoreParserFunctions.php.

References $t, $title, and Title\newFromText().

Here is the call graph for this function:

static CoreParserFunctions::namespacee ( parser,
title = null 
) [static]

Definition at line 430 of file CoreParserFunctions.php.

References $t, $title, Title\newFromText(), and wfUrlencode().

Here is the call graph for this function:

static CoreParserFunctions::ns ( parser,
part1 = '' 
) [static]

Definition at line 129 of file CoreParserFunctions.php.

References $wgContLang.

Referenced by nse().

Here is the caller graph for this function:

static CoreParserFunctions::nse ( parser,
part1 = '' 
) [static]

Definition at line 143 of file CoreParserFunctions.php.

References ns(), and wfUrlencode().

Here is the call graph for this function:

static CoreParserFunctions::numberingroup ( parser,
name = '',
raw = null 
) [static]

Definition at line 413 of file CoreParserFunctions.php.

References formatRaw(), and SiteStats\numberingroup().

Here is the call graph for this function:

static CoreParserFunctions::numberofactiveusers ( parser,
raw = null 
) [static]

Definition at line 392 of file CoreParserFunctions.php.

References SiteStats\activeUsers(), and formatRaw().

Here is the call graph for this function:

static CoreParserFunctions::numberofadmins ( parser,
raw = null 
) [static]

Definition at line 401 of file CoreParserFunctions.php.

References formatRaw(), and SiteStats\numberingroup().

Here is the call graph for this function:

static CoreParserFunctions::numberofarticles ( parser,
raw = null 
) [static]

Definition at line 395 of file CoreParserFunctions.php.

References SiteStats\articles(), and formatRaw().

Here is the call graph for this function:

static CoreParserFunctions::numberofedits ( parser,
raw = null 
) [static]

Definition at line 404 of file CoreParserFunctions.php.

References SiteStats\edits(), and formatRaw().

Here is the call graph for this function:

static CoreParserFunctions::numberoffiles ( parser,
raw = null 
) [static]

Definition at line 398 of file CoreParserFunctions.php.

References formatRaw(), and SiteStats\images().

Here is the call graph for this function:

static CoreParserFunctions::numberofpages ( parser,
raw = null 
) [static]

Definition at line 386 of file CoreParserFunctions.php.

References formatRaw(), and SiteStats\pages().

Here is the call graph for this function:

static CoreParserFunctions::numberofusers ( parser,
raw = null 
) [static]

Definition at line 389 of file CoreParserFunctions.php.

References formatRaw(), and SiteStats\users().

Here is the call graph for this function:

static CoreParserFunctions::numberofviews ( parser,
raw = null 
) [static]

Definition at line 407 of file CoreParserFunctions.php.

References formatRaw(), and SiteStats\views().

Here is the call graph for this function:

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 640 of file CoreParserFunctions.php.

Referenced by padleft(), and padright().

Here is the caller graph for this function:

static CoreParserFunctions::padleft ( parser,
string = '',
length = 0,
padding = '0' 
) [static]

Definition at line 664 of file CoreParserFunctions.php.

References pad().

Here is the call graph for this function:

static CoreParserFunctions::padright ( parser,
string = '',
length = 0,
padding = '0' 
) [static]

Definition at line 668 of file CoreParserFunctions.php.

References pad().

Here is the call graph for this function:

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 465 of file CoreParserFunctions.php.

References $t, $title, Title\newFromText(), and wfEscapeWikiText().

Here is the call graph for this function:

static CoreParserFunctions::pagenamee ( parser,
title = null 
) [static]

Definition at line 471 of file CoreParserFunctions.php.

References $t, $title, Title\newFromText(), and wfEscapeWikiText().

Here is the call graph for this function:

static CoreParserFunctions::pagesincategory ( parser,
name = '',
raw = null 
) [static]

Return the number of pages in the given category, or 0 if it's nonexis- tent.

This is an expensive parser function and can't be called too many times per page.

Definition at line 543 of file CoreParserFunctions.php.

References $count, formatRaw(), and Category\newFromName().

Here is the call graph for this function:

static CoreParserFunctions::pagesinnamespace ( parser,
namespace = 0,
raw = null 
) [static]

Definition at line 410 of file CoreParserFunctions.php.

References formatRaw(), and SiteStats\pagesInNs().

Here is the call graph for this function:

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.

Todo:

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

Parameters:
$parserParser
$pageString TODO DOCUMENT (Default: empty string)
$rawTODO DOCUMENT (Default: null)

Definition at line 580 of file CoreParserFunctions.php.

References $page, $title, formatRaw(), Title\newFromText(), and Revision\newFromTitle().

Here is the call graph for this function:

static CoreParserFunctions::plural ( parser,
text = '' 
) [static]
Parameters:
$parserParser
string$text
Returns:

Definition at line 320 of file CoreParserFunctions.php.

static CoreParserFunctions::protectionlevel ( parser,
type = '' 
) [static]

Returns the requested protection level for the current page.

Definition at line 609 of file CoreParserFunctions.php.

static CoreParserFunctions::register ( parser) [static]
Parameters:
$parserParser
Returns:
void

Definition at line 17 of file CoreParserFunctions.php.

References $wgAllowDisplayTitle, and $wgAllowSlowParserFunctions.

Referenced by Parser_LinkHooks\firstCallInit(), and Parser\firstCallInit().

Here is the caller graph for this function:

static CoreParserFunctions::special ( parser,
text 
) [static]

Definition at line 682 of file CoreParserFunctions.php.

References $page, $title, SpecialPage\getTitleFor(), SpecialPageFactory\resolveAlias(), and wfMsgForContent().

Here is the call graph for this function:

static CoreParserFunctions::subjectpagename ( parser,
title = null 
) [static]

Definition at line 525 of file CoreParserFunctions.php.

References $t, $title, Title\newFromText(), and wfEscapeWikiText().

Here is the call graph for this function:

static CoreParserFunctions::subjectpagenamee ( parser,
title = null 
) [static]

Definition at line 531 of file CoreParserFunctions.php.

References $t, $title, Title\newFromText(), and wfEscapeWikiText().

Here is the call graph for this function:

static CoreParserFunctions::subjectspace ( parser,
title = null 
) [static]

Definition at line 448 of file CoreParserFunctions.php.

References $t, $title, and Title\newFromText().

Here is the call graph for this function:

static CoreParserFunctions::subjectspacee ( parser,
title = null 
) [static]

Definition at line 454 of file CoreParserFunctions.php.

References $t, $title, Title\newFromText(), and wfUrlencode().

Here is the call graph for this function:

static CoreParserFunctions::subpagename ( parser,
title = null 
) [static]

Definition at line 489 of file CoreParserFunctions.php.

References $t, $title, Title\newFromText(), and wfEscapeWikiText().

Here is the call graph for this function:

static CoreParserFunctions::subpagenamee ( parser,
title = null 
) [static]

Definition at line 495 of file CoreParserFunctions.php.

References $t, $title, Title\newFromText(), and wfEscapeWikiText().

Here is the call graph for this function:

static CoreParserFunctions::tagObj ( parser,
frame,
args 
) [static]

Parser function to extension tag adaptor.

Definition at line 772 of file CoreParserFunctions.php.

References PPFrame\STRIP_COMMENTS, and wfMsgForContent().

Here is the call graph for this function:

static CoreParserFunctions::talkpagename ( parser,
title = null 
) [static]

Definition at line 513 of file CoreParserFunctions.php.

References $t, $title, Title\newFromText(), and wfEscapeWikiText().

Here is the call graph for this function:

static CoreParserFunctions::talkpagenamee ( parser,
title = null 
) [static]

Definition at line 519 of file CoreParserFunctions.php.

References $t, $title, Title\newFromText(), and wfEscapeWikiText().

Here is the call graph for this function:

static CoreParserFunctions::talkspace ( parser,
title = null 
) [static]

Definition at line 436 of file CoreParserFunctions.php.

References $t, $title, and Title\newFromText().

Here is the call graph for this function:

static CoreParserFunctions::talkspacee ( parser,
title = null 
) [static]

Definition at line 442 of file CoreParserFunctions.php.

References $t, $title, Title\newFromText(), and wfUrlencode().

Here is the call graph for this function:

static CoreParserFunctions::uc ( parser,
s = '' 
) [static]
Parameters:
$parserParser
string$s
Returns:

Definition at line 213 of file CoreParserFunctions.php.

References $wgContLang.

static CoreParserFunctions::ucfirst ( parser,
s = '' 
) [static]

Definition at line 193 of file CoreParserFunctions.php.

References $wgContLang.

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 '_',

Parameters:
$parserParser object
$sString: The text to encode.
$argString (optional): The type of encoding.

Definition at line 162 of file CoreParserFunctions.php.

References $magicWords.

static CoreParserFunctions::urlFunction ( func,
s = '',
arg = null 
) [static]

Definition at line 225 of file CoreParserFunctions.php.

References $title, Title\makeTitle(), Title\newFromText(), and Title\newFromURL().

Referenced by canonicalurl(), canonicalurle(), fullurl(), fullurle(), localurl(), and localurle().

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: