73 $revid = $revision ? $revision->getId() :
null;
75 if ( $revid !==
null ) {
76 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
91 $oldid = $this->
page->getOldID();
93 $revision = $this->
page->getRevisionFetched();
96 if ( $revision ===
null ) {
97 return $this->
msg(
'missing-revision', $oldid )->parse();
101 if ( !$revision->isCurrent() ) {
102 return $this->
msg(
'pageinfo-not-current' )->plain();
107 if ( !$this->
msg(
'pageinfo-header' )->isDisabled() ) {
108 $content .= $this->
msg(
'pageinfo-header' )->parse();
112 $content .= Html::element(
'style', [],
113 '.mw-hiddenCategoriesExplanation { display: none; }' ) .
"\n";
116 $content .= Html::element(
'style', [],
117 '.mw-templatesUsedExplanation { display: none; }' ) .
"\n";
123 Hooks::run(
'InfoAction', [ $this->
getContext(), &$pageInfo ] );
126 foreach ( $pageInfo
as $header => $infoTable ) {
131 $this->
msg(
"pageinfo-${header}" )->escaped(),
132 "mw-pageinfo-${header}"
135 foreach ( $infoTable
as $infoRow ) {
136 $name = ( $infoRow[0] instanceof
Message ) ? $infoRow[0]->escaped() : $infoRow[0];
137 $value = ( $infoRow[1] instanceof
Message ) ? $infoRow[1]->escaped() : $infoRow[1];
138 $id = ( $infoRow[0] instanceof
Message ) ? $infoRow[0]->getKey() :
null;
141 $content = $this->
addTable( $content, $table ) .
"\n";
145 if ( !$this->
msg(
'pageinfo-footer' )->isDisabled() ) {
146 $content .= $this->
msg(
'pageinfo-footer' )->parse();
160 $spanAttribs = [
'class' =>
'mw-headline',
'id' => Sanitizer::escapeIdForAttribute(
$header ) ];
161 $h2Attribs = [
'id' => Sanitizer::escapeIdForAttribute( $canonicalId ) ];
163 return Html::rawElement(
'h2', $h2Attribs, Html::element(
'span', $spanAttribs,
$header ) );
179 $id ===
null ? [] : [
'id' =>
'mw-' . $id ],
180 Html::rawElement(
'td', [
'style' =>
'vertical-align: top;' ],
$name ) .
181 Html::rawElement(
'td', [],
$value )
193 return $content . Html::rawElement(
'table', [
'class' =>
'wikitable mw-page-info' ],
210 $id =
$title->getArticleID();
211 $config = $this->context->getConfig();
212 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
216 $pageProperties = [];
218 if ( isset( $props[$id] ) ) {
219 $pageProperties = $props[$id];
224 $pageInfo[
'header-basic'] = [];
227 $displayTitle =
$title->getPrefixedText();
228 if ( isset( $pageProperties[
'displaytitle'] ) ) {
229 $displayTitle = $pageProperties[
'displaytitle'];
232 $pageInfo[
'header-basic'][] = [
233 $this->
msg(
'pageinfo-display-title' ), $displayTitle
237 if (
$title->isRedirect() ) {
238 $pageInfo[
'header-basic'][] = [
239 $this->
msg(
'pageinfo-redirectsto' ),
241 $this->
msg(
'word-separator' )->escaped() .
243 $this->page->getRedirectTarget(),
244 $this->msg(
'pageinfo-redirectsto-info' )->text(),
246 [
'action' =>
'info' ]
252 $sortKey =
$title->getCategorySortkey();
253 if ( isset( $pageProperties[
'defaultsort'] ) ) {
254 $sortKey = $pageProperties[
'defaultsort'];
257 $sortKey = htmlspecialchars( $sortKey );
258 $pageInfo[
'header-basic'][] = [ $this->
msg(
'pageinfo-default-sort' ), $sortKey ];
261 $pageInfo[
'header-basic'][] = [
262 $this->
msg(
'pageinfo-length' ),
$lang->formatNum(
$title->getLength() )
266 $pageInfo[
'header-basic'][] = [ $this->
msg(
'pageinfo-article-id' ), $id ];
269 $pageLang =
$title->getPageLanguage()->getCode();
271 $pageLangHtml = $pageLang .
' - ' .
272 Language::fetchLanguageName( $pageLang,
$lang->getCode() );
274 if ( $config->get(
'PageLanguageUseDB' )
277 $pageLangHtml .=
' ' . $this->
msg(
'parentheses' )->rawParams(
$linkRenderer->makeLink(
279 $this->msg(
'pageinfo-language-change' )->text()
283 $pageInfo[
'header-basic'][] = [
284 $this->
msg(
'pageinfo-language' )->escaped(),
291 if ( $config->get(
'ContentHandlerUseDB' )
294 $modelHtml .=
' ' . $this->
msg(
'parentheses' )->rawParams(
$linkRenderer->makeLink(
296 $this->msg(
'pageinfo-content-model-change' )->text()
300 $pageInfo[
'header-basic'][] = [
301 $this->
msg(
'pageinfo-content-model' ),
306 $pageUser = User::newFromName(
$title->getRootText() );
307 if ( $pageUser && $pageUser->getId() && !$pageUser->isHidden() ) {
308 $pageInfo[
'header-basic'][] = [
309 $this->
msg(
'pageinfo-user-id' ),
317 if ( isset( $pageProperties[
'noindex'] ) ) {
318 $pOutput->setIndexPolicy(
'noindex' );
320 if ( isset( $pageProperties[
'index'] ) ) {
321 $pOutput->setIndexPolicy(
'index' );
325 $policy = $this->
page->getRobotPolicy(
'view', $pOutput );
326 $pageInfo[
'header-basic'][] = [
328 $this->
msg(
'pageinfo-robot-policy' ),
329 $this->
msg(
"pageinfo-robot-${policy['index']}" )
332 $unwatchedPageThreshold = $config->get(
'UnwatchedPageThreshold' );
334 $user->isAllowed(
'unwatchedpages' ) ||
335 ( $unwatchedPageThreshold !==
false &&
336 $pageCounts[
'watchers'] >= $unwatchedPageThreshold )
339 $pageInfo[
'header-basic'][] = [
340 $this->
msg(
'pageinfo-watchers' ),
341 $lang->formatNum( $pageCounts[
'watchers'] )
344 $config->get(
'ShowUpdatedMarker' ) &&
345 isset( $pageCounts[
'visitingWatchers'] )
347 $minToDisclose = $config->get(
'UnwatchedPageSecret' );
348 if ( $pageCounts[
'visitingWatchers'] > $minToDisclose ||
349 $user->isAllowed(
'unwatchedpages' ) ) {
350 $pageInfo[
'header-basic'][] = [
351 $this->
msg(
'pageinfo-visiting-watchers' ),
352 $lang->formatNum( $pageCounts[
'visitingWatchers'] )
355 $pageInfo[
'header-basic'][] = [
356 $this->
msg(
'pageinfo-visiting-watchers' ),
357 $this->
msg(
'pageinfo-few-visiting-watchers' )
361 } elseif ( $unwatchedPageThreshold !==
false ) {
362 $pageInfo[
'header-basic'][] = [
363 $this->
msg(
'pageinfo-watchers' ),
364 $this->
msg(
'pageinfo-few-watchers' )->numParams( $unwatchedPageThreshold )
370 $pageInfo[
'header-basic'][] = [
373 $this->
msg(
'pageinfo-redirects-name' )->
text(),
381 $this->
msg(
'pageinfo-redirects-value' )
382 ->numParams( count(
$title->getRedirectsHere() ) )
386 if ( $this->
page->isCountable() ) {
387 $pageInfo[
'header-basic'][] = [
388 $this->
msg(
'pageinfo-contentpage' ),
389 $this->
msg(
'pageinfo-contentpage-yes' )
394 if ( MWNamespace::hasSubpages(
$title->getNamespace() ) ) {
396 'Prefixindex',
$title->getPrefixedText() .
'/' );
397 $pageInfo[
'header-basic'][] = [
400 $this->
msg(
'pageinfo-subpages-name' )->
text()
402 $this->
msg(
'pageinfo-subpages-value' )
404 $pageCounts[
'subpages'][
'total'],
405 $pageCounts[
'subpages'][
'redirects'],
406 $pageCounts[
'subpages'][
'nonredirects'] )
411 $category = Category::newFromTitle(
$title );
415 $allCount = (int)$category->getPageCount();
416 $subcatCount = (int)$category->getSubcatCount();
417 $fileCount = (int)$category->getFileCount();
418 $pagesCount = $allCount - $subcatCount - $fileCount;
420 $pageInfo[
'category-info'] = [
422 $this->
msg(
'pageinfo-category-total' ),
423 $lang->formatNum( $allCount )
426 $this->
msg(
'pageinfo-category-pages' ),
427 $lang->formatNum( $pagesCount )
430 $this->
msg(
'pageinfo-category-subcats' ),
431 $lang->formatNum( $subcatCount )
434 $this->
msg(
'pageinfo-category-files' ),
435 $lang->formatNum( $fileCount )
441 $pageInfo[
'header-restrictions'] = [];
444 if (
$title->isCascadeProtected() ) {
446 $sources =
$title->getCascadeProtectionSources()[0];
448 foreach ( $sources
as $sourceTitle ) {
449 $cascadingFrom .= Html::rawElement(
453 $cascadingFrom = Html::rawElement(
'ul', [], $cascadingFrom );
454 $pageInfo[
'header-restrictions'][] = [
455 $this->
msg(
'pageinfo-protect-cascading-from' ),
461 if (
$title->areRestrictionsCascading() ) {
462 $pageInfo[
'header-restrictions'][] = [
463 $this->
msg(
'pageinfo-protect-cascading' ),
464 $this->
msg(
'pageinfo-protect-cascading-yes' )
469 foreach (
$title->getRestrictionTypes()
as $restrictionType ) {
470 $protectionLevel = implode(
', ',
$title->getRestrictions( $restrictionType ) );
472 if ( $protectionLevel ==
'' ) {
474 $message = $this->
msg(
'protect-default' )->escaped();
478 $message = $this->
msg(
"protect-level-$protectionLevel" );
479 if ( $message->isDisabled() ) {
481 $message = $this->
msg(
"protect-fallback", $protectionLevel )->parse();
483 $message = $message->escaped();
486 $expiry =
$title->getRestrictionExpiry( $restrictionType );
487 $formattedexpiry = $this->
msg(
'parentheses',
488 $lang->formatExpiry( $expiry ) )->escaped();
489 $message .= $this->
msg(
'word-separator' )->escaped() . $formattedexpiry;
493 $pageInfo[
'header-restrictions'][] = [
494 $this->
msg(
"restriction-$restrictionType" ), $message
498 if ( !$this->
page->exists() ) {
503 $pageInfo[
'header-edits'] = [];
505 $firstRev = $this->
page->getOldestRevision();
506 $lastRev = $this->
page->getRevision();
511 if ( $firstRevUser !==
'' ) {
512 $firstRevUserTitle = Title::makeTitle(
NS_USER, $firstRevUser );
513 $batch->addObj( $firstRevUserTitle );
514 $batch->addObj( $firstRevUserTitle->getTalkPage() );
520 if ( $lastRevUser !==
'' ) {
521 $lastRevUserTitle = Title::makeTitle(
NS_USER, $lastRevUser );
522 $batch->addObj( $lastRevUserTitle );
523 $batch->addObj( $lastRevUserTitle->getTalkPage() );
531 $pageInfo[
'header-edits'][] = [
532 $this->
msg(
'pageinfo-firstuser' ),
537 $pageInfo[
'header-edits'][] = [
538 $this->
msg(
'pageinfo-firsttime' ),
541 $lang->userTimeAndDate( $firstRev->getTimestamp(),
$user ),
543 [
'oldid' => $firstRev->getId() ]
550 $pageInfo[
'header-edits'][] = [
551 $this->
msg(
'pageinfo-lastuser' ),
556 $pageInfo[
'header-edits'][] = [
557 $this->
msg(
'pageinfo-lasttime' ),
560 $lang->userTimeAndDate( $this->page->getTimestamp(),
$user ),
562 [
'oldid' => $this->page->getLatest() ]
568 $pageInfo[
'header-edits'][] = [
569 $this->
msg(
'pageinfo-edits' ),
$lang->formatNum( $pageCounts[
'edits'] )
573 if ( $pageCounts[
'authors'] > 0 ) {
574 $pageInfo[
'header-edits'][] = [
575 $this->
msg(
'pageinfo-authors' ),
$lang->formatNum( $pageCounts[
'authors'] )
580 $pageInfo[
'header-edits'][] = [
581 $this->
msg(
'pageinfo-recent-edits',
582 $lang->formatDuration( $config->get(
'RCMaxAge' ) ) ),
583 $lang->formatNum( $pageCounts[
'recent_edits'] )
587 $pageInfo[
'header-edits'][] = [
588 $this->
msg(
'pageinfo-recent-authors' ),
589 $lang->formatNum( $pageCounts[
'recent_authors'] )
604 $listItems[] = Html::element(
'li', [], $localizedWords[
$property][1] );
608 $localizedList = Html::rawElement(
'ul', [], implode(
'', $listItems ) );
609 $hiddenCategories = $this->
page->getHiddenCategories();
612 count( $listItems ) > 0 ||
613 count( $hiddenCategories ) > 0 ||
614 $pageCounts[
'transclusion'][
'from'] > 0 ||
615 $pageCounts[
'transclusion'][
'to'] > 0
617 $options = [
'LIMIT' => $config->get(
'PageInfoTransclusionLimit' ) ];
619 if ( $config->get(
'MiserMode' ) ) {
620 $transcludedTargets = [];
626 $pageInfo[
'header-properties'] = [];
629 if ( count( $listItems ) > 0 ) {
630 $pageInfo[
'header-properties'][] = [
631 $this->
msg(
'pageinfo-magic-words' )->numParams( count( $listItems ) ),
637 if ( count( $hiddenCategories ) > 0 ) {
638 $pageInfo[
'header-properties'][] = [
639 $this->
msg(
'pageinfo-hidden-categories' )
640 ->numParams( count( $hiddenCategories ) ),
646 if ( $pageCounts[
'transclusion'][
'from'] > 0 ) {
647 if ( $pageCounts[
'transclusion'][
'from'] > count( $transcludedTemplates ) ) {
648 $more = $this->
msg(
'morenotlisted' )->escaped();
658 $pageInfo[
'header-properties'][] = [
659 $this->
msg(
'pageinfo-templates' )
660 ->numParams( $pageCounts[
'transclusion'][
'from'] ),
661 $templateListFormatter->format( $transcludedTemplates,
false, $more )
665 if ( !$config->get(
'MiserMode' ) && $pageCounts[
'transclusion'][
'to'] > 0 ) {
666 if ( $pageCounts[
'transclusion'][
'to'] > count( $transcludedTargets ) ) {
669 $this->
msg(
'moredotdotdot' )->
text(),
671 [
'hidelinks' => 1,
'hideredirs' => 1 ]
682 $pageInfo[
'header-properties'][] = [
683 $this->
msg(
'pageinfo-transclusions' )
684 ->numParams( $pageCounts[
'transclusion'][
'to'] ),
685 $templateListFormatter->format( $transcludedTargets,
false, $more )
701 $config = $this->context->getConfig();
702 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
704 return $cache->getWithSetCallback(
706 WANObjectCache::TTL_WEEK,
709 $id =
$title->getArticleID();
713 $setOpts += Database::getCacheSetOptions(
$dbr, $dbrWatchlist );
715 $watchedItemStore = MediaWikiServices::getInstance()->getWatchedItemStore();
718 $result[
'watchers'] = $watchedItemStore->countWatchers(
$title );
720 if ( $config->get(
'ShowUpdatedMarker' ) ) {
722 $result[
'visitingWatchers'] = $watchedItemStore->countVisitingWatchers(
724 $updated - $config->get(
'WatchersMaxAge' )
729 $edits = (int)
$dbr->selectField(
732 [
'rev_page' => $id ],
738 if ( $config->get(
'MiserMode' ) ) {
743 'COUNT(DISTINCT rev_user_text)',
744 [
'rev_page' => $id ],
750 $threshold =
$dbr->timestamp( time() - $config->get(
'RCMaxAge' ) );
753 $edits = (int)
$dbr->selectField(
758 "rev_timestamp >= " .
$dbr->addQuotes( $threshold )
762 $result[
'recent_edits'] = $edits;
765 $result[
'recent_authors'] = (int)
$dbr->selectField(
767 'COUNT(DISTINCT rev_user_text)',
770 "rev_timestamp >= " .
$dbr->addQuotes( $threshold )
776 if ( MWNamespace::hasSubpages(
$title->getNamespace() ) ) {
777 $conds = [
'page_namespace' =>
$title->getNamespace() ];
778 $conds[] =
'page_title ' .
782 $conds[
'page_is_redirect'] = 1;
783 $result[
'subpages'][
'redirects'] = (int)
$dbr->selectField(
791 $conds[
'page_is_redirect'] = 0;
792 $result[
'subpages'][
'nonredirects'] = (int)
$dbr->selectField(
801 +
$result[
'subpages'][
'nonredirects'];
805 if ( $config->get(
'MiserMode' ) ) {
806 $result[
'transclusion'][
'to'] = 0;
808 $result[
'transclusion'][
'to'] = (int)
$dbr->selectField(
812 'tl_namespace' =>
$title->getNamespace(),
813 'tl_title' =>
$title->getDBkey()
819 $result[
'transclusion'][
'from'] = (int)
$dbr->selectField(
822 [
'tl_from' =>
$title->getArticleID() ],
837 return $this->
msg(
'pageinfo-title', $this->
getTitle()->getPrefixedText() )->text();
849 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
851 # Sift for real versus user names
856 :
$user->getUserPage();
858 $hiddenPrefs = $this->context->getConfig()->get(
'HiddenPrefs' );
859 if (
$user->getId() == 0 ) {
861 } elseif ( !in_array(
'realname', $hiddenPrefs ) &&
$user->getRealName() ) {
870 $real =
$lang->listToText( $real_names );
872 # "ThisSite user(s) A, B and C"
873 if ( count( $user_names ) ) {
875 ->rawParams(
$lang->listToText( $user_names ) )
876 ->params( count( $user_names ) )->escaped();
881 if ( count( $anon_ips ) ) {
882 $anon = $this->
msg(
'anonusers' )
883 ->rawParams(
$lang->listToText( $anon_ips ) )
884 ->params( count( $anon_ips ) )->escaped();
889 # This is the big list, all mooshed together. We sift for blank strings
891 foreach ( [ $real,
$user, $anon ]
as $s ) {
893 array_push( $fulllist,
$s );
897 $count = count( $fulllist );
899 # "Based on work by ..."
901 ? $this->
msg(
'othercontribs' )->rawParams(
902 $lang->listToText( $fulllist ) )->params( $count )->escaped()
922 return $cache->makeKey(
'infoaction', md5(
$title->getPrefixedText() ), $revId, self::VERSION );
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
if(!defined( 'MEDIAWIKI')) $fname
This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined.
$page
Page on which we're performing the action.
getTitle()
Shortcut to get the Title object from the page.
getContext()
Get the IContextSource in use here.
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
getUser()
Shortcut to get the User being used for this instance.
getLanguage()
Shortcut to get the user Language being used for this instance.
static getLocalizedName( $name, Language $lang=null)
Returns the localized name for a given content model.
Displays information about a page.
requiresWrite()
Whether this action requires the wiki not to be locked.
makeHeader( $header, $canonicalId)
Creates a header that can be added to the output.
getPageTitle()
Returns the name that goes in the "<h1>" page title.
pageInfo()
Returns page information in an easily-manipulated format.
pageCounts(Page $page)
Returns page counts that would be too "expensive" to retrieve by normal means.
onView()
Shows page information on GET request.
getDescription()
Returns the description that goes below the "<h1>" tag.
requiresUnblock()
Whether this action can still be executed by a blocked user.
getName()
Returns the name of the action this object responds to.
addRow( $table, $name, $value, $id)
Adds a row to a table that will be added to the content.
addTable( $content, $table)
Adds a table to the content that will be added to the output.
static getCacheKey(WANObjectCache $cache, Title $title, $revId)
static invalidateCache(Title $title, $revid=null)
Clear the info cache for a given Title.
getContributors()
Get a list of contributors of $article.
Class representing a list of titles The execute() method checks them all for existence and adds them ...
static revUserTools( $rev, $isPublic=false)
Generate a user tool link cluster if the current user is allowed to view it.
static formatHiddenCategories( $hiddencats)
Returns HTML for the "hidden categories on this page" list.
static getDoubleUnderscoreArray()
Get a MagicWordArray of double-underscore entities.
The Message class provides methods which fulfil two basic services:
static newFromTitle(LinkTarget $linkTarget, $id=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given link target.
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 getTitleValueFor( $name, $subpage=false, $fragment='')
Get a localised TitleValue object for a specified special page name.
Handles formatting for the "templates used on this page" lists.
Represents a title within MediaWiki.
Multi-datacenter aware caching interface.
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
when a variable name is used in a function
when a variable name is used in a it is silently declared as a new local masking the global
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
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
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page. Return false to stop further processing of the tag $reader:XMLReader object & $pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. & $fullInterwikiPrefix:Interwiki prefix, may contain colons. & $pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. & $importSources:The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. & $title:Title object for the current page & $request:WebRequest & $ignoreRedirect:boolean to skip redirect check & $target:Title/string of redirect target & $article:Article object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) & $article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetMagic':DEPRECATED! Use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language & $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetSpecialPageAliases':DEPRECATED! Use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language & $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Array with elements of the form "language:title" in the order that they will be output. & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED! Use HtmlPageLinkRendererBegin instead. Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
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 & $options
namespace and then decline to actually register it file or subcat img or subcat $title
Allows to change the fields on the form that will be generated $name
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 before processing starts Return false to skip default processing and return $ret $linkRenderer
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
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
Interface for type hinting (accepts WikiPage, Article, ImagePage, CategoryPage)
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']
if(!isset( $args[0])) $lang