MediaWiki  master
ContextSource Class Reference

The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and provide accessors to it. More...

Inheritance diagram for ContextSource:
Collaboration diagram for ContextSource:

Public Member Functions

 canUseWikiPage ()
 Check whether a WikiPage object can be get with getWikiPage(). More...
 
 exportSession ()
 Export the resolved user IP, HTTP headers, user ID, and session ID. More...
 
 getAuthority ()
 
 getConfig ()
 
 getContext ()
 Get the base IContextSource object. More...
 
 getCsrfTokenSet ()
 Get a repository to obtain and match CSRF tokens. More...
 
 getLanguage ()
 
 getOutput ()
 
 getRequest ()
 
 getSkin ()
 
 getStats ()
 
 getTiming ()
 
 getTitle ()
 
 getUser ()
 
 getWikiPage ()
 Get the WikiPage object. More...
 
 msg ( $key,... $params)
 Get a Message object with context set Parameters are the same as wfMessage() More...
 
 setContext (IContextSource $context)
 

Private Attributes

IContextSource $context
 

Detailed Description

The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and provide accessors to it.

Stability: stable
to extend
Since
1.18

Definition at line 33 of file ContextSource.php.

Member Function Documentation

◆ canUseWikiPage()

ContextSource::canUseWikiPage ( )

Check whether a WikiPage object can be get with getWikiPage().

Callers should expect that an exception is thrown from getWikiPage() if this method returns false.

Since
1.19
Stability: stable
to override
Returns
bool

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 103 of file ContextSource.php.

References getContext().

Referenced by SkinTemplate\buildContentNavigationUrls(), and OutputPage\getJSVars().

◆ exportSession()

ContextSource::exportSession ( )

Export the resolved user IP, HTTP headers, user ID, and session ID.

The result will be reasonably sized to allow for serialization.

Since
1.21
Stability: stable
to override
Returns
array

Implements IContextSource.

Definition at line 209 of file ContextSource.php.

References getContext().

Referenced by ApiUpload\getChunkResult(), and ApiUpload\performUpload().

◆ getAuthority()

ContextSource::getAuthority ( )
Since
1.36
Returns
Authority

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 144 of file ContextSource.php.

References getContext().

Referenced by LogEventsList\__construct(), UploadForm\__construct(), HistoryPager\__construct(), ApiBase\addBlockInfoToStatus(), ImageHistoryList\beginImageHistoryList(), SkinTemplate\buildContentNavigationUrls(), SkinTemplate\buildLoginData(), Skin\buildNavUrls(), SkinTemplate\buildPersonalUrls(), ApiMain\canApiHighLimits(), UsersPager\canSeeHideuser(), ApiMain\checkAsserts(), ApiMain\checkExecutePermissions(), ApiQueryRevisionsBase\checkRevDel(), ApiBase\checkTitleUserPermissions(), ApiBase\checkUserRightsAny(), DifferenceEngine\deletedLink(), ApiQuery\doExport(), LogPager\enforceActionRestrictions(), LogPager\enforcePerformerRestrictions(), ApiAMCreateAccount\execute(), ApiBlock\execute(), ApiChangeContentModel\execute(), ApiDelete\execute(), ApiEditPage\execute(), ApiFileRevert\execute(), ApiImageRotate\execute(), ApiImport\execute(), ApiManageTags\execute(), ApiMove\execute(), ApiPatrol\execute(), ApiProtect\execute(), ApiQueryBlocks\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryImageInfo\execute(), ApiQueryLogEvents\execute(), ApiRevisionDelete\execute(), ApiRollback\execute(), ApiSetPageLanguage\execute(), ApiTag\execute(), ApiUnblock\execute(), ApiUndelete\execute(), ApiUserrights\execute(), ApiQueryInfo\extractPageInfo(), ApiFeedContributions\feedItem(), ProtectedPagesPager\formatValue(), BlockListPager\formatValue(), ImageHistoryPseudoPager\getBody(), ApiQueryUserInfo\getCurrentUserInfo(), Skin\getDefaultModules(), OutputPage\getHeadLinksArray(), OutputPage\getJSVars(), EnhancedChangesList\getLineData(), DifferenceEngine\getMarkPatrolledLinkInfo(), Skin\getPageClasses(), BlockListPager\getQueryInfo(), DeletedContribsPager\getQueryInfo(), SkinTemplate\getReturnToParam(), ApiComparePages\getRevisionById(), DifferenceEngine\getRevisionHeader(), LogEventsList\getShowHideLinks(), HistoryPager\getStartBody(), LogEventsList\getTypeMenuDesc(), Skin\getUndeleteLink(), ApiQueryInfo\getVisitingWatcherInfo(), ApiQueryInfo\getWatchedInfo(), ApiQueryInfo\getWatcherInfo(), HistoryPager\historyLine(), ImageHistoryList\imageHistoryLine(), ApiPageSet\initFromRevIDs(), ChangesList\insertDiffHist(), ChangesList\insertRollback(), LogPager\limitType(), DifferenceEngine\loadNewText(), DifferenceEngine\loadText(), ApiMergeHistory\merge(), ApiMove\movePage(), ApiMove\moveSubpages(), ApiUpload\performUpload(), ApiQueryUserContribs\prepareQuery(), ApiTag\processIndividual(), DifferenceEngine\revisionDeleteLink(), ApiQueryRecentChanges\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryDeletedRevisions\run(), ApiQueryRevisions\run(), DifferenceEngine\setRevisions(), DifferenceEngine\showDiffPage(), OutputPage\showPermissionsErrorPage(), OutputPage\userCanPreview(), and ApiQueryBase\userCanSeeRevDel().

