72 $revid = $revision ? $revision->getId() : null;
74 if ( $revid !== null ) {
75 $key = self::getCacheKey( $title, $revid );
89 $oldid = $this->
page->getOldID();
91 $revision = $this->
page->getRevisionFetched();
94 if ( $revision === null ) {
95 return $this->
msg(
'missing-revision', $oldid )->parse();
99 if ( !$revision->isCurrent() ) {
100 return $this->
msg(
'pageinfo-not-current' )->plain();
105 if ( !$this->
msg(
'pageinfo-header' )->isDisabled() ) {
106 $content .= $this->
msg(
'pageinfo-header' )->parse();
111 '.mw-hiddenCategoriesExplanation { display: none; }' ) .
"\n";
115 '.mw-templatesUsedExplanation { display: none; }' ) .
"\n";
124 foreach ( $pageInfo
as $header => $infoTable ) {
130 foreach ( $infoTable
as $infoRow ) {
131 $name = ( $infoRow[0] instanceof
Message ) ? $infoRow[0]->escaped() : $infoRow[0];
132 $value = ( $infoRow[1] instanceof
Message ) ? $infoRow[1]->escaped() : $infoRow[1];
133 $id = ( $infoRow[0] instanceof
Message ) ? $infoRow[0]->getKey() : null;
140 if ( !$this->
msg(
'pageinfo-footer' )->isDisabled() ) {
141 $content .= $this->
msg(
'pageinfo-footer' )->parse();
172 $id === null ? [] : [
'id' =>
'mw-' . $id ],
203 $id =
$title->getArticleID();
204 $config = $this->context->getConfig();
208 $pageProperties = [];
210 if ( isset( $props[$id] ) ) {
211 $pageProperties = $props[$id];
216 $pageInfo[
'header-basic'] = [];
219 $displayTitle =
$title->getPrefixedText();
220 if ( isset( $pageProperties[
'displaytitle'] ) ) {
221 $displayTitle = $pageProperties[
'displaytitle'];
224 $pageInfo[
'header-basic'][] = [
225 $this->
msg(
'pageinfo-display-title' ), $displayTitle
230 $pageInfo[
'header-basic'][] = [
231 $this->
msg(
'pageinfo-redirectsto' ),
233 $this->
msg(
'word-separator' )->escaped() .
235 $this->
page->getRedirectTarget(),
236 $this->
msg(
'pageinfo-redirectsto-info' )->escaped(),
238 [
'action' =>
'info' ]
244 $sortKey =
$title->getCategorySortkey();
245 if ( isset( $pageProperties[
'defaultsort'] ) ) {
246 $sortKey = $pageProperties[
'defaultsort'];
249 $sortKey = htmlspecialchars( $sortKey );
250 $pageInfo[
'header-basic'][] = [ $this->
msg(
'pageinfo-default-sort' ), $sortKey ];
253 $pageInfo[
'header-basic'][] = [
254 $this->
msg(
'pageinfo-length' ),
$lang->formatNum(
$title->getLength() )
258 $pageInfo[
'header-basic'][] = [ $this->
msg(
'pageinfo-article-id' ), $id ];
261 $pageLang =
$title->getPageLanguage()->getCode();
263 if ( $config->get(
'PageLanguageUseDB' )
270 $this->
msg(
'pageinfo-language' )->escaped()
274 $langDisp = $this->
msg(
'pageinfo-language' )->escaped();
277 $pageInfo[
'header-basic'][] = [ $langDisp,
279 .
' ' . $this->
msg(
'parentheses', $pageLang )->escaped() ];
282 $pageInfo[
'header-basic'][] = [
283 $this->
msg(
'pageinfo-content-model' ),
284 htmlspecialchars( ContentHandler::getLocalizedName(
$title->getContentModel() ) )
289 if ( isset( $pageProperties[
'noindex'] ) ) {
290 $pOutput->setIndexPolicy(
'noindex' );
292 if ( isset( $pageProperties[
'index'] ) ) {
293 $pOutput->setIndexPolicy(
'index' );
297 $policy = $this->
page->getRobotPolicy(
'view', $pOutput );
298 $pageInfo[
'header-basic'][] = [
300 $this->
msg(
'pageinfo-robot-policy' ),
301 $this->
msg(
"pageinfo-robot-${policy['index']}" )
304 $unwatchedPageThreshold = $config->get(
'UnwatchedPageThreshold' );
306 $user->isAllowed(
'unwatchedpages' ) ||
307 ( $unwatchedPageThreshold !==
false &&
308 $pageCounts[
'watchers'] >= $unwatchedPageThreshold )
311 $pageInfo[
'header-basic'][] = [
312 $this->
msg(
'pageinfo-watchers' ),
313 $lang->formatNum( $pageCounts[
'watchers'] )
316 $config->get(
'ShowUpdatedMarker' ) &&
317 isset( $pageCounts[
'visitingWatchers'] )
319 $minToDisclose = $config->get(
'UnwatchedPageSecret' );
320 if ( $pageCounts[
'visitingWatchers'] > $minToDisclose ||
321 $user->isAllowed(
'unwatchedpages' ) ) {
322 $pageInfo[
'header-basic'][] = [
323 $this->
msg(
'pageinfo-visiting-watchers' ),
324 $lang->formatNum( $pageCounts[
'visitingWatchers'] )
327 $pageInfo[
'header-basic'][] = [
328 $this->
msg(
'pageinfo-visiting-watchers' ),
329 $this->
msg(
'pageinfo-few-visiting-watchers' )
333 } elseif ( $unwatchedPageThreshold !==
false ) {
334 $pageInfo[
'header-basic'][] = [
335 $this->
msg(
'pageinfo-watchers' ),
336 $this->
msg(
'pageinfo-few-watchers' )->numParams( $unwatchedPageThreshold )
342 $pageInfo[
'header-basic'][] = [
345 $this->
msg(
'pageinfo-redirects-name' )->escaped(),
353 $this->
msg(
'pageinfo-redirects-value' )
354 ->numParams( count(
$title->getRedirectsHere() ) )
358 if ( $this->
page->isCountable() ) {
359 $pageInfo[
'header-basic'][] = [
360 $this->
msg(
'pageinfo-contentpage' ),
361 $this->
msg(
'pageinfo-contentpage-yes' )
368 'Prefixindex',
$title->getPrefixedText() .
'/' );
369 $pageInfo[
'header-basic'][] = [
370 Linker::link( $prefixIndex, $this->
msg(
'pageinfo-subpages-name' )->escaped() ),
371 $this->
msg(
'pageinfo-subpages-value' )
373 $pageCounts[
'subpages'][
'total'],
374 $pageCounts[
'subpages'][
'redirects'],
375 $pageCounts[
'subpages'][
'nonredirects'] )
384 $allCount = (int)$category->getPageCount();
385 $subcatCount = (int)$category->getSubcatCount();
386 $fileCount = (int)$category->getFileCount();
387 $pagesCount = $allCount - $subcatCount - $fileCount;
389 $pageInfo[
'category-info'] = [
391 $this->
msg(
'pageinfo-category-total' ),
392 $lang->formatNum( $allCount )
395 $this->
msg(
'pageinfo-category-pages' ),
396 $lang->formatNum( $pagesCount )
399 $this->
msg(
'pageinfo-category-subcats' ),
400 $lang->formatNum( $subcatCount )
403 $this->
msg(
'pageinfo-category-files' ),
404 $lang->formatNum( $fileCount )
410 $pageInfo[
'header-restrictions'] = [];
413 if (
$title->isCascadeProtected() ) {
415 $sources =
$title->getCascadeProtectionSources()[0];
417 foreach ( $sources
as $sourceTitle ) {
423 $pageInfo[
'header-restrictions'][] = [
424 $this->
msg(
'pageinfo-protect-cascading-from' ),
430 if (
$title->areRestrictionsCascading() ) {
431 $pageInfo[
'header-restrictions'][] = [
432 $this->
msg(
'pageinfo-protect-cascading' ),
433 $this->
msg(
'pageinfo-protect-cascading-yes' )
438 foreach (
$title->getRestrictionTypes()
as $restrictionType ) {
439 $protectionLevel = implode(
', ',
$title->getRestrictions( $restrictionType ) );
441 if ( $protectionLevel ==
'' ) {
443 $message = $this->
msg(
'protect-default' )->escaped();
447 $message = $this->
msg(
"protect-level-$protectionLevel" );
448 if ( $message->isDisabled() ) {
450 $message = $this->
msg(
"protect-fallback", $protectionLevel )->parse();
452 $message = $message->escaped();
455 $expiry =
$title->getRestrictionExpiry( $restrictionType );
456 $formattedexpiry = $this->
msg(
'parentheses',
457 $this->
getLanguage()->formatExpiry( $expiry ) )->escaped();
458 $message .= $this->
msg(
'word-separator' )->escaped() . $formattedexpiry;
462 $pageInfo[
'header-restrictions'][] = [
463 $this->
msg(
"restriction-$restrictionType" ), $message
467 if ( !$this->
page->exists() ) {
472 $pageInfo[
'header-edits'] = [];
474 $firstRev = $this->
page->getOldestRevision();
475 $lastRev = $this->
page->getRevision();
480 if ( $firstRevUser !==
'' ) {
482 $batch->addObj( $firstRevUserTitle );
483 $batch->addObj( $firstRevUserTitle->getTalkPage() );
489 if ( $lastRevUser !==
'' ) {
491 $batch->addObj( $lastRevUserTitle );
492 $batch->addObj( $lastRevUserTitle->getTalkPage() );
500 $pageInfo[
'header-edits'][] = [
501 $this->
msg(
'pageinfo-firstuser' ),
506 $pageInfo[
'header-edits'][] = [
507 $this->
msg(
'pageinfo-firsttime' ),
510 htmlspecialchars(
$lang->userTimeAndDate( $firstRev->getTimestamp(),
$user ) ),
512 [
'oldid' => $firstRev->getId() ]
519 $pageInfo[
'header-edits'][] = [
520 $this->
msg(
'pageinfo-lastuser' ),
525 $pageInfo[
'header-edits'][] = [
526 $this->
msg(
'pageinfo-lasttime' ),
530 $lang->userTimeAndDate( $this->page->getTimestamp(),
$user )
533 [
'oldid' => $this->
page->getLatest() ]
539 $pageInfo[
'header-edits'][] = [
540 $this->
msg(
'pageinfo-edits' ),
$lang->formatNum( $pageCounts[
'edits'] )
544 if ( $pageCounts[
'authors'] > 0 ) {
545 $pageInfo[
'header-edits'][] = [
546 $this->
msg(
'pageinfo-authors' ),
$lang->formatNum( $pageCounts[
'authors'] )
551 $pageInfo[
'header-edits'][] = [
552 $this->
msg(
'pageinfo-recent-edits',
553 $lang->formatDuration( $config->get(
'RCMaxAge' ) ) ),
554 $lang->formatNum( $pageCounts[
'recent_edits'] )
558 $pageInfo[
'header-edits'][] = [
559 $this->
msg(
'pageinfo-recent-authors' ),
560 $lang->formatNum( $pageCounts[
'recent_authors'] )
570 $localizedWords = $wgContLang->getMagicWords();
580 $hiddenCategories = $this->
page->getHiddenCategories();
583 count( $listItems ) > 0 ||
584 count( $hiddenCategories ) > 0 ||
585 $pageCounts[
'transclusion'][
'from'] > 0 ||
586 $pageCounts[
'transclusion'][
'to'] > 0
588 $options = [
'LIMIT' => $config->get(
'PageInfoTransclusionLimit' ) ];
590 if ( $config->get(
'MiserMode' ) ) {
591 $transcludedTargets = [];
597 $pageInfo[
'header-properties'] = [];
600 if ( count( $listItems ) > 0 ) {
601 $pageInfo[
'header-properties'][] = [
602 $this->
msg(
'pageinfo-magic-words' )->numParams( count( $listItems ) ),
608 if ( count( $hiddenCategories ) > 0 ) {
609 $pageInfo[
'header-properties'][] = [
610 $this->
msg(
'pageinfo-hidden-categories' )
611 ->numParams( count( $hiddenCategories ) ),
617 if ( $pageCounts[
'transclusion'][
'from'] > 0 ) {
618 if ( $pageCounts[
'transclusion'][
'from'] > count( $transcludedTemplates ) ) {
619 $more = $this->
msg(
'morenotlisted' )->escaped();
624 $pageInfo[
'header-properties'][] = [
625 $this->
msg(
'pageinfo-templates' )
626 ->numParams( $pageCounts[
'transclusion'][
'from'] ),
628 $transcludedTemplates,
635 if ( !$config->get(
'MiserMode' ) && $pageCounts[
'transclusion'][
'to'] > 0 ) {
636 if ( $pageCounts[
'transclusion'][
'to'] > count( $transcludedTargets ) ) {
639 $this->
msg(
'moredotdotdot' )->escaped(),
641 [
'hidelinks' => 1,
'hideredirs' => 1 ]
647 $pageInfo[
'header-properties'][] = [
648 $this->
msg(
'pageinfo-transclusions' )
649 ->numParams( $pageCounts[
'transclusion'][
'to'] ),
670 $config = $this->context->getConfig();
673 self::getCacheKey( $page->getTitle(), $page->getLatest() ),
675 function ( $oldValue, &$ttl, &$setOpts )
use ( $page, $config,
$fname ) {
676 $title = $page->getTitle();
677 $id =
$title->getArticleID();
684 $watchedItemStore = MediaWikiServices::getInstance()->getWatchedItemStore();
687 $result[
'watchers'] = $watchedItemStore->countWatchers(
$title );
689 if ( $config->get(
'ShowUpdatedMarker' ) ) {
691 $result[
'visitingWatchers'] = $watchedItemStore->countVisitingWatchers(
693 $updated - $config->get(
'WatchersMaxAge' )
698 $edits = (int)
$dbr->selectField(
701 [
'rev_page' => $id ],
707 if ( $config->get(
'MiserMode' ) ) {
712 'COUNT(DISTINCT rev_user_text)',
713 [
'rev_page' => $id ],
719 $threshold =
$dbr->timestamp( time() - $config->get(
'RCMaxAge' ) );
722 $edits = (int)
$dbr->selectField(
727 "rev_timestamp >= " .
$dbr->addQuotes( $threshold )
731 $result[
'recent_edits'] = $edits;
734 $result[
'recent_authors'] = (int)
$dbr->selectField(
736 'COUNT(DISTINCT rev_user_text)',
739 "rev_timestamp >= " .
$dbr->addQuotes( $threshold )
746 $conds = [
'page_namespace' =>
$title->getNamespace() ];
747 $conds[] =
'page_title ' .
751 $conds[
'page_is_redirect'] = 1;
752 $result[
'subpages'][
'redirects'] = (int)
$dbr->selectField(
760 $conds[
'page_is_redirect'] = 0;
761 $result[
'subpages'][
'nonredirects'] = (int)
$dbr->selectField(
770 +
$result[
'subpages'][
'nonredirects'];
774 if ( $config->get(
'MiserMode' ) ) {
775 $result[
'transclusion'][
'to'] = 0;
777 $result[
'transclusion'][
'to'] = (int)
$dbr->selectField(
781 'tl_namespace' =>
$title->getNamespace(),
782 'tl_title' =>
$title->getDBkey()
788 $result[
'transclusion'][
'from'] = (int)
$dbr->selectField(
791 [
'tl_from' =>
$title->getArticleID() ],
806 return $this->
msg(
'pageinfo-title', $this->
getTitle()->getPrefixedText() )->text();
814 $contributors = $this->
page->getContributors();
819 # Sift for real versus user names
821 foreach ( $contributors
as $user ) {
822 $page = $user->isAnon()
824 : $user->getUserPage();
826 $hiddenPrefs = $this->context->getConfig()->get(
'HiddenPrefs' );
827 if ( $user->getId() == 0 ) {
829 } elseif ( !in_array(
'realname', $hiddenPrefs ) && $user->getRealName() ) {
838 $real =
$lang->listToText( $real_names );
840 # "ThisSite user(s) A, B and C"
841 if ( count( $user_names ) ) {
842 $user = $this->
msg(
'siteusers' )
843 ->rawParams(
$lang->listToText( $user_names ) )
844 ->params( count( $user_names ) )->escaped();
849 if ( count( $anon_ips ) ) {
850 $anon = $this->
msg(
'anonusers' )
851 ->rawParams(
$lang->listToText( $anon_ips ) )
852 ->params( count( $anon_ips ) )->escaped();
857 # This is the big list, all mooshed together. We sift for blank strings
859 foreach ( [ $real, $user, $anon ]
as $s ) {
861 array_push( $fulllist, $s );
865 $count = count( $fulllist );
867 # "Based on work by ..."
869 ? $this->
msg(
'othercontribs' )->rawParams(
870 $lang->listToText( $fulllist ) )->params(
$count )->escaped()
isRedirect()
Returns whether this Content represents a redirect.
static getMainWANInstance()
Get the main WAN cache object.
wfGetDB($db, $groups=[], $wiki=false)
Get a Database object.
getTitle()
Shortcut to get the Title object from the page.
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
static getTitleFor($name, $subpage=false, $fragment= '')
Get a localised Title object for a specified special page name.
The Message class provides methods which fulfil two basic services:
static rawElement($element, $attribs=[], $contents= '')
Returns an HTML element in a string.
if(!isset($args[0])) $lang
pageInfo()
Returns page information in an easily-manipulated format.
getUser()
Shortcut to get the User being used for this instance.
onView()
Shows page information on GET request.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context $revId
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
requiresUnblock()
Whether this action can still be executed by a blocked user.
getPrefixedText()
Get the prefixed title with spaces.
getLanguage()
Shortcut to get the user Language being used for this instance.
Represents a title within MediaWiki.
when a variable name is used in a it is silently declared as a new local masking the global
static newFromTitle(LinkTarget $linkTarget, $id=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given link target...
makeHeader($header)
Creates a header that can be added to the output.
pageCounts(Page $page)
Returns page counts that would be too "expensive" to retrieve by normal means.
static formatTemplates($templates, $preview=false, $section=false, $more=null)
Returns HTML for the "templates used on this page" list.
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:Associative array mapping language codes to prefixed links of the form"language:title".&$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
static getDoubleUnderscoreArray()
Get a MagicWordArray of double-underscore entities.
Class representing a list of titles The execute() method checks them all for existence and adds them ...
wfTimestamp($outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Interface for type hinting (accepts WikiPage, Article, ImagePage, CategoryPage)
static invalidateCache(Title $title, $revid=null)
Clear the info cache for a given Title.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context $options
static newFromTitle($title)
Factory function.
Allows to change the fields on the form that will be generated are created Can be used to omit specific feeds from being outputted You must not use this hook to add use OutputPage::addFeedLink() instead.&$feedLinks conditions will AND in the final query as a Content object as a Content object $title
static linkKnown($target, $html=null, $customAttribs=[], $query=[], $options=[ 'known'])
Identical to link(), except $options defaults to 'known'.
static hasSubpages($index)
Does the namespace allow subpages?
getContext()
Get the IContextSource in use here.
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Displays information about a page.
static getCacheSetOptions(IDatabase $db1)
Merge the result of getSessionLagStatus() for several DBs using the most pessimistic values to estima...
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 fetchLanguageName($code, $inLanguage=null, $include= 'all')
$page
Page on which we're performing the action.
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 link($target, $html=null, $customAttribs=[], $query=[], $options=[])
This function returns an HTML link to the given target.
static escapeId($id, $options=[])
Given a value, escape it so that it can be used in an id attribute and return it. ...
requiresWrite()
Whether this action requires the wiki not to be locked.
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
getDescription()
Returns the description that goes below the "<h1>" tag.
if(!defined( 'MEDIAWIKI')) $fname
This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined...
addRow($table, $name, $value, $id)
Adds a row to a table that will be added to the content.
static formatHiddenCategories($hiddencats)
Returns HTML for the "hidden categories on this page" list.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content $content
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
wfMemcKey()
Make a cache key for the local wiki.
getName()
Returns the name of the action this object responds to.
getPageTitle()
Returns the name that goes in the "<h1>" page title.
const TS_UNIX
Unix time - the number of seconds since 1970-01-01 00:00:00 UTC.
getContributors()
Get a list of contributors of $article.
msg()
Get a Message object with context set Parameters are the same as wfMessage()
static getCacheKey(Title $title, $revId)
static revUserTools($rev, $isPublic=false)
Generate a user tool link cluster if the current user is allowed to view it.
static element($element, $attribs=[], $contents= '')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
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 page
static makeTitle($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
addTable($content, $table)
Adds a table to the content that will be added to the output.
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