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}" )->
text(),
132 "mw-pageinfo-${header}"
136 foreach ( $infoTable
as $infoRow ) {
137 if ( $infoRow[0] ==
"below" ) {
138 $below = $infoRow[1] .
"\n";
141 $name = ( $infoRow[0] instanceof
Message ) ? $infoRow[0]->escaped() : $infoRow[0];
142 $value = ( $infoRow[1] instanceof
Message ) ? $infoRow[1]->escaped() : $infoRow[1];
143 $id = ( $infoRow[0] instanceof
Message ) ? $infoRow[0]->getKey() :
null;
150 if ( !$this->
msg(
'pageinfo-footer' )->isDisabled() ) {
151 $content .= $this->
msg(
'pageinfo-footer' )->parse();
165 $spanAttribs = [
'class' =>
'mw-headline',
'id' => Sanitizer::escapeIdForAttribute(
$header ) ];
166 $h2Attribs = [
'id' => Sanitizer::escapeIdForAttribute( $canonicalId ) ];
168 return Html::rawElement(
'h2', $h2Attribs, Html::element(
'span', $spanAttribs,
$header ) );
184 $id ===
null ? [] : [
'id' =>
'mw-' . $id ],
185 Html::rawElement(
'td', [
'style' =>
'vertical-align: top;' ],
$name ) .
186 Html::rawElement(
'td', [],
$value )
198 return $content . Html::rawElement(
'table', [
'class' =>
'wikitable mw-page-info' ],
215 $services = MediaWikiServices::getInstance();
220 $id =
$title->getArticleID();
221 $config = $this->context->getConfig();
227 $pageProperties = $props[$id] ?? [];
231 $pageInfo[
'header-basic'] = [];
234 $displayTitle = $pageProperties[
'displaytitle'] ??
$title->getPrefixedText();
236 $pageInfo[
'header-basic'][] = [
237 $this->
msg(
'pageinfo-display-title' ), $displayTitle
241 $redirectTarget = $this->
page->getRedirectTarget();
242 if ( $redirectTarget !==
null ) {
243 $pageInfo[
'header-basic'][] = [
244 $this->
msg(
'pageinfo-redirectsto' ),
246 $this->
msg(
'word-separator' )->escaped() .
249 $this->msg(
'pageinfo-redirectsto-info' )->text(),
251 [
'action' =>
'info' ]
257 $sortKey = $pageProperties[
'defaultsort'] ??
$title->getCategorySortkey();
259 $sortKey = htmlspecialchars( $sortKey );
260 $pageInfo[
'header-basic'][] = [ $this->
msg(
'pageinfo-default-sort' ), $sortKey ];
263 $pageInfo[
'header-basic'][] = [
264 $this->
msg(
'pageinfo-length' ),
$lang->formatNum(
$title->getLength() )
268 $pageInfo[
'header-basic'][] = [ $this->
msg(
'pageinfo-article-id' ), $id ];
271 $pageLang =
$title->getPageLanguage()->getCode();
273 $pageLangHtml = $pageLang .
' - ' .
274 Language::fetchLanguageName( $pageLang,
$lang->getCode() );
276 if ( $config->get(
'PageLanguageUseDB' )
279 $pageLangHtml .=
' ' . $this->
msg(
'parentheses' )->rawParams(
$linkRenderer->makeLink(
280 SpecialPage::getTitleValueFor(
'PageLanguage',
$title->getPrefixedText() ),
281 $this->msg(
'pageinfo-language-change' )->text()
285 $pageInfo[
'header-basic'][] = [
286 $this->
msg(
'pageinfo-language' )->escaped(),
291 $modelHtml = htmlspecialchars( ContentHandler::getLocalizedName(
$title->getContentModel() ) );
293 if ( $config->get(
'ContentHandlerUseDB' )
296 $modelHtml .=
' ' . $this->
msg(
'parentheses' )->rawParams(
$linkRenderer->makeLink(
297 SpecialPage::getTitleValueFor(
'ChangeContentModel',
$title->getPrefixedText() ),
298 $this->msg(
'pageinfo-content-model-change' )->text()
302 $pageInfo[
'header-basic'][] = [
303 $this->
msg(
'pageinfo-content-model' ),
309 if ( $pageUser && $pageUser->getId() && !$pageUser->isHidden() ) {
310 $pageInfo[
'header-basic'][] = [
311 $this->
msg(
'pageinfo-user-id' ),
319 if ( isset( $pageProperties[
'noindex'] ) ) {
320 $pOutput->setIndexPolicy(
'noindex' );
322 if ( isset( $pageProperties[
'index'] ) ) {
323 $pOutput->setIndexPolicy(
'index' );
327 $policy = $this->
page->getRobotPolicy(
'view', $pOutput );
328 $pageInfo[
'header-basic'][] = [
330 $this->
msg(
'pageinfo-robot-policy' ),
331 $this->
msg(
"pageinfo-robot-${policy['index']}" )
334 $unwatchedPageThreshold = $config->get(
'UnwatchedPageThreshold' );
336 $user->isAllowed(
'unwatchedpages' ) ||
337 ( $unwatchedPageThreshold !==
false &&
338 $pageCounts[
'watchers'] >= $unwatchedPageThreshold )
341 $pageInfo[
'header-basic'][] = [
342 $this->
msg(
'pageinfo-watchers' ),
343 $lang->formatNum( $pageCounts[
'watchers'] )
346 $config->get(
'ShowUpdatedMarker' ) &&
347 isset( $pageCounts[
'visitingWatchers'] )
349 $minToDisclose = $config->get(
'UnwatchedPageSecret' );
350 if ( $pageCounts[
'visitingWatchers'] > $minToDisclose ||
351 $user->isAllowed(
'unwatchedpages' ) ) {
352 $pageInfo[
'header-basic'][] = [
353 $this->
msg(
'pageinfo-visiting-watchers' ),
354 $lang->formatNum( $pageCounts[
'visitingWatchers'] )
357 $pageInfo[
'header-basic'][] = [
358 $this->
msg(
'pageinfo-visiting-watchers' ),
359 $this->
msg(
'pageinfo-few-visiting-watchers' )
363 } elseif ( $unwatchedPageThreshold !==
false ) {
364 $pageInfo[
'header-basic'][] = [
365 $this->
msg(
'pageinfo-watchers' ),
366 $this->
msg(
'pageinfo-few-watchers' )->numParams( $unwatchedPageThreshold )
371 $whatLinksHere = SpecialPage::getTitleFor(
'Whatlinkshere',
$title->getPrefixedText() );
372 $pageInfo[
'header-basic'][] = [
375 $this->
msg(
'pageinfo-redirects-name' )->
text(),
383 $this->
msg(
'pageinfo-redirects-value' )
384 ->numParams( count(
$title->getRedirectsHere() ) )
388 if ( $this->
page->isCountable() ) {
389 $pageInfo[
'header-basic'][] = [
390 $this->
msg(
'pageinfo-contentpage' ),
391 $this->
msg(
'pageinfo-contentpage-yes' )
396 if ( MWNamespace::hasSubpages(
$title->getNamespace() ) ) {
397 $prefixIndex = SpecialPage::getTitleFor(
398 'Prefixindex',
$title->getPrefixedText() .
'/' );
399 $pageInfo[
'header-basic'][] = [
402 $this->
msg(
'pageinfo-subpages-name' )->
text()
404 $this->
msg(
'pageinfo-subpages-value' )
406 $pageCounts[
'subpages'][
'total'],
407 $pageCounts[
'subpages'][
'redirects'],
408 $pageCounts[
'subpages'][
'nonredirects'] )
413 $category = Category::newFromTitle(
$title );
417 $allCount = (int)$category->getPageCount();
418 $subcatCount = (int)$category->getSubcatCount();
419 $fileCount = (int)$category->getFileCount();
420 $pagesCount = $allCount - $subcatCount - $fileCount;
422 $pageInfo[
'category-info'] = [
424 $this->
msg(
'pageinfo-category-total' ),
425 $lang->formatNum( $allCount )
428 $this->
msg(
'pageinfo-category-pages' ),
429 $lang->formatNum( $pagesCount )
432 $this->
msg(
'pageinfo-category-subcats' ),
433 $lang->formatNum( $subcatCount )
436 $this->
msg(
'pageinfo-category-files' ),
437 $lang->formatNum( $fileCount )
445 if ( $fileObj !==
false ) {
447 $output = Wikimedia\base_convert( $fileObj->getSha1(), 36, 16, 40 );
448 $pageInfo[
'header-basic'][] = [
449 $this->
msg(
'pageinfo-file-hash' ),
456 $pageInfo[
'header-restrictions'] = [];
459 if (
$title->isCascadeProtected() ) {
461 $sources =
$title->getCascadeProtectionSources()[0];
463 foreach ( $sources
as $sourceTitle ) {
464 $cascadingFrom .= Html::rawElement(
468 $cascadingFrom = Html::rawElement(
'ul', [], $cascadingFrom );
469 $pageInfo[
'header-restrictions'][] = [
470 $this->
msg(
'pageinfo-protect-cascading-from' ),
476 if (
$title->areRestrictionsCascading() ) {
477 $pageInfo[
'header-restrictions'][] = [
478 $this->
msg(
'pageinfo-protect-cascading' ),
479 $this->
msg(
'pageinfo-protect-cascading-yes' )
484 foreach (
$title->getRestrictionTypes()
as $restrictionType ) {
485 $protectionLevel = implode(
', ',
$title->getRestrictions( $restrictionType ) );
487 if ( $protectionLevel ==
'' ) {
489 $message = $this->
msg(
'protect-default' )->escaped();
493 $message = $this->
msg(
"protect-level-$protectionLevel" );
494 if ( $message->isDisabled() ) {
496 $message = $this->
msg(
"protect-fallback", $protectionLevel )->parse();
498 $message = $message->escaped();
501 $expiry =
$title->getRestrictionExpiry( $restrictionType );
502 $formattedexpiry = $this->
msg(
'parentheses',
503 $lang->formatExpiry( $expiry ) )->escaped();
504 $message .= $this->
msg(
'word-separator' )->escaped() . $formattedexpiry;
508 $pageInfo[
'header-restrictions'][] = [
509 $this->
msg(
"restriction-$restrictionType" ), $message
512 $protectLog = SpecialPage::getTitleFor(
'Log' );
513 $pageInfo[
'header-restrictions'][] = [
517 $this->
msg(
'pageinfo-view-protect-log' )->
text(),
519 [
'type' =>
'protect',
'page' =>
$title->getPrefixedText() ]
523 if ( !$this->
page->exists() ) {
528 $pageInfo[
'header-edits'] = [];
530 $firstRev = $this->
page->getOldestRevision();
531 $lastRev = $this->
page->getRevision();
536 if ( $firstRevUser !==
'' ) {
537 $firstRevUserTitle = Title::makeTitle(
NS_USER, $firstRevUser );
538 $batch->addObj( $firstRevUserTitle );
539 $batch->addObj( $firstRevUserTitle->getTalkPage() );
545 if ( $lastRevUser !==
'' ) {
546 $lastRevUserTitle = Title::makeTitle(
NS_USER, $lastRevUser );
547 $batch->addObj( $lastRevUserTitle );
548 $batch->addObj( $lastRevUserTitle->getTalkPage() );
556 $pageInfo[
'header-edits'][] = [
557 $this->
msg(
'pageinfo-firstuser' ),
562 $pageInfo[
'header-edits'][] = [
563 $this->
msg(
'pageinfo-firsttime' ),
566 $lang->userTimeAndDate( $firstRev->getTimestamp(),
$user ),
568 [
'oldid' => $firstRev->getId() ]
575 $pageInfo[
'header-edits'][] = [
576 $this->
msg(
'pageinfo-lastuser' ),
581 $pageInfo[
'header-edits'][] = [
582 $this->
msg(
'pageinfo-lasttime' ),
585 $lang->userTimeAndDate( $this->page->getTimestamp(),
$user ),
587 [
'oldid' => $this->page->getLatest() ]
593 $pageInfo[
'header-edits'][] = [
594 $this->
msg(
'pageinfo-edits' ),
$lang->formatNum( $pageCounts[
'edits'] )
598 if ( $pageCounts[
'authors'] > 0 ) {
599 $pageInfo[
'header-edits'][] = [
600 $this->
msg(
'pageinfo-authors' ),
$lang->formatNum( $pageCounts[
'authors'] )
605 $pageInfo[
'header-edits'][] = [
606 $this->
msg(
'pageinfo-recent-edits',
607 $lang->formatDuration( $config->get(
'RCMaxAge' ) ) ),
608 $lang->formatNum( $pageCounts[
'recent_edits'] )
612 $pageInfo[
'header-edits'][] = [
613 $this->
msg(
'pageinfo-recent-authors' ),
614 $lang->formatNum( $pageCounts[
'recent_authors'] )
629 $listItems[] = Html::element(
'li', [], $localizedWords[
$property][1] );
633 $localizedList = Html::rawElement(
'ul', [], implode(
'', $listItems ) );
634 $hiddenCategories = $this->
page->getHiddenCategories();
637 count( $listItems ) > 0 ||
638 count( $hiddenCategories ) > 0 ||
639 $pageCounts[
'transclusion'][
'from'] > 0 ||
640 $pageCounts[
'transclusion'][
'to'] > 0
642 $options = [
'LIMIT' => $config->get(
'PageInfoTransclusionLimit' ) ];
644 if ( $config->get(
'MiserMode' ) ) {
645 $transcludedTargets = [];
651 $pageInfo[
'header-properties'] = [];
654 if ( count( $listItems ) > 0 ) {
655 $pageInfo[
'header-properties'][] = [
656 $this->
msg(
'pageinfo-magic-words' )->numParams( count( $listItems ) ),
662 if ( count( $hiddenCategories ) > 0 ) {
663 $pageInfo[
'header-properties'][] = [
664 $this->
msg(
'pageinfo-hidden-categories' )
665 ->numParams( count( $hiddenCategories ) ),
671 if ( $pageCounts[
'transclusion'][
'from'] > 0 ) {
672 if ( $pageCounts[
'transclusion'][
'from'] > count( $transcludedTemplates ) ) {
673 $more = $this->
msg(
'morenotlisted' )->escaped();
683 $pageInfo[
'header-properties'][] = [
684 $this->
msg(
'pageinfo-templates' )
685 ->numParams( $pageCounts[
'transclusion'][
'from'] ),
686 $templateListFormatter->format( $transcludedTemplates,
false, $more )
690 if ( !$config->get(
'MiserMode' ) && $pageCounts[
'transclusion'][
'to'] > 0 ) {
691 if ( $pageCounts[
'transclusion'][
'to'] > count( $transcludedTargets ) ) {
694 $this->
msg(
'moredotdotdot' )->
text(),
696 [
'hidelinks' => 1,
'hideredirs' => 1 ]
707 $pageInfo[
'header-properties'][] = [
708 $this->
msg(
'pageinfo-transclusions' )
709 ->numParams( $pageCounts[
'transclusion'][
'to'] ),
710 $templateListFormatter->format( $transcludedTargets,
false, $more )
726 $config = $this->context->getConfig();
727 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
729 return $cache->getWithSetCallback(
731 WANObjectCache::TTL_WEEK,
736 $id =
$title->getArticleID();
740 $setOpts += Database::getCacheSetOptions(
$dbr, $dbrWatchlist );
743 $tables = [
'revision_actor_temp' ];
744 $field =
'revactor_actor';
745 $pageField =
'revactor_page';
746 $tsField =
'revactor_timestamp';
750 $field =
'rev_user_text';
751 $pageField =
'rev_page';
752 $tsField =
'rev_timestamp';
756 $watchedItemStore = MediaWikiServices::getInstance()->getWatchedItemStore();
759 $result[
'watchers'] = $watchedItemStore->countWatchers(
$title );
761 if ( $config->get(
'ShowUpdatedMarker' ) ) {
763 $result[
'visitingWatchers'] = $watchedItemStore->countVisitingWatchers(
765 $updated - $config->get(
'WatchersMaxAge' )
770 $edits = (int)
$dbr->selectField(
773 [
'rev_page' => $id ],
779 if ( $config->get(
'MiserMode' ) ) {
784 "COUNT(DISTINCT $field)",
785 [ $pageField => $id ],
793 $threshold =
$dbr->timestamp( time() - $config->get(
'RCMaxAge' ) );
796 $edits = (int)
$dbr->selectField(
801 "rev_timestamp >= " .
$dbr->addQuotes( $threshold )
805 $result[
'recent_edits'] = $edits;
808 $result[
'recent_authors'] = (int)
$dbr->selectField(
810 "COUNT(DISTINCT $field)",
813 "$tsField >= " .
$dbr->addQuotes( $threshold )
821 if ( MWNamespace::hasSubpages(
$title->getNamespace() ) ) {
822 $conds = [
'page_namespace' =>
$title->getNamespace() ];
823 $conds[] =
'page_title ' .
827 $conds[
'page_is_redirect'] = 1;
828 $result[
'subpages'][
'redirects'] = (int)
$dbr->selectField(
836 $conds[
'page_is_redirect'] = 0;
837 $result[
'subpages'][
'nonredirects'] = (int)
$dbr->selectField(
846 +
$result[
'subpages'][
'nonredirects'];
850 if ( $config->get(
'MiserMode' ) ) {
851 $result[
'transclusion'][
'to'] = 0;
853 $result[
'transclusion'][
'to'] = (int)
$dbr->selectField(
857 'tl_namespace' =>
$title->getNamespace(),
858 'tl_title' =>
$title->getDBkey()
864 $result[
'transclusion'][
'from'] = (int)
$dbr->selectField(
867 [
'tl_from' =>
$title->getArticleID() ],
882 return $this->
msg(
'pageinfo-title', $this->
getTitle()->getPrefixedText() )->text();
894 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
896 # Sift for real versus user names
900 ? SpecialPage::getTitleFor(
'Contributions',
$user->getName() )
901 :
$user->getUserPage();
903 $hiddenPrefs = $this->context->getConfig()->get(
'HiddenPrefs' );
904 if (
$user->getId() == 0 ) {
906 } elseif ( !in_array(
'realname', $hiddenPrefs ) &&
$user->getRealName() ) {
915 $real =
$lang->listToText( $real_names );
917 # "ThisSite user(s) A, B and C"
918 if ( count( $user_names ) ) {
920 ->rawParams(
$lang->listToText( $user_names ) )
921 ->params( count( $user_names ) )->escaped();
926 if ( count( $anon_ips ) ) {
927 $anon = $this->
msg(
'anonusers' )
928 ->rawParams(
$lang->listToText( $anon_ips ) )
929 ->params( count( $anon_ips ) )->escaped();
934 # This is the big list, all mooshed together. We sift for blank strings
936 foreach ( [ $real,
$user, $anon ]
as $s ) {
938 array_push( $fulllist,
$s );
942 $count = count( $fulllist );
944 # "Based on work by ..."
946 ? $this->
msg(
'othercontribs' )->rawParams(
947 $lang->listToText( $fulllist ) )->params( $count )->escaped()
967 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
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
int $wgActorTableSchemaMigrationStage
Actor table schema migration stage.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfFindFile( $title, $options=[])
Find a file.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
if(defined( 'MW_SETUP_CALLBACK')) $fname
Customization point after all loading (constants, functions, classes, DefaultSettings,...
$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.
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 an array of info groups (will be rendered as tables), keyed by group ID.
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.
The Message class provides methods which fulfil two basic services:
getMagicWordFactory()
Get the MagicWordFactory that this Parser is using.
getContentLanguage()
Get the content language that this Parser is using.
static newFromTitle(LinkTarget $linkTarget, $id=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given link target.
Handles formatting for the "templates used on this page" lists.
Represents a title within MediaWiki.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Multi-datacenter aware caching interface.
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
const SCHEMA_COMPAT_READ_NEW
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. 'ImgAuthModifyHeaders':Executed just before a file is streamed to a user via img_auth.php, allowing headers to be modified beforehand. $title:LinkTarget object & $headers:HTTP headers(name=> value, names are case insensitive). Two headers get special handling:If-Modified-Since(value must be a valid HTTP date) and Range(must be of the form "bytes=(\d*-\d*)") will be honored when streaming the file. '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 'ImportHandleUnknownUser':When a user doesn 't exist locally, this hook is called to give extensions an opportunity to auto-create it. If the auto-creation is successful, return false. $name:User name '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 since 1.16! 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 since 1.28! 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
this hook is for auditing only RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist & $tables
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title e g db for database replication lag or jobqueue for job queue size converted to pseudo seconds It is possible to add more fields and they will be returned to the user in the API response after the basic globals have been set but before ordinary actions take place or wrap services the preferred way to define a new service is the $wgServiceWiringFiles array $services
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
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title e g db for database replication lag or jobqueue for job queue size converted to pseudo seconds It is possible to add more fields and they will be returned to the user in the API response after the basic globals have been set but before ordinary actions take place $output
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 function
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