◆ getConfig()

ContextSource::getConfig ( )
Since
1.23
Stability: stable
to override
Returns
Config

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 72 of file ContextSource.php.

References getContext().

Referenced by ApiMain\__construct(), HTMLForm\__construct(), ImageGalleryBase\__construct(), ActiveUsersPager\__construct(), ApiQuery\__construct(), ApiBlock\__construct(), ApiEditPage\__construct(), ApiUpload\__construct(), ApiMove\__construct(), ApiDelete\__construct(), ApiRollback\__construct(), ApiWatch\__construct(), ApiProtect\__construct(), ApiUndelete\__construct(), ApiQueryQueryPage\__construct(), ImageListPager\__construct(), OutputPage\adaptCdnTTL(), OutputPage\addParserOutputMetadata(), ApiMain\addRequestedFields(), Skin\addToSidebarPlain(), UploadForm\addUploadJS(), ApiQuerySiteinfo\appendDbReplLagInfo(), ApiQuerySiteinfo\appendExtensions(), ApiQuerySiteinfo\appendFileExtensions(), ApiQuerySiteinfo\appendGeneralInfo(), ApiQuerySiteinfo\appendInterwikiMap(), ApiQuerySiteinfo\appendNamespaces(), ApiQuerySiteinfo\appendProtocols(), ApiQuerySiteinfo\appendRestrictions(), ApiQuerySiteinfo\appendRightsInfo(), ApiQuerySiteinfo\appendSubscribedHooks(), ApiQuerySiteinfo\appendUploadDialog(), ApiQuerySiteinfo\appendUserGroups(), SkinFallback\buildHelpfulInformationMessage(), Skin\buildNavUrls(), SkinMustache\buildSearchProps(), Skin\buildSidebar(), ApiMain\checkBotReadOnly(), ApiMain\checkConditionalRequestHeaders(), OutputPage\checkLastModified(), ApiMain\checkMaxLag(), ApiUpload\checkVerification(), DifferenceEngine\debug(), ApiBase\dieWithErrorOrDebug(), OutputPage\disallowUserJs(), ApiMain\errorMessagesFromException(), ApiBlock\execute(), ApiEditPage\execute(), ApiEmailUser\execute(), ApiFeedContributions\execute(), ApiFeedRecentChanges\execute(), ApiFeedWatchlist\execute(), ApiFormatPhp\execute(), ApiLogin\execute(), ApiOpenSearch\execute(), ApiQueryAllUsers\execute(), ApiQueryAuthManagerInfo\execute(), ApiQueryBlocks\execute(), ApiQueryFileRepoInfo\execute(), ApiQueryLangLinks\execute(), ApiQueryLogEvents\execute(), ApiQueryUsers\execute(), ApiRemoveAuthenticationData\execute(), ApiRollback\execute(), ApiSetPageLanguage\execute(), ApiUndelete\execute(), ApiUpload\execute(), ApiQueryRevisionsBase\extractDeprecatedContent(), SkinFallback\findInstalledSkins(), OldChangesList\formatChangeLine(), HistoryPager\formatRow(), UsersPager\formatRow(), HTMLForm\getAction(), OutputPage\getAdvertisedFeedTypes(), ApiImport\getAllowedImportSources(), ApiQueryLogEvents\getAllowedLogActions(), ApiFeedWatchlist\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiBlock\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiOpenSearch\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryUserContribs\getAllowedParams(), ApiResetPassword\getAllowedParams(), HTMLForm\getButtons(), Skin\getCachedNotice(), ApiQuerySiteinfo\getCacheMode(), OutputPage\getCacheVaryCookies(), Skin\getCategoryLinks(), ApiUpload\getChunkResult(), Skin\getCopyright(), Skin\getCopyrightIcon(), ApiQueryUserInfo\getCurrentUserInfo(), UploadForm\getDescriptionSection(), HistoryPager\getEndBody(), ApiResetPassword\getExamplesMessages(), ApiLogin\getExtendedDescription(), ApiSetPageLanguage\getExtendedDescription(), UploadForm\getExtensionsMessage(), OutputPage\getFeaturePolicyReportOnly(), ImageListPager\getFieldNames(), LogPager\getFilterParams(), ApiCSPReport\getFlags(), SkinTemplate\getFooterIcons(), Skin\getFooterLinks(), OutputPage\getFrameOptions(), OutputPage\getHeadLinksArray(), HTMLForm\getHiddenFields(), CategoryViewer\getHTML(), HTMLButtonField\getInputHTML(), Skin\getLanguages(), EnhancedChangesList\getLineData(), Skin\getLogo(), SkinMustache\getLogoData(), DifferenceEngine\getMarkPatrolledLinkInfo(), ApiMain\getMaxLag(), ApiBase\getModuleSourceInfo(), OutputPage\getOriginTrials(), ApiPageSet\getPageTableFields(), Skin\getPoweredBy(), ActiveUsersPager\getQueryInfo(), NewFilesPager\getQueryInfo(), ApiQueryUserInfo\getRateLimits(), OutputPage\getReportTo(), ApiQueryBlocks\getRestrictionData(), BlockListPager\getRestrictionListHTML(), Skin\getSiteFooterLinks(), Skin\getSkinStylePath(), UploadForm\getSourceSection(), SkinFallback\getTemplateData(), ApiQueryInfo\getVisitingWatcherInfo(), ApiQueryInfo\getWatcherInfo(), SkinTemplate\getWatchLinkAttrs(), ApiMain\handleCORS(), ApiResetPassword\hasAnyRoutes(), OutputPage\headElement(), Skin\initPage(), ApiFormatBase\initPrinter(), ApiLogin\isDeprecated(), ImageListPager\isFieldSortable(), LogPager\limitAction(), LogPager\limitTitle(), LogPager\limitType(), Skin\logoText(), ApiMain\logRequest(), Skin\makeFooterIcon(), Skin\makeSearchInput(), Skin\mapInterwikiToLanguage(), ApiQueryImageInfo\mergeThumbParams(), OutputPage\output(), Skin\preloadExistence(), SkinTemplate\prepareQuickTemplate(), ApiMain\printResult(), EnhancedChangesList\recentChangesBlockGroup(), EnhancedChangesList\recentChangesBlockLine(), ChangesList\recentChangesFlags(), ApiQueryInfo\requestExtraData(), ApiBase\requirePostedParameters(), ApiQueryAllImages\run(), ApiQueryAllPages\run(), ApiQueryCategoryMembers\run(), ApiQueryExtLinksUsage\run(), ApiQueryQueryPage\run(), ApiQuerySearch\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryBacklinksprop\run(), OutputPage\sendCacheControl(), ApiMain\sendCacheHeaders(), HTMLForm\setDisplayFormat(), ApiMain\setRequestExpectations(), SkinTemplate\setupTemplate(), OutputPage\showLagWarning(), LogEventsList\showOptions(), LoginHelper\showReturnToPage(), OutputPage\styleLink(), ApiMain\substituteResultWithError(), TraditionalImageGallery\toHTML(), and SkinTemplate\useCombinedLoginLink().

