Go to the documentation of this file.
34 public static function register(
$parser ) {
37 # Syntax for arguments (see Parser::setFunctionHook):
38 # "name for lookup in localized magic words array",
40 # optional Parser::SFH_NO_HASH to omit the hash from calls (e.g. {{int:...}}
41 # instead of {{#int:...}})
43 'ns',
'nse',
'urlencode',
'lcfirst',
'ucfirst',
'lc',
'uc',
44 'localurl',
'localurle',
'fullurl',
'fullurle',
'canonicalurl',
45 'canonicalurle',
'formatnum',
'grammar',
'gender',
'plural',
'bidi',
46 'numberofpages',
'numberofusers',
'numberofactiveusers',
47 'numberofarticles',
'numberoffiles',
'numberofadmins',
48 'numberingroup',
'numberofedits',
'language',
49 'padleft',
'padright',
'anchorencode',
'defaultsort',
'filepath',
50 'pagesincategory',
'pagesize',
'protectionlevel',
'protectionexpiry',
51 'namespacee',
'namespacenumber',
'talkspace',
'talkspacee',
52 'subjectspace',
'subjectspacee',
'pagename',
'pagenamee',
53 'fullpagename',
'fullpagenamee',
'rootpagename',
'rootpagenamee',
54 'basepagename',
'basepagenamee',
'subpagename',
'subpagenamee',
55 'talkpagename',
'talkpagenamee',
'subjectpagename',
56 'subjectpagenamee',
'pageid',
'revisionid',
'revisionday',
57 'revisionday2',
'revisionmonth',
'revisionmonth1',
'revisionyear',
58 'revisiontimestamp',
'revisionuser',
'cascadingsources',
60 foreach ( $noHashFunctions
as $func ) {
66 [ __CLASS__,
'mwnamespace' ],
70 $parser->setFunctionHook(
'special', [ __CLASS__,
'special' ] );
71 $parser->setFunctionHook(
'speciale', [ __CLASS__,
'speciale' ] );
73 $parser->setFunctionHook(
'formatdate', [ __CLASS__,
'formatDate' ] );
78 [ __CLASS__,
'displaytitle' ],
85 [ __CLASS__,
'pagesinnamespace' ],
97 if ( strval( $part1 ) !==
'' ) {
98 $args = array_slice( func_get_args(), 2 );
100 ->inLanguage(
$parser->getOptions()->getUserLangObj() );
101 return [ $message->plain(),
'noparse' =>
false ];
103 return [
'found' =>
false ];
118 $date = trim( $date );
120 $pref =
$parser->getOptions()->getDateFormat();
124 if ( $pref ==
'default' && $defaultPref ) {
125 $pref = $defaultPref;
128 $date = $df->reformat( $pref, $date, [
'match-whole' ] );
133 if ( intval( $part1 ) || $part1 ==
"0" ) {
134 $index = intval( $part1 );
136 $index =
$parser->getContentLanguage()->getNsIndex( str_replace(
' ',
'_', $part1 ) );
138 if ( $index !==
false ) {
139 return $parser->getContentLanguage()->getFormattedNsText( $index );
141 return [
'found' =>
false ];
147 if ( is_string(
$ret ) ) {
169 $parser->getMagicWordFactory()->newArray( [
'url_path',
'url_query',
'url_wiki' ] );
174 $func =
'wfUrlencode';
175 $s = str_replace(
' ',
'_',
$s );
180 $func =
'rawurlencode';
190 return $func(
$parser->killMarkers(
$s ) );
194 return $parser->getContentLanguage()->lcfirst(
$s );
198 return $parser->getContentLanguage()->ucfirst(
$s );
207 return $parser->markerSkipCallback(
$s, [
$parser->getContentLanguage(),
'lc' ] );
216 return $parser->markerSkipCallback(
$s, [
$parser->getContentLanguage(),
'uc' ] );
225 if ( !is_string( $temp ) ) {
228 return htmlspecialchars( $temp );
238 if ( !is_string( $temp ) ) {
241 return htmlspecialchars( $temp );
251 if ( !is_string( $temp ) ) {
254 return htmlspecialchars( $temp );
260 # Due to order of execution of a lot of bits, the values might be encoded
261 # before arriving here; if that's true, then the title can't be created
262 # and the variable will fail. If we can't get a decent title from the first
263 # attempt, url-decode and try for a second.
264 if ( is_null(
$title ) ) {
267 if ( !is_null(
$title ) ) {
268 # Convert NS_MEDIA -> NS_FILE
272 if ( !is_null( $arg ) ) {
273 $text =
$title->$func( $arg );
279 return [
'found' =>
false ];
290 if ( self::matchAgainstMagicword(
$parser->getMagicWordFactory(),
'rawsuffix', $arg ) ) {
291 $func = [
$parser->getFunctionLang(),
'parseFormattedNumber' ];
293 self::matchAgainstMagicword(
$parser->getMagicWordFactory(),
'nocommafysuffix', $arg )
295 $func = [
$parser->getFunctionLang(),
'formatNumNoSeparators' ];
297 $func = [
$parser->getFunctionLang(),
'formatNum' ];
299 return $parser->markerSkipCallback( $num, $func );
309 $word =
$parser->killMarkers( $word );
310 return $parser->getFunctionLang()->convertGrammar( $word, $case );
319 $forms = array_slice( func_get_args(), 2 );
322 if (
count( $forms ) === 0 ) {
324 } elseif (
count( $forms ) === 1 ) {
342 $genderCache = MediaWikiServices::getInstance()->getGenderCache();
344 $gender = $genderCache->getGenderOf(
$user, __METHOD__ );
345 } elseif (
$username ===
'' &&
$parser->getOptions()->getInterfaceMessage() ) {
346 $gender = $genderCache->getGenderOf(
$parser->getOptions()->getUser(), __METHOD__ );
348 $ret =
$parser->getFunctionLang()->gender( $gender, $forms );
358 $forms = array_slice( func_get_args(), 2 );
359 $text =
$parser->getFunctionLang()->parseFormattedNumber( $text );
360 settype( $text, ctype_digit( $text ) ?
'int' :
'float' );
361 return $parser->getFunctionLang()->convertPlural( $text, $forms );
370 return $parser->getFunctionLang()->embedBidi( $text );
388 [
'displaytitle_noerror',
'displaytitle_noreplace' ] );
393 $text =
$parser->doQuotes( $text );
396 $text =
$parser->killMarkers( $text );
400 $bad = [
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'div',
'blockquote',
'ol',
'ul',
'li',
'hr',
401 'table',
'tr',
'th',
'td',
'dl',
'dd',
'caption',
'p',
'ruby',
'rb',
'rt',
'rtc',
'rp',
'br' ];
405 $htmlTagsCallback =
function ( &
$params ) {
406 $decoded = Sanitizer::decodeTagAttributes(
$params );
408 if ( isset( $decoded[
'style'] ) ) {
411 $decoded[
'style'] = Sanitizer::checkCss( $decoded[
'style'] );
413 if ( preg_match(
'/(display|user-select|visibility)\s*:/i', $decoded[
'style'] ) ) {
414 $decoded[
'style'] =
'/* attempt to bypass $wgRestrictDisplayTitle */';
418 $params = Sanitizer::safeEncodeTagAttributes( $decoded );
421 $htmlTagsCallback =
null;
427 $text = Sanitizer::normalizeCharReferences( Sanitizer::removeHTMLtags(
441 $old =
$parser->mOutput->getProperty(
'displaytitle' );
442 if ( $old ===
false || $arg !==
'displaytitle_noreplace' ) {
443 $parser->mOutput->setDisplayTitle( $text );
445 if ( $old !==
false && $old !== $text && !$arg ) {
446 $converter =
$parser->getTargetLanguage()->getConverter();
447 return '<span class="error">' .
452 )->inContentLanguage()->text() .
458 $converter =
$parser->getTargetLanguage()->getConverter();
459 $parser->getOutput()->addWarning(
465 $parser->addTrackingCategory(
'restricted-displaytitle-ignored' );
485 $mwObject = $magicWordFactory->
get( $magicword );
486 return $mwObject->matchStartToEnd(
$value );
501 if ( $raw !==
null && !$magicWordFactory ) {
502 $magicWordFactory = MediaWikiServices::getInstance()->getMagicWordFactory();
505 $raw !==
null && self::matchAgainstMagicword( $magicWordFactory,
'rawsuffix', $raw )
509 return $language->formatNum( $num );
570 if ( is_null(
$t ) ) {
573 return str_replace(
'_',
' ',
$t->getNsText() );
577 if ( is_null(
$t ) ) {
584 if ( is_null(
$t ) ) {
587 return $t->getNamespace();
591 if ( is_null(
$t ) || !
$t->canHaveTalkPage() ) {
594 return str_replace(
'_',
' ',
$t->getTalkNsText() );
598 if ( is_null(
$t ) || !
$t->canHaveTalkPage() ) {
605 if ( is_null(
$t ) ) {
608 return str_replace(
'_',
' ',
$t->getSubjectNsText() );
612 if ( is_null(
$t ) ) {
627 if ( is_null(
$t ) ) {
634 if ( is_null(
$t ) ) {
641 if ( is_null(
$t ) || !
$t->canHaveTalkPage() ) {
648 if ( is_null(
$t ) || !
$t->canHaveTalkPage() ) {
655 if ( is_null(
$t ) ) {
662 if ( is_null(
$t ) ) {
669 if ( is_null(
$t ) ) {
676 if ( is_null(
$t ) ) {
683 if ( is_null(
$t ) ) {
690 if ( is_null(
$t ) ) {
697 if ( is_null(
$t ) || !
$t->canHaveTalkPage() ) {
704 if ( is_null(
$t ) || !
$t->canHaveTalkPage() ) {
711 if ( is_null(
$t ) ) {
718 if ( is_null(
$t ) ) {
738 'pagesincategory_all',
739 'pagesincategory_pages',
740 'pagesincategory_subcats',
741 'pagesincategory_files'
747 if ( self::matchAgainstMagicword(
$parser->getMagicWordFactory(),
'rawsuffix', $arg1 ) ) {
757 $type =
'pagesincategory_all';
772 $allCount = $subcatCount = $fileCount = $pagesCount = 0;
773 if (
$parser->incrementExpensiveFunctionCount() ) {
776 $allCount = (int)$category->getPageCount();
777 $subcatCount = (int)$category->getSubcatCount();
778 $fileCount = (int)$category->getFileCount();
779 $pagesCount = $allCount - $subcatCount - $fileCount;
782 $cache[
$name][
'pagesincategory_pages'] = $pagesCount;
783 $cache[
$name][
'pagesincategory_subcats'] = $subcatCount;
784 $cache[
$name][
'pagesincategory_files'] = $fileCount;
803 if ( !is_object(
$title ) ) {
809 $length =
$rev ?
$rev->getSize() : 0;
810 if ( $length ===
null ) {
831 if ( !( $titleObject instanceof
Title ) ) {
832 $titleObject =
$parser->mTitle;
834 if ( $titleObject->areRestrictionsLoaded() ||
$parser->incrementExpensiveFunctionCount() ) {
835 $restrictions = $titleObject->getRestrictions( strtolower(
$type ) );
836 # Title::getRestrictions returns an array, its possible it may have
837 # multiple values in the future
838 return implode(
',', $restrictions );
857 if ( !( $titleObject instanceof
Title ) ) {
858 $titleObject =
$parser->mTitle;
860 if ( $titleObject->areRestrictionsLoaded() ||
$parser->incrementExpensiveFunctionCount() ) {
861 $expiry = $titleObject->getRestrictionExpiry( strtolower(
$type ) );
864 if ( $expiry ===
false ) {
881 $inLanguage = strtolower( $inLanguage );
895 public static function pad(
896 $parser, $string, $length, $padding =
'0', $direction = STR_PAD_RIGHT
898 $padding =
$parser->killMarkers( $padding );
899 $lengthOfPadding = mb_strlen( $padding );
900 if ( $lengthOfPadding == 0 ) {
904 # The remaining length to add counts down to 0 as padding is added
905 $length = min( (
int)$length, 500 ) - mb_strlen( $string );
906 if ( $length <= 0 ) {
911 # $finalPadding is just $padding repeated enough times so that
912 # mb_strlen( $string ) + mb_strlen( $finalPadding ) == $length
914 while ( $length > 0 ) {
915 # If $length < $lengthofPadding, truncate $padding so we get the
916 # exact length desired.
917 $finalPadding .= mb_substr( $padding, 0, $length );
918 $length -= $lengthOfPadding;
921 if ( $direction == STR_PAD_LEFT ) {
922 return $finalPadding . $string;
924 return $string . $finalPadding;
928 public static function padleft(
$parser, $string =
'', $length = 0, $padding =
'0' ) {
932 public static function padright(
$parser, $string =
'', $length = 0, $padding =
'0' ) {
942 $text =
$parser->killMarkers( $text );
944 return Sanitizer::safeEncodeAttribute(
$section );
948 list( $page, $subpage ) = MediaWikiServices::getInstance()->getSpecialPageFactory()->
949 resolveAlias( $text );
952 return $title->getPrefixedText();
976 [
'defaultsort_noerror',
'defaultsort_noreplace' ] );
980 $text = trim( $text );
981 if ( strlen( $text ) == 0 ) {
984 $old =
$parser->getCustomDefaultSort();
985 if ( $old ===
false || $arg !==
'defaultsort_noreplace' ) {
986 $parser->setDefaultSort( $text );
989 if ( $old ===
false || $old == $text || $arg ) {
992 $converter =
$parser->getTargetLanguage()->getConverter();
993 return '<span class="error">' .
998 )->inContentLanguage()->text() .
1017 if ( $argA ==
'nowiki' ) {
1020 $parsedWidthParam = Parser::parseWidthParam( $argB );
1023 $parsedWidthParam = Parser::parseWidthParam( $argA );
1024 $isNowiki = ( $argB ==
'nowiki' );
1028 $url = $file->getFullUrl();
1031 if (
count( $parsedWidthParam ) ) {
1032 $mto = $file->transform( $parsedWidthParam );
1034 if ( $mto && !$mto->isError() ) {
1040 return [ $url,
'nowiki' =>
true ];
1059 $tagName = strtolower( trim( $frame->expand( array_shift(
$args ) ) ) );
1062 $inner = $frame->expand( array_shift(
$args ) );
1069 $bits = $arg->splitArg();
1070 if ( strval( $bits[
'index'] ) ===
'' ) {
1072 $value = trim( $frame->expand( $bits[
'value'] ) );
1073 if ( preg_match(
'/^(?:["\'](.+)["\']|""|\'\')$/s',
$value, $m ) ) {
1080 $stripList =
$parser->getStripList();
1081 if ( !in_array( $tagName, $stripList ) ) {
1085 $attrText .=
' ' . htmlspecialchars(
$name ) .
'="' . htmlspecialchars(
$value ) .
'"';
1087 if ( $inner ===
null ) {
1088 return "<$tagName$attrText/>";
1090 return "<$tagName$attrText>$inner</$tagName>";
1096 'attributes' => $attributes,
1097 'close' =>
"</$tagName>",
1115 if ( is_null(
$title ) ) {
1122 $parserRev =
$parser->getRevisionObject();
1123 if ( $parserRev && $parserRev->isCurrent() ) {
1125 $parser->getOutput()->setFlag(
'vary-revision' );
1126 wfDebug( __METHOD__ .
": use current revision from parser, setting vary-revision...\n" );
1132 $page =
$title->getPrefixedDBkey();
1134 if ( !(
$parser->currentRevisionCache &&
$parser->currentRevisionCache->has( $page ) )
1135 && !
$parser->incrementExpensiveFunctionCount() ) {
1139 $pageID =
$rev ?
$rev->getPage() : 0;
1143 $parser->getOutput()->addTemplate(
$title, $pageID, $revID );
1157 if ( is_null(
$t ) ) {
1161 if (
$t->equals(
$parser->getTitle() ) ) {
1163 return $t->getArticleID();
1167 if ( !
$t->canExist() ||
$t->isExternal() ) {
1172 $linkCache = MediaWikiServices::getInstance()->getLinkCache();
1173 $pdbk =
$t->getPrefixedDBkey();
1174 $id = $linkCache->getGoodLinkID( $pdbk );
1179 if ( $linkCache->isBadLink( $pdbk ) ) {
1185 if (
$parser->incrementExpensiveFunctionCount() ) {
1186 $id =
$t->getArticleID();
1202 if ( is_null(
$t ) ) {
1219 if ( is_null(
$t ) ) {
1236 if ( is_null(
$t ) ) {
1253 if ( is_null(
$t ) ) {
1270 if ( is_null(
$t ) ) {
1287 if ( is_null(
$t ) ) {
1304 if ( is_null(
$t ) ) {
1321 if ( is_null(
$t ) ) {
1326 return $rev ?
$rev->getUserText() :
'';
1343 if ( !( $titleObject instanceof
Title ) ) {
1344 $titleObject =
$parser->mTitle;
1346 if ( $titleObject->areCascadeProtectionSourcesLoaded()
1347 ||
$parser->incrementExpensiveFunctionCount()
1350 $sources = $titleObject->getCascadeProtectionSources();
1351 foreach ( $sources[0]
as $sourceTitle ) {
1352 $names[] = $sourceTitle->getPrefixedText();
1354 return implode(
'|', $names );
static getDefaultOption( $opt)
Get a given default option value.
static protectionexpiry( $parser, $type='', $title='')
Returns the requested protection expiry for the current page.
static fetchLanguageName( $code, $inLanguage=self::AS_AUTONYMS, $include=self::ALL)
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 account $user
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
static displaytitle( $parser, $text='', $uarg='')
Override the title of the page when viewed, provided we've been given a title which will normalise to...
processing should stop and the error should be shown to the user * false
A factory that stores information about MagicWords, and creates them on demand with caching.
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.
if(!isset( $args[0])) $lang
static numberofactiveusers( $parser, $raw=null)
static pageid( $parser, $title=null)
Get the pageid of a specified page.
static talkpagename( $parser, $title=null)
static rootpagename( $parser, $title=null)
static tagObj( $parser, $frame, $args)
Parser function to extension tag adaptor.
static pagesize( $parser, $page='', $raw=null)
Return the size of the given page, or 0 if it's nonexistent.
static formatRaw( $num, $raw, $language, MagicWordFactory $magicWordFactory=null)
Formats a number according to a language.
static rootpagenamee( $parser, $title=null)
static protectionlevel( $parser, $type='', $title='')
Returns the requested protection level for the current page.
wfUrlencode( $s)
We want some things to be included as literal characters in our title URLs for prettiness,...
static numberingroup( $group)
Find the number of users in a given user group.
static nse( $parser, $part1='')
static revisionmonth1( $parser, $title=null)
Get the month from the last revision of a specified page.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
static namespacenumber( $parser, $title=null)
static talkspace( $parser, $title=null)
static grammar( $parser, $case='', $word='')
static defaultsort( $parser, $text, $uarg='')
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 revisionday( $parser, $title=null)
Get the day from the last revision 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 revisionid( $parser, $title=null)
Get the id from the last revision of a specified page.
static talkspacee( $parser, $title=null)
static localurle( $parser, $s='', $arg=null)
static getCachedRevisionObject( $parser, $title=null)
Fetched the current revision of the given title and return this.
namespace and then decline to actually register it file or subcat img or subcat $title
static plural( $parser, $text='')
static numberofpages( $parser, $raw=null)
static basepagenamee( $parser, $title=null)
static matchAgainstMagicword(MagicWordFactory $magicWordFactory, $magicword, $value)
Matches the given value against the value of given magic word.
static revisionyear( $parser, $title=null)
Get the year from the last revision of a specified page.
static mwnamespace( $parser, $title=null)
Given a title, return the namespace name that would be given by the corresponding magic word Note: fu...
static fullurle( $parser, $s='', $arg=null)
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
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
see documentation in includes Linker php for Linker::makeImageLink or false for current used if you return false $parser
static numberofedits( $parser, $raw=null)
static revisionday2( $parser, $title=null)
Get the day with leading zeros from the last revision of a specified page.
static fullurl( $parser, $s='', $arg=null)
static ucfirst( $parser, $s='')
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
static fullpagenamee( $parser, $title=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']
static gender( $parser, $username)
static pagenamee( $parser, $title=null)
static ns( $parser, $part1='')
static subjectpagename( $parser, $title=null)
static language( $parser, $code='', $inLanguage='')
Gives language names.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible true was required This is the default since MediaWiki *some string
static revisiontimestamp( $parser, $title=null)
Get the timestamp from the last revision of a specified page.
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 bidi( $parser, $text='')
static newFromTitle( $title)
Factory function.
Allows to change the fields on the form that will be generated $name
static urlencode( $parser, $s='', $arg=null)
urlencodes a string according to one of three patterns: (T24474)
static formatDate( $parser, $date, $defaultPref=null)
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
static fullpagename( $parser, $title=null)
get( $id)
Factory: creates an object representing an ID.
static padleft( $parser, $string='', $length=0, $padding='0')
static padright( $parser, $string='', $length=0, $padding='0')
static newFromURL( $url)
THIS IS NOT THE FUNCTION YOU WANT.
static revisionmonth( $parser, $title=null)
Get the month with leading zeros from the last revision of a specified page.
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
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
static subjectspacee( $parser, $title=null)
static speciale( $parser, $text)
static urlFunction( $func, $s='', $arg=null)
static lc( $parser, $s='')
static subjectspace( $parser, $title=null)
static subjectpagenamee( $parser, $title=null)
if the prop value should be in the metadata multi language array format
wfFindFile( $title, $options=[])
Find a file.
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
Represents a title within MediaWiki.
static numberofadmins( $parser, $raw=null)
static cascadingsources( $parser, $title='')
Returns the sources of any cascading protection acting on a specified page.
static anchorencode( $parser, $text)
static uc( $parser, $s='')
static special( $parser, $text)
static subpagenamee( $parser, $title=null)
static filepath( $parser, $name='', $argA='', $argB='')
Usage {{filepath|300}}, {{filepath|nowiki}}, {{filepath|nowiki|300}} or {{filepath|300|nowiki}} or {{...
static namespacee( $parser, $title=null)
static numberofarticles( $parser, $raw=null)
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
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
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
static bcp47( $code)
Get the normalised IETF language tag See unit test for examples.
Various core parser functions, registered in Parser::firstCallInit()
static subpagename( $parser, $title=null)
static revisionuser( $parser, $title=null)
Get the user from the last revision of a specified page.
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 numberingroup( $parser, $name='', $raw=null)
static numberofusers( $parser, $raw=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.
$wgAllowSlowParserFunctions
Enable slow parser functions.
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 MediaWikiServices
static numberoffiles( $parser, $raw=null)
static pagesinnamespace( $parser, $namespace=0, $raw=null)
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead 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 unset offset - wrap String Wrap the message in html(usually something like "<
$wgRestrictDisplayTitle
For consistency, restrict DISPLAYTITLE to text that normalizes to the same canonical DB key.
$wgAllowDisplayTitle
Allow DISPLAYTITLE to change title display.
static formatnum( $parser, $num='', $arg=null)
static lcfirst( $parser, $s='')
static canonicalurl( $parser, $s='', $arg=null)
this hook is for auditing only or null if authentication failed before getting that far $username
static getLocalInstance( $ts=false)
Get a timestamp instance in the server local timezone ($wgLocaltimezone)
static intFunction( $parser, $part1='')
static basepagename( $parser, $title=null)
static canonicalurle( $parser, $s='', $arg=null)
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
static localurl( $parser, $s='', $arg=null)
static talkpagenamee( $parser, $title=null)