33 public static function register(
$parser ) {
36 # Syntax for arguments (see Parser::setFunctionHook):
37 # "name for lookup in localized magic words array",
39 # optional Parser::SFH_NO_HASH to omit the hash from calls (e.g. {{int:...}}
40 # instead of {{#int:...}})
42 'ns',
'nse',
'urlencode',
'lcfirst',
'ucfirst',
'lc',
'uc',
43 'localurl',
'localurle',
'fullurl',
'fullurle',
'canonicalurl',
44 'canonicalurle',
'formatnum',
'grammar',
'gender',
'plural',
'bidi',
45 'numberofpages',
'numberofusers',
'numberofactiveusers',
46 'numberofarticles',
'numberoffiles',
'numberofadmins',
47 'numberingroup',
'numberofedits',
'language',
48 'padleft',
'padright',
'anchorencode',
'defaultsort',
'filepath',
49 'pagesincategory',
'pagesize',
'protectionlevel',
'protectionexpiry',
50 'namespacee',
'namespacenumber',
'talkspace',
'talkspacee',
51 'subjectspace',
'subjectspacee',
'pagename',
'pagenamee',
52 'fullpagename',
'fullpagenamee',
'rootpagename',
'rootpagenamee',
53 'basepagename',
'basepagenamee',
'subpagename',
'subpagenamee',
54 'talkpagename',
'talkpagenamee',
'subjectpagename',
55 'subjectpagenamee',
'pageid',
'revisionid',
'revisionday',
56 'revisionday2',
'revisionmonth',
'revisionmonth1',
'revisionyear',
57 'revisiontimestamp',
'revisionuser',
'cascadingsources',
59 foreach ( $noHashFunctions
as $func ) {
65 [ __CLASS__,
'mwnamespace' ],
69 $parser->setFunctionHook(
'special', [ __CLASS__,
'special' ] );
70 $parser->setFunctionHook(
'speciale', [ __CLASS__,
'speciale' ] );
72 $parser->setFunctionHook(
'formatdate', [ __CLASS__,
'formatDate' ] );
74 if ( $wgAllowDisplayTitle ) {
77 [ __CLASS__,
'displaytitle' ],
81 if ( $wgAllowSlowParserFunctions ) {
84 [ __CLASS__,
'pagesinnamespace' ],
96 if ( strval( $part1 ) !==
'' ) {
97 $args = array_slice( func_get_args(), 2 );
99 ->inLanguage(
$parser->getOptions()->getUserLangObj() );
100 if ( !$message->exists() ) {
103 return $message->escaped();
105 return [ $message->plain(),
'noparse' =>
false ];
107 return [
'found' =>
false ];
122 $date = trim( $date );
124 $pref =
$parser->getOptions()->getDateFormat();
128 if ( $pref ==
'default' && $defaultPref ) {
129 $pref = $defaultPref;
132 $date = $df->reformat( $pref, $date, [
'match-whole' ] );
138 if ( intval( $part1 ) || $part1 ==
"0" ) {
139 $index = intval( $part1 );
141 $index = $wgContLang->getNsIndex( str_replace(
' ',
'_', $part1 ) );
143 if ( $index !==
false ) {
144 return $wgContLang->getFormattedNsText( $index );
146 return [
'found' =>
false ];
152 if ( is_string(
$ret ) ) {
179 $func =
'wfUrlencode';
180 $s = str_replace(
' ',
'_',
$s );
185 $func =
'rawurlencode';
195 return $func(
$parser->killMarkers(
$s ) );
200 return $wgContLang->lcfirst(
$s );
205 return $wgContLang->ucfirst(
$s );
215 return $parser->markerSkipCallback(
$s, [ $wgContLang,
'lc' ] );
225 return $parser->markerSkipCallback(
$s, [ $wgContLang,
'uc' ] );
229 return self::urlFunction(
'getLocalURL',
$s, $arg );
233 $temp = self::urlFunction(
'getLocalURL',
$s, $arg );
234 if ( !is_string( $temp ) ) {
237 return htmlspecialchars( $temp );
242 return self::urlFunction(
'getFullURL',
$s, $arg );
246 $temp = self::urlFunction(
'getFullURL',
$s, $arg );
247 if ( !is_string( $temp ) ) {
250 return htmlspecialchars( $temp );
255 return self::urlFunction(
'getCanonicalURL',
$s, $arg );
259 $temp = self::urlFunction(
'getCanonicalURL',
$s, $arg );
260 if ( !is_string( $temp ) ) {
263 return htmlspecialchars( $temp );
269 # Due to order of execution of a lot of bits, the values might be encoded
270 # before arriving here; if that's true, then the title can't be created
271 # and the variable will fail. If we can't get a decent title from the first
272 # attempt, url-decode and try for a second.
273 if ( is_null(
$title ) ) {
276 if ( !is_null(
$title ) ) {
277 # Convert NS_MEDIA -> NS_FILE
281 if ( !is_null( $arg ) ) {
282 $text =
$title->$func( $arg );
288 return [
'found' =>
false ];
299 if ( self::matchAgainstMagicword(
'rawsuffix', $arg ) ) {
300 $func = [
$parser->getFunctionLang(),
'parseFormattedNumber' ];
301 } elseif ( self::matchAgainstMagicword(
'nocommafysuffix', $arg ) ) {
302 $func = [
$parser->getFunctionLang(),
'formatNumNoSeparators' ];
304 $func = [
$parser->getFunctionLang(),
'formatNum' ];
306 return $parser->markerSkipCallback( $num, $func );
316 $word =
$parser->killMarkers( $word );
317 return $parser->getFunctionLang()->convertGrammar( $word, $case );
326 $forms = array_slice( func_get_args(), 2 );
329 if ( count( $forms ) === 0 ) {
331 } elseif ( count( $forms ) === 1 ) {
351 } elseif (
$username ===
'' &&
$parser->getOptions()->getInterfaceMessage() ) {
354 $ret =
$parser->getFunctionLang()->gender( $gender, $forms );
364 $forms = array_slice( func_get_args(), 2 );
365 $text =
$parser->getFunctionLang()->parseFormattedNumber( $text );
366 settype( $text, ctype_digit( $text ) ?
'int' :
'float' );
367 return $parser->getFunctionLang()->convertPlural( $text, $forms );
376 return $parser->getFunctionLang()->embedBidi( $text );
389 global $wgRestrictDisplayTitle;
398 $text =
$parser->doQuotes( $text );
401 $text =
$parser->killMarkers( $text );
405 $bad = [
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'div',
'blockquote',
'ol',
'ul',
'li',
'hr',
406 'table',
'tr',
'th',
'td',
'dl',
'dd',
'caption',
'p',
'ruby',
'rb',
'rt',
'rtc',
'rp',
'br' ];
409 if ( $wgRestrictDisplayTitle ) {
410 $htmlTagsCallback =
function ( &
$params ) {
413 if ( isset( $decoded[
'style'] ) ) {
418 if ( preg_match(
'/(display|user-select|visibility)\s*:/i', $decoded[
'style'] ) ) {
419 $decoded[
'style'] =
'/* attempt to bypass $wgRestrictDisplayTitle */';
426 $htmlTagsCallback = null;
441 if ( !$wgRestrictDisplayTitle ||
446 $old =
$parser->mOutput->getProperty(
'displaytitle' );
447 if ( $old ===
false || $arg !==
'displaytitle_noreplace' ) {
448 $parser->mOutput->setDisplayTitle( $text );
450 if ( $old !==
false && $old !== $text && !$arg ) {
451 $converter =
$parser->getConverterLanguage()->getConverter();
452 return '<span class="error">' .
457 )->inContentLanguage()->text() .
478 return $mwObject->matchStartToEnd(
$value );
482 if ( self::matchAgainstMagicword(
'rawsuffix', $raw ) ) {
486 return $wgContLang->formatNum( $num );
528 if ( is_null(
$t ) ) {
531 return str_replace(
'_',
' ',
$t->getNsText() );
535 if ( is_null(
$t ) ) {
542 if ( is_null(
$t ) ) {
545 return $t->getNamespace();
549 if ( is_null(
$t ) || !
$t->canTalk() ) {
552 return str_replace(
'_',
' ',
$t->getTalkNsText() );
556 if ( is_null(
$t ) || !
$t->canTalk() ) {
563 if ( is_null(
$t ) ) {
566 return str_replace(
'_',
' ',
$t->getSubjectNsText() );
570 if ( is_null(
$t ) ) {
585 if ( is_null(
$t ) ) {
592 if ( is_null(
$t ) ) {
599 if ( is_null(
$t ) || !
$t->canTalk() ) {
606 if ( is_null(
$t ) || !
$t->canTalk() ) {
613 if ( is_null(
$t ) ) {
620 if ( is_null(
$t ) ) {
627 if ( is_null(
$t ) ) {
634 if ( is_null(
$t ) ) {
641 if ( is_null(
$t ) ) {
648 if ( is_null(
$t ) ) {
655 if ( is_null(
$t ) || !
$t->canTalk() ) {
662 if ( is_null(
$t ) || !
$t->canTalk() ) {
669 if ( is_null(
$t ) ) {
676 if ( is_null(
$t ) ) {
697 'pagesincategory_all',
698 'pagesincategory_pages',
699 'pagesincategory_subcats',
700 'pagesincategory_files'
706 if ( self::matchAgainstMagicword(
'rawsuffix', $arg1 ) ) {
716 $type =
'pagesincategory_all';
721 return self::formatRaw( 0, $raw );
723 $wgContLang->findVariantLink(
$name,
$title,
true );
731 $allCount = $subcatCount = $fileCount = $pagesCount = 0;
732 if (
$parser->incrementExpensiveFunctionCount() ) {
735 $allCount = (int)$category->getPageCount();
736 $subcatCount = (int)$category->getSubcatCount();
737 $fileCount = (int)$category->getFileCount();
738 $pagesCount = $allCount - $subcatCount - $fileCount;
741 $cache[
$name][
'pagesincategory_pages'] = $pagesCount;
742 $cache[
$name][
'pagesincategory_subcats'] = $subcatCount;
743 $cache[
$name][
'pagesincategory_files'] = $fileCount;
747 return self::formatRaw(
$count, $raw );
762 if ( !is_object(
$title ) ) {
763 return self::formatRaw( 0, $raw );
768 $length =
$rev ?
$rev->getSize() : 0;
769 return self::formatRaw( $length, $raw );
786 if ( !( $titleObject instanceof
Title ) ) {
787 $titleObject =
$parser->mTitle;
789 if ( $titleObject->areRestrictionsLoaded() ||
$parser->incrementExpensiveFunctionCount() ) {
790 $restrictions = $titleObject->getRestrictions( strtolower(
$type ) );
791 # Title::getRestrictions returns an array, its possible it may have
792 # multiple values in the future
793 return implode( $restrictions,
',' );
812 if ( !( $titleObject instanceof
Title ) ) {
813 $titleObject =
$parser->mTitle;
815 if ( $titleObject->areRestrictionsLoaded() ||
$parser->incrementExpensiveFunctionCount() ) {
816 $expiry = $titleObject->getRestrictionExpiry( strtolower(
$type ) );
819 if ( $expiry ===
false ) {
836 $inLanguage = strtolower( $inLanguage );
850 public static function pad(
851 $parser, $string, $length, $padding =
'0', $direction = STR_PAD_RIGHT
853 $padding =
$parser->killMarkers( $padding );
854 $lengthOfPadding = mb_strlen( $padding );
855 if ( $lengthOfPadding == 0 ) {
859 # The remaining length to add counts down to 0 as padding is added
860 $length = min( $length, 500 ) - mb_strlen( $string );
861 # $finalPadding is just $padding repeated enough times so that
862 # mb_strlen( $string ) + mb_strlen( $finalPadding ) == $length
864 while ( $length > 0 ) {
865 # If $length < $lengthofPadding, truncate $padding so we get the
866 # exact length desired.
867 $finalPadding .= mb_substr( $padding, 0, $length );
868 $length -= $lengthOfPadding;
871 if ( $direction == STR_PAD_LEFT ) {
872 return $finalPadding . $string;
874 return $string . $finalPadding;
878 public static function padleft(
$parser, $string =
'', $length = 0, $padding =
'0' ) {
879 return self::pad(
$parser, $string, $length, $padding, STR_PAD_LEFT );
882 public static function padright(
$parser, $string =
'', $length = 0, $padding =
'0' ) {
883 return self::pad(
$parser, $string, $length, $padding );
892 $text =
$parser->killMarkers( $text );
893 return (
string)substr(
$parser->guessSectionNameFromWikiText( $text ), 1 );
900 return $title->getPrefixedText();
927 $text = trim( $text );
928 if ( strlen( $text ) == 0 ) {
931 $old =
$parser->getCustomDefaultSort();
932 if ( $old ===
false || $arg !==
'defaultsort_noreplace' ) {
933 $parser->setDefaultSort( $text );
936 if ( $old ===
false || $old == $text || $arg ) {
939 $converter =
$parser->getConverterLanguage()->getConverter();
940 return '<span class="error">' .
945 )->inContentLanguage()->text() .
964 if ( $argA ==
'nowiki' ) {
967 $parsedWidthParam =
$parser->parseWidthParam( $argB );
970 $parsedWidthParam =
$parser->parseWidthParam( $argA );
971 $isNowiki = ( $argB ==
'nowiki' );
975 $url = $file->getFullUrl();
978 if ( count( $parsedWidthParam ) ) {
979 $mto = $file->transform( $parsedWidthParam );
981 if ( $mto && !$mto->isError() ) {
987 return [ $url,
'nowiki' =>
true ];
1003 if ( !count(
$args ) ) {
1006 $tagName = strtolower( trim( $frame->expand( array_shift(
$args ) ) ) );
1008 if ( count(
$args ) ) {
1009 $inner = $frame->expand( array_shift(
$args ) );
1016 $bits = $arg->splitArg();
1017 if ( strval( $bits[
'index'] ) ===
'' ) {
1019 $value = trim( $frame->expand( $bits[
'value'] ) );
1020 if ( preg_match(
'/^(?:["\'](.+)["\']|""|\'\')$/s', $value, $m ) ) {
1021 $value = isset( $m[1] ) ? $m[1] :
'';
1027 $stripList =
$parser->getStripList();
1028 if ( !in_array( $tagName, $stripList ) ) {
1032 $attrText .=
' ' . htmlspecialchars(
$name ) .
'="' . htmlspecialchars(
$value ) .
'"';
1034 if ( $inner === null ) {
1035 return "<$tagName$attrText/>";
1037 return "<$tagName$attrText>$inner</$tagName>";
1043 'attributes' => $attributes,
1044 'close' =>
"</$tagName>",
1062 if ( is_null(
$title ) ) {
1069 $parserRev =
$parser->getRevisionObject();
1070 if ( $parserRev && $parserRev->isCurrent() ) {
1072 $parser->getOutput()->setFlag(
'vary-revision' );
1073 wfDebug( __METHOD__ .
": use current revision from parser, setting vary-revision...\n" );
1082 && !
$parser->incrementExpensiveFunctionCount() ) {
1086 $pageID =
$rev ?
$rev->getPage() : 0;
1090 $parser->getOutput()->addTemplate(
$title, $pageID, $revID );
1104 if ( is_null(
$t ) ) {
1108 if (
$t->equals(
$parser->getTitle() ) ) {
1110 return $t->getArticleID();
1114 if ( !
$t->canExist() ||
$t->isExternal() ) {
1120 $pdbk =
$t->getPrefixedDBkey();
1121 $id = $linkCache->getGoodLinkID( $pdbk );
1126 if ( $linkCache->isBadLink( $pdbk ) ) {
1132 if (
$parser->incrementExpensiveFunctionCount() ) {
1133 $id =
$t->getArticleID();
1149 if ( is_null(
$t ) ) {
1166 if ( is_null(
$t ) ) {
1183 if ( is_null(
$t ) ) {
1200 if ( is_null(
$t ) ) {
1217 if ( is_null(
$t ) ) {
1234 if ( is_null(
$t ) ) {
1251 if ( is_null(
$t ) ) {
1268 if ( is_null(
$t ) ) {
1273 return $rev ?
$rev->getUserText() :
'';
1290 if ( !( $titleObject instanceof
Title ) ) {
1291 $titleObject =
$parser->mTitle;
1293 if ( $titleObject->areCascadeProtectionSourcesLoaded()
1294 ||
$parser->incrementExpensiveFunctionCount()
1297 $sources = $titleObject->getCascadeProtectionSources();
1298 foreach ( $sources[0]
as $sourceTitle ) {
1299 $names[] = $sourceTitle->getPrefixedText();
1301 return implode( $names,
'|' );
static newFromName($name, $validate= 'valid')
Static factory method for creation from username.
static numberofedits($parser, $raw=null)
static namespacenumber($parser, $title=null)
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
static decodeTagAttributes($text)
Return an associative array of attribute names and values from a partial tag string.
static formatRaw($num, $raw)
static numberofactiveusers($parser, $raw=null)
static subjectspacee($parser, $title=null)
static padleft($parser, $string= '', $length=0, $padding= '0')
static safeEncodeTagAttributes($assoc_array)
Build a partial tag string from an associative array of attribute names and values as returned by dec...
static urlFunction($func, $s= '', $arg=null)
static language($parser, $code= '', $inLanguage= '')
Gives language names.
static basepagename($parser, $title=null)
static getTitleFor($name, $subpage=false, $fragment= '')
Get a localised Title object for a specified special page name.
static pagesize($parser, $page= '', $raw=null)
Return the size of the given page, or 0 if it's nonexistent.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
if(!isset($args[0])) $lang
processing should stop and the error should be shown to the user * false
static rootpagenamee($parser, $title=null)
static formatnum($parser, $num= '', $arg=null)
static canonicalurle($parser, $s= '', $arg=null)
static fullpagenamee($parser, $title=null)
static fullurle($parser, $s= '', $arg=null)
static defaultsort($parser, $text, $uarg= '')
static lcfirst($parser, $s= '')
static protectionexpiry($parser, $type= '', $title= '')
Returns the requested protection expiry for the current page.
wfUrlencode($s)
We want some things to be included as literal characters in our title URLs for prettiness, which urlencode encodes by default.
static newFromText($text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Represents a title within MediaWiki.
static stripAllTags($text)
Take a fragment of (potentially invalid) HTML and return a version with any tags removed, encoded as plain text.
when a variable name is used in a it is silently declared as a new local masking the global
wfExpandUrl($url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
static numberofusers($parser, $raw=null)
static revisionmonth($parser, $title=null)
Get the month with leading zeros from the last revision of a specified page.
static revisiontimestamp($parser, $title=null)
Get the timestamp from the last revision of a specified page.
wfDebug($text, $dest= 'all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
static getLocalInstance($ts=false)
Get a timestamp instance in the server local timezone ($wgLocaltimezone)
static talkpagename($parser, $title=null)
static tagObj($parser, $frame, $args)
Parser function to extension tag adaptor.
static lc($parser, $s= '')
static filepath($parser, $name= '', $argA= '', $argB= '')
Usage {{filepath|300}}, {{filepath|nowiki}}, {{filepath|nowiki|300}} or {{filepath|300|nowiki}} or {{...
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
static revisionuser($parser, $title=null)
Get the user from the last revision of a specified page.
static grammar($parser, $case= '', $word= '')
static subpagenamee($parser, $title=null)
static anchorencode($parser, $text)
static localurl($parser, $s= '', $arg=null)
static talkspace($parser, $title=null)
static canonicalurl($parser, $s= '', $arg=null)
static subjectpagenamee($parser, $title=null)
wfEscapeWikiText($text)
Escapes the given text so that it may be output using addWikiText() without any linking, formatting, etc.
static revisionmonth1($parser, $title=null)
Get the month 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 talkpagenamee($parser, $title=null)
static singleton()
Get an instance of this class.
static formatDate($parser, $date, $defaultPref=null)
static intFunction($parser, $part1= '')
static subjectspace($parser, $title=null)
static basepagenamee($parser, $title=null)
static subjectpagename($parser, $title=null)
static urlencode($parser, $s= '', $arg=null)
urlencodes a string according to one of three patterns: (bug 22474)
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.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock()-offset Set to overwrite offset parameter in $wgRequest set to ''to unsetoffset-wrap String Wrap the message in html(usually something like"<
static newFromTitle($title)
Factory function.
static makeTitleSafe($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
Various core parser functions, registered in Parser::firstCallInit()
wfBCP47($code)
Get the normalised IETF language tag See unit test for examples.
namespace and then decline to actually register it file or subcat img or subcat $title
static numberingroup($parser, $name= '', $raw=null)
static revisionday($parser, $title=null)
Get the day from the last revision of a specified page.
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
static rootpagename($parser, $title=null)
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Class for handling an array of magic words.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code
static fetchLanguageName($code, $inLanguage=null, $include= 'all')
static & get($id)
Factory: creates an object representing an ID.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
static pagenamee($parser, $title=null)
static getCachedRevisionObject($parser, $title=null)
Fetched the current revision of the given title and return this.
static fullpagename($parser, $title=null)
static localurle($parser, $s= '', $arg=null)
static fullurl($parser, $s= '', $arg=null)
static subpagename($parser, $title=null)
static plural($parser, $text= '')
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
static mwnamespace($parser, $title=null)
Given a title, return the namespace name that would be given by the corresponding magic word Note: fu...
this hook is for auditing only or null if authentication failed before getting that far $username
static numberofadmins($parser, $raw=null)
static matchAgainstMagicword($magicword, $value)
Matches the given value against the value of given magic word.
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 namespacee($parser, $title=null)
static resolveAlias($alias)
Given a special page name with a possible subpage, return an array where the first element is the spe...
static nse($parser, $part1= '')
static normalizeCharReferences($text)
Ensure that any entities and character references are legal for XML and XHTML specifically.
static revisionid($parser, $title=null)
Get the id from the last revision of a specified page.
static bidi($parser, $text= '')
static newFromURL($url)
THIS IS NOT THE FUNCTION YOU WANT.
static gender($parser, $username)
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
$wgAllowSlowParserFunctions
Enable slow parser functions.
static numberofpages($parser, $raw=null)
static special($parser, $text)
static revisionyear($parser, $title=null)
Get the year from the last revision of a specified page.
static removeHTMLtags($text, $processCallback=null, $args=[], $extratags=[], $removetags=[])
Cleans up HTML, removes dangerous tags and attributes, and removes HTML comments. ...
static checkCss($value)
Pick apart some CSS and check it for forbidden or unsafe structures.
static numberingroup($group)
Find the number of users in a given user group.
static pagesinnamespace($parser, $namespace=0, $raw=null)
static getDefaultOption($opt)
Get a given default option value.
static ns($parser, $part1= '')
static uc($parser, $s= '')
static protectionlevel($parser, $type= '', $title= '')
Returns the requested protection level for the current page.
static ucfirst($parser, $s= '')
static cascadingsources($parser, $title= '')
Returns the sources of any cascading protection acting on a specified page.
static pageid($parser, $title=null)
Get the pageid of a specified page.
static displaytitle($parser, $text= '', $uarg= '')
Override the title of the page when viewed, provided we've been given a title which will normalise to...
wfFindFile($title, $options=[])
Find a file.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
static numberoffiles($parser, $raw=null)
static padright($parser, $string= '', $length=0, $padding= '0')
static talkspacee($parser, $title=null)
static speciale($parser, $text)
static & makeTitle($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
static pagename($parser, $title=null)
Functions to get and normalize pagenames, corresponding to the magic words of the same names...
if the prop value should be in the metadata multi language array format
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached $page
static numberofarticles($parser, $raw=null)
magicword txt Magic Words are some phrases used in the wikitext They are used for two that looks like templates but that don t accept any parameter *Parser functions(like{{fullurl:...}},{{#special:...}}) $magicWords['en']
Allows to change the fields on the form that will be generated $name