◆ getContext()

ContextSource::getContext ( )

Get the base IContextSource object.

Since
1.18
Stability: stable
to override
Returns
IContextSource

Definition at line 47 of file ContextSource.php.

References $context, RequestContext\getMain(), and wfDebug().

Referenced by ApiBase\__construct(), RevisionItem\__construct(), OutputPage\addSubtitle(), SkinTemplate\buildContentNavigationUrls(), UsersPager\buildGroupLink(), Skin\buildNavUrls(), canUseWikiPage(), DerivativeContext\canUseWikiPage(), CategoryViewer\clearCategoryState(), SpecialUnblock\execute(), ApiChangeContentModel\execute(), ApiComparePages\execute(), ApiEmailUser\execute(), ApiExpandTemplates\execute(), ApiFeedContributions\execute(), ApiHelp\execute(), ApiOptions\execute(), ApiParse\execute(), ApiQueryUsers\execute(), ApiRevisionDelete\execute(), ApiUserrights\execute(), ApiMain\executeAction(), ApiMain\executeActionWithErrorHandling(), exportSession(), ApiQueryRevisionsBase\extractDeprecatedContent(), ApiFeedContributions\feedItem(), ChangesList\formatCharacterDifference(), ProtectedPagesPager\formatValue(), DifferenceEngine\generateContentDiffBody(), DifferenceEngine\generateTextDiffBody(), getAuthority(), DerivativeContext\getAuthority(), ApiUpload\getChunkResult(), getConfig(), DerivativeContext\getConfig(), getCsrfTokenSet(), ApiComparePages\getDiffRevision(), FormatMetadata\getExtendedMetadataFromHook(), ApiAMCreateAccount\getFinalDescription(), ApiBase\getFinalDescription(), ApiClientLogin\getFinalDescription(), ApiLinkAccount\getFinalDescription(), ApiBase\getFinalParamDescription(), ApiBase\getFinalSummary(), OutputPage\getHeadLinksArray(), OutputPage\getJSVars(), getLanguage(), DerivativeContext\getLanguage(), EditWatchlistNormalHTMLForm\getLegend(), getOutput(), DerivativeContext\getOutput(), UsersPager\getPageHeader(), DifferenceEngine\getParserOutput(), ApiOptions\getPreferences(), getRequest(), DerivativeContext\getRequest(), getSkin(), DerivativeContext\getSkin(), DifferenceEngine\getSlotDiffRenderers(), UploadForm\getSourceSection(), NewFilesPager\getStartBody(), CategoryPager\getStartForm(), getTiming(), DerivativeContext\getTiming(), getTitle(), DerivativeContext\getTitle(), HTMLForm\getTitle(), Skin\getUndeleteLink(), ApiUserrights\getUrUser(), getUser(), DerivativeContext\getUser(), ChangesList\getWatchlistExpiry(), getWikiPage(), DerivativeContext\getWikiPage(), OutputPage\headElement(), HistoryPager\historyLine(), ChangesList\insertLog(), ChangesList\insertLogEntry(), ChangesList\insertRollback(), LogEventsList\logLine(), ApiParse\makeParserOptions(), msg(), OutputPage\parserOptions(), ApiUpload\performUpload(), SpecialTags\processCreateTagForm(), SpecialTags\processTagForm(), ChangesList\recentChangesFlags(), ApiOptions\resetPreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\saveFormData(), OutputPage\setHTMLTitle(), OutputPage\setPageTitle(), OutputPage\setTitle(), SpecialComparePages\showDiff(), DifferenceEngine\showDiffPage(), LogEventsList\showOptions(), MediaWiki\Preferences\DefaultPreferencesFactory\submitForm(), SkinTemplate\tabAction(), DifferenceEngine\textDiff(), and MediaWiki\Preferences\DefaultPreferencesFactory\validateSignature().

◆ getCsrfTokenSet()

ContextSource::getCsrfTokenSet ( )

Get a repository to obtain and match CSRF tokens.

Returns
CsrfTokenSet
Since
1.37

Implements MediaWiki\Session\CsrfTokenSetProvider.

Reimplemented in DerivativeContext.

Definition at line 219 of file ContextSource.php.

References getContext().

Referenced by ApiQueryDeletedrevs\execute(), ApiQueryUserInfo\getCurrentUserInfo(), HTMLForm\getHiddenFields(), HTMLForm\tryAuthorizedSubmit(), OutputPage\userCanPreview(), and ApiBase\validateToken().

◆ getLanguage()

ContextSource::getLanguage ( )
Since
1.19
Stability: stable
to override
Returns
Language

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 153 of file ContextSource.php.

References getContext().

Referenced by ApiMain\__construct(), AllMessagesTablePager\__construct(), DifferenceEngine\addHeader(), OutputPage\addInlineStyle(), ApiMain\addRequestedFields(), Skin\buildSidebar(), OutputPage\enableOOUI(), ApiFeedWatchlist\execute(), ApiHelp\execute(), ApiParamInfo\execute(), ApiQueryAllMessages\execute(), ApiQueryLanguageinfo\execute(), FormatMetadata\fetchExtendedMetadata(), OldChangesList\formatChangeLine(), FormatMetadata\formatNum(), CategoryPager\formatRow(), ActiveUsersPager\formatRow(), NewFilesPager\formatRow(), UsersPager\formatRow(), AllMessagesTablePager\formatValue(), ProtectedPagesPager\formatValue(), BlockListPager\formatValue(), ChangesList\getArticleLink(), UploadForm\getExtensionsMessage(), CategoryViewer\getHTML(), Skin\getHtmlElementAttributes(), Skin\getLanguages(), IndexPager\getLimitLinks(), TablePager\getLimitSelectList(), AlphabeticPager\getNavigationBar(), ReverseChronologicalPager\getNavigationBar(), FormatMetadata\getPriorityLanguages(), ImageGalleryBase\getRenderLang(), BlockListPager\getRestrictionListHTML(), DifferenceEngine\getRevisionHeader(), OutputPage\getRlClientContext(), DifferenceEngine\getSlotHeader(), UploadForm\getSourceSection(), ImageHistoryList\getThumbForLine(), ChangesList\getTimestamp(), Skin\getUndeleteLink(), OutputPage\headElement(), HistoryPager\historyLine(), ImageHistoryList\imageHistoryLine(), ChangesList\insertDateHeader(), ChangesList\insertLogEntry(), ChangesList\insertUserRelatedLinks(), Skin\lastModified(), LogEventsList\logLine(), FormatMetadata\makeFormattedData(), SkinTemplate\prepareQuickTemplate(), SkinTemplate\prepareUserLanguageAttributes(), EnhancedChangesList\recentChangesBlockGroup(), EnhancedChangesList\recentChangesLine(), HistoryPager\revLink(), OutputPage\showLagWarning(), DifferenceEngine\showMissingRevision(), OutputPage\styleLink(), and Skin\subPageSubtitleInternal().

◆ getOutput()

ContextSource::getOutput ( )
Since
1.18
Stability: stable
to override
Returns
OutputPage

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 126 of file ContextSource.php.

References getContext().

Referenced by OOUIHTMLForm\__construct(), CategoryViewer\__construct(), UploadForm\__construct(), DifferenceEngineSlotDiffRenderer\addModules(), UploadForm\addUploadJS(), ChangesList\beginRecentChangesList(), EnhancedChangesList\beginRecentChangesList(), Skin\bottomScripts(), SkinTemplate\buildContentNavigationUrls(), Skin\buildFeedUrls(), Skin\buildNavUrls(), ApiMain\checkConditionalRequestHeaders(), ImportReporter\close(), HTMLForm\displayForm(), Skin\editUrlOptions(), SkinMustache\generateHTML(), TablePager\getBody(), Skin\getCachedNotice(), Skin\getCategories(), Skin\getCategoryLinks(), Skin\getCopyright(), Skin\getDefaultModules(), Skin\getFooterLinks(), HTMLForm\getHTML(), VFormHTMLForm\getHTML(), CategoryViewer\getHTML(), CategoryViewer\getImageSection(), Skin\getLanguages(), SkinMustache\getLogoData(), DifferenceEngine\getMarkPatrolledLinkInfo(), TablePager\getNavigationBar(), Skin\getNewtalks(), CategoryViewer\getPagesSection(), HistoryPager\getStartBody(), SkinMustache\getTemplateData(), ApiMain\handleCORS(), Skin\lastModified(), ImportReporter\open(), SkinTemplate\outputPage(), ImageListPager\outputUserDoesNotExist(), SkinTemplate\prepareQuickTemplate(), Skin\prepareSubtitle(), Skin\printSource(), DifferenceEngine\renderNewRevision(), ImportReporter\reportNotice(), ImportReporter\reportPage(), ApiMain\sendCacheHeaders(), DifferenceEngine\showDiff(), DifferenceEngine\showDiffPage(), DifferenceEngine\showDiffStyle(), DifferenceEngine\showMissingRevision(), LoginHelper\showReturnToPage(), Skin\subPageSubtitleInternal(), and TraditionalImageGallery\toHTML().

◆ getRequest()

ContextSource::getRequest ( )
Since
1.18
Stability: stable
to override
Returns
WebRequest

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 81 of file ContextSource.php.

References getContext().

Referenced by ApiMain\__construct(), UsersPager\__construct(), ApiContinuationManager\__construct(), ImageListPager\__construct(), IndexPager\__construct(), TablePager\__construct(), OutputPage\addAcceptLanguage(), SkinTemplate\buildContentNavigationUrls(), SkinTemplate\buildPersonalUrls(), ApiMain\checkConditionalRequestHeaders(), ApiMain\checkExecutePermissions(), OutputPage\checkLastModified(), ApiMain\checkMaxLag(), CategoryViewer\clearCategoryState(), ApiFormatBase\closePrinter(), ApiMain\createErrorPrinter(), ApiCSPReport\error(), ApiCheckToken\execute(), ApiCSPReport\execute(), ApiEditPage\execute(), ApiFeedRecentChanges\execute(), ApiLogin\execute(), ApiQueryTokens\execute(), MediaWiki\Rest\Handler\ActionModuleBasedHandler\execute(), ApiMain\executeActionWithErrorHandling(), ApiMain\getCheck(), ApiQueryUserInfo\getCurrentUserInfo(), IndexPager\getDefaultQuery(), LogPager\getFilterParams(), OutputPage\getHeadLinksArray(), TablePager\getHiddenFields(), ApiCSPReport\getReport(), SkinTemplate\getReturnToParam(), OutputPage\getRlClientContext(), UploadForm\getSourceSection(), NewFilesPager\getStartBody(), ApiTokens\getTokenTypes(), Skin\getUndeleteLink(), ApiMain\getUpload(), ApiMain\getUserAgent(), ApiMain\getVal(), ApiMain\handleCORS(), ApiMain\handleException(), PageDataRequestHandler\handleRequest(), OutputPage\haveCacheVaryCookies(), ApiQuery\instantiateModules(), ApiQuery\isReadMode(), ApiMain\lacksSameOriginSecurity(), HTMLForm\loadData(), ApiBase\logFeatureUsage(), ApiMain\logRequest(), OutputPage\output(), HTMLForm\prepareForm(), SkinTemplate\prepareQuickTemplate(), ApiMain\reportUnusedParams(), ApiBase\requirePostedParameters(), OutputPage\returnToMain(), ApiQueryRecentChanges\run(), OutputPage\sendCacheControl(), ApiMain\sendCacheHeaders(), ApiMain\setRequestExpectations(), ApiMain\setupExternalResponse(), SkinTemplate\setupTemplateContext(), DifferenceEngine\showDiffPage(), OutputPage\showPermissionsErrorPage(), HTMLForm\tryAuthorizedSubmit(), OutputPage\userCanPreview(), ApiBase\useTransactionalTimeLimit(), ApiBase\validateToken(), and ApiCSPReport\verifyPostBodyOk().

◆ getSkin()

ContextSource::getSkin ( )
Since
1.18
Stability: stable
to override
Returns
Skin

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 162 of file ContextSource.php.

References getContext().

Referenced by OutputPage\enableOOUI(), OutputPage\getJSVars(), OutputPage\getRlClientContext(), and OutputPage\output().

◆ getStats()

ContextSource::getStats ( )
Deprecated:
since 1.27 use a StatsdDataFactory from MediaWikiServices (preferably injected)
Since
1.25
Stability: stable
to override
Returns
IBufferingStatsdDataFactory

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 182 of file ContextSource.php.

◆ getTiming()

ContextSource::getTiming ( )
Since
1.27
Stability: stable
to override
Returns
Timing

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 171 of file ContextSource.php.

References getContext().

◆ getTitle()

ContextSource::getTitle ( )
Since
1.18
Stability: stable
to override
Returns
Title|null

Implements IContextSource.

Reimplemented in ProtectedTitlesPager, ImageListPager, AllMessagesTablePager, ImageHistoryPseudoPager, HTMLForm, DifferenceEngine, and DerivativeContext.

Definition at line 90 of file ContextSource.php.

References getContext().

Referenced by OutputPage\addAcceptLanguage(), OutputPage\addParserOutputMetadata(), Skin\addToSidebarPlain(), OutputPage\addWikiTextAsContent(), OutputPage\addWikiTextAsInterface(), SkinTemplate\buildContentNavigationUrls(), SkinTemplate\buildCreateAccountData(), SkinTemplate\buildLoginData(), SkinTemplate\buildLogoutLinkData(), Skin\buildNavUrls(), SkinTemplate\buildPersonalPageItem(), SkinTemplate\buildPersonalUrls(), HistoryPager\curLink(), HistoryPager\formatRow(), Skin\getCategories(), Skin\getCategoryLinks(), Skin\getCopyright(), OutputPage\getDisplayTitle(), HistoryPager\getEndBody(), OutputPage\getHeadLinksArray(), OutputPage\getJSVars(), Skin\getLanguages(), SkinTemplate\getNameSpaceKey(), TablePager\getNavigationBar(), UsersPager\getPageHeader(), Skin\getRelevantTitle(), SkinTemplate\getReturnToParam(), HistoryPager\getStartBody(), Skin\getUndeleteLink(), OutputPage\getUnprefixedDisplayTitle(), OutputPage\headElement(), HistoryPager\historyLine(), OutputPage\isRevisionCurrent(), HistoryPager\lastLink(), IndexPager\makeLink(), OutputPage\parseAsContent(), OutputPage\parseAsInterface(), SkinTemplate\prepareQuickTemplate(), Skin\printSource(), HistoryPager\revLink(), OutputPage\setFeedAppendQuery(), SkinTemplate\setupTemplateContext(), OutputPage\userCanPreview(), and OutputPage\wrapWikiTextAsInterface().

◆ getUser()

ContextSource::getUser ( )
Stability: stable
to override
Since
1.18
Stability: stable
to override
Returns
User

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 136 of file ContextSource.php.

References getContext().

Referenced by ImageHistoryPseudoPager\__construct(), IndexPager\__construct(), DifferenceEngine\addHeader(), Skin\buildNavUrls(), ApiMain\checkAsserts(), ApiMain\checkConditionalRequestHeaders(), ApiMain\checkExecutePermissions(), OutputPage\checkLastModified(), ApiBase\checkTitleUserPermissions(), ApiBase\errorArrayToStatus(), ApiBlock\execute(), ApiChangeAuthenticationData\execute(), ApiCheckToken\execute(), ApiClearHasMsg\execute(), ApiCSPReport\execute(), ApiDelete\execute(), ApiEditPage\execute(), ApiEmailUser\execute(), ApiImport\execute(), ApiLinkAccount\execute(), ApiLogout\execute(), ApiManageTags\execute(), ApiMove\execute(), ApiParse\execute(), ApiPatrol\execute(), ApiProtect\execute(), ApiPurge\execute(), ApiQueryAuthManagerInfo\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryLogEvents\execute(), ApiQueryMyStashedFiles\execute(), ApiQueryStashImageInfo\execute(), ApiQueryTokens\execute(), ApiQueryUsers\execute(), ApiRemoveAuthenticationData\execute(), ApiResetPassword\execute(), ApiRevisionDelete\execute(), ApiRollback\execute(), ApiSetNotificationTimestamp\execute(), ApiSetPageLanguage\execute(), ApiStashEdit\execute(), ApiTag\execute(), ApiTokens\execute(), ApiUnblock\execute(), ApiUndelete\execute(), ApiUpload\execute(), ApiUserrights\execute(), ApiValidatePassword\execute(), ApiWatch\execute(), ApiQueryRevisionsBase\extractDeprecatedContent(), ApiQueryWatchlist\extractOutputData(), ApiQueryInfo\extractPageInfo(), ApiQueryLogEvents\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), HistoryPager\formatRow(), UsersPager\formatRow(), ProtectedPagesPager\formatValue(), ApiQueryLogEvents\getCacheMode(), Skin\getCategories(), ApiUpload\getChunkResult(), ApiUpload\getContextResult(), ApiQueryUserInfo\getCurrentUserInfo(), Skin\getDefaultModules(), UploadForm\getDescriptionSection(), ApiComparePages\getDiffRevision(), HistoryPager\getEndBody(), OutputPage\getJSVars(), OutputPage\getLastSeenUserTalkRevId(), ApiQueryUserInfo\getLatestContributionTime(), DifferenceEngine\getMarkPatrolledLinkInfo(), PreferencesFormOOUI\getModifiedUser(), Skin\getNewtalks(), UploadForm\getOptionsSection(), ApiParse\getParsedContent(), ApiParse\getPoolKey(), ApiQueryUserInfo\getRateLimits(), DifferenceEngine\getRevisionHeader(), OutputPage\getRlClientContext(), LogEventsList\getShowHideLinks(), Skin\getSiteNotice(), UploadForm\getSourceSection(), ImageHistoryList\getThumbForLine(), ApiOptions\getUserForUpdates(), ApiQueryInfo\getWatchedInfo(), ChangesList\getWatchlistExpiry(), ApiBase\getWatchlistUser(), OutputPage\headElement(), HistoryPager\historyLine(), ImageHistoryList\imageHistoryLine(), ChangesList\insertDateHeader(), Skin\isResponsive(), Skin\lastModified(), LogPager\limitType(), ApiBase\logFeatureUsage(), ApiMain\logRequest(), ApiMove\movePage(), OutputPage\parserOptions(), ApiUpload\performStash(), ApiUpload\performUpload(), Skin\preloadExistence(), ApiQueryUserContribs\prepareQuery(), ApiTag\processIndividual(), ImportReporter\reportPage(), HistoryPager\revLink(), ApiQueryRecentChanges\run(), ApiQueryWatchlist\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryDeletedRevisions\run(), ApiQueryRevisions\run(), ApiUpload\selectUploadModule(), SkinTemplate\setupTemplateContext(), ApiComparePages\setVals(), ChangesList\showAsUnpatrolled(), DifferenceEngine\showDiffPage(), Skin\showEmailUser(), OutputPage\showPermissionsErrorPage(), HTMLForm\tryAuthorizedSubmit(), RevDelList\updateLog(), OutputPage\userCanPreview(), MediaWiki\Preferences\DefaultPreferencesFactory\validateSignature(), and ApiBase\validateToken().

◆ getWikiPage()

ContextSource::getWikiPage ( )

Get the WikiPage object.

May throw an exception if there's no Title object set or the Title object belongs to a special namespace that doesn't have WikiPage, so use first canUseWikiPage() to check whether this method can be called safely.

Since
1.19
Stability: stable
to override
Returns
WikiPage

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 117 of file ContextSource.php.

References getContext().

Referenced by SkinTemplate\buildContentNavigationUrls(), HistoryPager\curLink(), Skin\getFooterLinks(), OutputPage\getJSVars(), HistoryPager\getQueryInfo(), HistoryPager\historyLine(), and DifferenceEngine\renderNewRevision().

◆ msg()

ContextSource::msg (   $key,
  $params 
)

Get a Message object with context set Parameters are the same as wfMessage()

Since
1.18
Stability: stable
to override
Parameters
string | string[] | MessageSpecifier$keyMessage key, or array of keys, or a MessageSpecifier.
mixed...$params
Returns
Message

Implements MessageLocalizer.

Reimplemented in DerivativeContext.

Definition at line 197 of file ContextSource.php.

References getContext().

Referenced by UploadForm\__construct(), DeletedContribsPager\__construct(), ContribsPager\__construct(), ApiBase\addDeprecation(), OutputPage\addHelpLink(), DifferenceEngine\addLocalisedTitleTooltipsCb(), OutputPage\addReturnTo(), Skin\addToSidebar(), Skin\addToSidebarPlain(), OutputPage\addWikiMsgArray(), ApiQuerySiteinfo\appendSkins(), ImageHistoryList\beginImageHistoryList(), SkinTemplate\buildContentNavigationUrls(), SkinTemplate\buildCreateAccountData(), Skin\buildFeedUrls(), SkinFallback\buildHelpfulInformationMessage(), SkinTemplate\buildLoginData(), SkinTemplate\buildLogoutLinkData(), Skin\buildNavUrls(), SkinTemplate\buildPersonalUrls(), SkinMustache\buildSearchProps(), ApiUpload\checkPermissions(), ApiBase\checkUserRightsAny(), ImportReporter\close(), ApiFormatBase\closePrinter(), FormatMetadata\collapseContactInfo(), Skin\doEditSectionLink(), ApiFeedWatchlist\execute(), ApiOptions\execute(), ApiParse\execute(), ApiQueryTags\execute(), FormatMetadata\exifMsg(), ApiQueryRevisionsBase\extractAllSlotInfo(), Skin\footerLink(), Skin\footerLinkTitle(), FormatMetadata\formatCoords(), OutputPage\formatPermissionsErrorMessage(), CategoryPager\formatRow(), ActiveUsersPager\formatRow(), UsersPager\formatRow(), AllMessagesTablePager\formatValue(), ProtectedPagesPager\formatValue(), BlockListPager\formatValue(), LogEventsList\getActionSelectorDesc(), HTMLForm\getButtons(), OOUIHTMLForm\getButtons(), VFormHTMLForm\getButtons(), PreferencesFormOOUI\getButtons(), Skin\getCachedNotice(), Skin\getCategoryLinks(), Skin\getCopyright(), CategoryViewer\getCountMessage(), DifferenceEngine\getDiff(), EnhancedChangesList\getDiffHistLinks(), HistoryPager\getEmptyBody(), TablePager\getEmptyBody(), UploadForm\getExtensionsMessage(), ApiFeedRecentChanges\getFeedObject(), AllMessagesTablePager\getFieldNames(), BlockListPager\getFieldNames(), ImageListPager\getFieldNames(), ProtectedPagesPager\getFieldNames(), ApiBase\getFinalParamDescription(), OutputPage\getHeadLinksArray(), CategoryViewer\getHTML(), CategoryViewer\getImageSection(), Skin\getLanguages(), HTMLForm\getLegend(), EditWatchlistNormalHTMLForm\getLegend(), TablePager\getLimitDropdown(), EnhancedChangesList\getLineData(), EnhancedChangesList\getLogText(), AlphabeticPager\getNavigationBar(), ReverseChronologicalPager\getNavigationBar(), TablePager\getNavigationBar(), Skin\getNewtalks(), UsersPager\getPageHeader(), CategoryViewer\getPagesSection(), SkinMustache\getPortletLabel(), BlockListPager\getRestrictionListHTML(), HistoryPager\getRevisionButton(), DifferenceEngine\getRevisionHeader(), UploadForm\getSourceSection(), HistoryPager\getStartBody(), AllMessagesTablePager\getStartBody(), CategoryViewer\getSubcategorySection(), HTMLForm\getSubmitText(), SkinMustache\getTemplateData(), ImageHistoryList\getThumbForLine(), Skin\getUndeleteLink(), SkinTemplate\getWatchLinkAttrs(), ChangesList\getWatchlistExpiry(), ApiUpload\handleStashException(), OutputPage\headElement(), HistoryPager\historyLine(), ImageHistoryList\imageHistoryLine(), ChangesList\insertComment(), ChangesList\insertLog(), ChangesList\insertUserRelatedLinks(), FormatMetadata\langItem(), Skin\lastModified(), DifferenceEngine\localiseLineNumbersCb(), Skin\logoText(), Skin\mainPageLink(), FormatMetadata\makeFormattedData(), Skin\makeLink(), IndexPager\makeLink(), Skin\makeSearchButton(), Skin\makeSearchInput(), DifferenceEngine\markPatrolledLink(), ApiMain\modifyHelp(), ChangesList\numberofWatchingusers(), CategoryViewer\pagingLinks(), ChangesList\preCacheMessages(), Skin\printSource(), AllMessagesTablePager\reallyDoQuery(), EnhancedChangesList\recentChangesBlockGroup(), ImportReporter\reportNotice(), ImportReporter\reportPage(), OutputPage\setPageTitle(), HTMLForm\setSubmitTextMsg(), HTMLForm\setWrapperLegendMsg(), DifferenceEngine\showDiffPage(), OutputPage\showErrorPage(), OutputPage\showFatalError(), DifferenceEngine\showMissingRevision(), OutputPage\showPermissionsErrorPage(), Skin\subPageSubtitleInternal(), ApiMain\substituteResultWithError(), TraditionalImageGallery\toHTML(), MediaWiki\Preferences\DefaultPreferencesFactory\validateSignature(), OutputPage\versionRequired(), and OutputPage\wrapWikiMsg().

◆ setContext()

Member Data Documentation

◆ $context

IContextSource ContextSource::$context
private

Definition at line 39 of file ContextSource.php.

Referenced by LogEventsList\__construct(), ApiMain\__construct(), DifferenceEngine\__construct(), HTMLForm\__construct(), OOUIHTMLForm\__construct(), ImageHistoryList\__construct(), ImageGalleryBase\__construct(), PackedImageGallery\__construct(), SlideshowImageGallery\__construct(), EnhancedChangesList\__construct(), CategoryViewer\__construct(), UsersPager\__construct(), ActiveUsersPager\__construct(), AllMessagesTablePager\__construct(), UploadForm\__construct(), OutputPage\__construct(), CategoryPager\__construct(), DeletedContribsPager\__construct(), ImageListPager\__construct(), ContribsPager\__construct(), NewFilesPager\__construct(), RevDelList\__construct(), RevDelLogList\__construct(), RevDelArchiveList\__construct(), RevDelRevisionList\__construct(), RevDelArchivedFileList\__construct(), RevDelFileList\__construct(), ChangeTagsList\__construct(), IndexPager\__construct(), TablePager\__construct(), ApiFormatBase\closePrinter(), ApiComparePages\execute(), ApiFeedRecentChanges\execute(), ApiHelp\execute(), ApiParse\execute(), ApiQueryUsers\execute(), ApiQueryRevisionsBase\extractDeprecatedContent(), ImageGalleryBase\factory(), ChangeTagsList\factory(), ChangesList\flag(), FormatMetadata\flattenArrayContentLang(), getContext(), FormatMetadata\getFormattedData(), ApiHelp\getHelp(), ApiHelp\getHelpInternal(), OutputPage\getRlClient(), DifferenceEngine\getSlotDiffRenderers(), ApiCSPReport\logReport(), ApiBase\makeMessage(), ChangesList\newFromContext(), ApiPageSet\processTitlesArray(), setContext(), ChangesList\showCharacterDifference(), LogEventsList\showLogExtract(), and LogEventsList\showOptions().


The documentation for this class was generated from the following file: