MediaWiki  REL1_19
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:

List of all members.

Public Member Functions

 canUseWikiPage ()
 Check whether a WikiPage object can be get with getWikiPage().
 getContext ()
 Get the RequestContext object.
 getLang ()
 Get the Language object.
 getLanguage ()
 Get the Language object.
 getOutput ()
 Get the OutputPage object.
 getRequest ()
 Get the WebRequest object.
 getSkin ()
 Get the Skin object.
 getTitle ()
 Get the Title object.
 getUser ()
 Get the User object.
 getWikiPage ()
 Get the WikiPage object.
 msg ()
 Get a Message object with context set Parameters are the same as wfMessage()
 setContext (IContextSource $context)
 Set the IContextSource object.

Private Attributes

 $context

Detailed Description

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

Definition at line 30 of file ContextSource.php.


Member Function Documentation

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
Returns:
bool

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 89 of file ContextSource.php.

References getContext().

Referenced by OutputPage\getJSVars().

Here is the call graph for this function:

Here is the caller graph for this function:

Get the RequestContext object.

Since:
1.18
Returns:
RequestContext

Definition at line 42 of file ContextSource.php.

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

Referenced by ApiMain\__construct(), OutputPage\addSubtitle(), SkinTemplate\buildContentNavigationUrls(), canUseWikiPage(), DerivativeContext\canUseWikiPage(), ApiParse\categoriesHtml(), ApiBase\createContext(), ApiComparePages\execute(), ApiParse\execute(), ApiEditPage\execute(), ApiExpandTemplates\execute(), ApiPurge\execute(), ApiUnblock\execute(), ApiBlock\execute(), ApiFeedContributions\execute(), ApiLogin\execute(), ApiQueryRevisions\extractRowInfo(), Skin\generateDebugHTML(), UploadForm\getExtensionsMessage(), NewFilesPager\getForm(), OutputPage\getJSVars(), getLanguage(), DerivativeContext\getLanguage(), EditWatchlistNormalHTMLForm\getLegend(), getOutput(), DerivativeContext\getOutput(), getRequest(), DerivativeContext\getRequest(), getSkin(), DerivativeContext\getSkin(), UploadForm\getSourceSection(), getTitle(), DerivativeContext\getTitle(), HTMLForm\getTitle(), getUser(), DerivativeContext\getUser(), getWikiPage(), DerivativeContext\getWikiPage(), OutputPage\headElement(), ChangesList\insertRollback(), msg(), SkinTemplate\outputPage(), OutputPage\parserOptions(), SpecialBlock\processUIForm(), SpecialUnblock\processUIUnblock(), DifferenceEngine\renderNewRevision(), OutputPage\setHTMLTitle(), OutputPage\setPageTitle(), OutputPage\setTitle(), SpecialComparePages\showDiff(), DifferenceEngine\showDiffPage(), and SkinTemplate\tabAction().

Here is the call graph for this function:

Get the Language object.

Deprecated:
1.19 Use getLanguage instead
Returns:
Language

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 132 of file ContextSource.php.

References getLanguage(), and wfDeprecated().

Here is the call graph for this function:

Get the Language object.

Since:
1.19
Returns:
Language

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 143 of file ContextSource.php.

References getContext().

Referenced by AllmessagesTablePager\__construct(), OutputPage\addInlineStyle(), Skin\buildSidebar(), ImportReporter\close(), NewFilesPager\formatRow(), CategoryPager\formatRow(), ActiveUsersPager\formatRow(), UsersPager\formatRow(), DeletedContribsPager\formatRow(), ImageListPager\formatValue(), BlockListPager\formatValue(), AllmessagesTablePager\formatValue(), Skin\getCopyright(), UploadForm\getExtensionsMessage(), CategoryViewer\getHTML(), getLang(), EditWatchlistNormalHTMLForm\getLegend(), IndexPager\getLimitLinks(), TablePager\getLimitSelect(), DeletedContribsPager\getNavigationBar(), AlphabeticPager\getNavigationBar(), ReverseChronologicalPager\getNavigationBar(), TablePager\getNavigationBar(), DifferenceEngine\getRevisionHeader(), AllmessagesTablePager\getRowAttrs(), UploadForm\getSourceSection(), OutputPage\headElement(), HistoryPager\historyLine(), ChangesList\insertArticleLink(), ChangesList\insertDateHeader(), ChangesList\insertLogEntry(), ChangesList\insertTimestamp(), ChangesList\insertUserRelatedLinks(), Skin\lastModified(), OutputPage\makeResourceLoaderLink(), ChangesList\numberofWatchingusers(), SkinTemplate\outputPage(), EnhancedChangesList\recentChangesBlockGroup(), OldChangesList\recentChangesLine(), EnhancedChangesList\recentChangesLine(), ImportReporter\reportPage(), HistoryPager\revLink(), OutputPage\showLagWarning(), and OutputPage\styleLink().

Here is the call graph for this function:

Here is the caller graph for this function:

Get the WebRequest object.

Since:
1.18
Returns:
WebRequest

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 67 of file ContextSource.php.

References getContext().

Referenced by UsersPager\__construct(), ActiveUsersPager\__construct(), AllmessagesTablePager\__construct(), IndexPager\__construct(), ApiMain\__construct(), TablePager\__construct(), OutputPage\addAcceptLanguage(), SkinTemplate\buildContentNavigationUrls(), OutputPage\buildCssLinks(), SkinTemplate\buildNavUrls(), SkinTemplate\buildPersonalUrls(), OutputPage\checkLastModified(), ApiMain\checkMaxLag(), ApiQueryDeletedrevs\execute(), ApiEditPage\execute(), ApiPurge\execute(), ApiUnblock\execute(), ApiBlock\execute(), ApiLogin\execute(), ApiMain\executeActionWithErrorHandling(), ApiQueryUserInfo\getCurrentUserInfo(), IndexPager\getDefaultQuery(), LogPager\getFilterParams(), NewFilesPager\getForm(), TablePager\getHiddenFields(), ApiBase\getParameterFromSettings(), OutputPage\getScriptsForBottomQueue(), UploadForm\getSourceSection(), ApiQueryUsers\getTokenFunctions(), ApiQueryRevisions\getTokenFunctions(), ApiQueryRecentChanges\getTokenFunctions(), ApiQueryInfo\getTokenFunctions(), Skin\getUndeleteLink(), OutputPage\haveCacheVaryCookies(), SkinVector\initPage(), HTMLForm\loadData(), OutputPage\makeResourceLoaderLink(), OutputPage\output(), SkinTemplate\outputPage(), OutputPage\returnToMain(), OutputPage\sendCacheControl(), ApiMain\sendCacheHeaders(), ApiMain\setupExternalResponse(), ApiMain\setupModule(), ActiveUsersPager\setupOptions(), DifferenceEngine\showDiffPage(), OutputPage\showPermissionsErrorPage(), ApiMain\substituteResultWithError(), HTMLForm\tryAuthorizedSubmit(), OutputPage\uncacheableBecauseRequestVars(), and OutputPage\userCanPreview().

Here is the call graph for this function:

Get the Skin object.

Since:
1.18
Returns:
Skin

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 153 of file ContextSource.php.

References getContext().

Referenced by OutputPage\buildCssLinks(), OutputPage\getJSVars(), OutputPage\makeResourceLoaderLink(), OutputPage\output(), and DifferenceEngine\showDiffPage().

Here is the call graph for this function:

Here is the caller graph for this function:

Get the Title object.

Since:
1.18
Returns:
Title

Implements IContextSource.

Reimplemented in ImageHistoryPseudoPager, HTMLForm, AllmessagesTablePager, ProtectedTitlesPager, and DerivativeContext.

Definition at line 77 of file ContextSource.php.

References getContext().

Referenced by OutputPage\addAcceptLanguage(), Skin\addToSidebarPlain(), OutputPage\addWikiText(), OutputPage\addWikiTextTidy(), SkinTemplate\buildContentNavigationUrls(), OutputPage\buildCssLinks(), SkinTemplate\buildNavUrls(), SkinTemplate\buildPersonalUrls(), HistoryPager\curLink(), HistoryPager\formatRow(), Skin\getCategories(), Skin\getCategoryLinks(), Skin\getCopyright(), DifferenceEngine\getDiffLang(), HistoryPager\getEndBody(), NewFilesPager\getForm(), OutputPage\getHeadLinks(), OutputPage\getJSVars(), SkinTemplate\getNameSpaceKey(), Skin\getNamespaceNotice(), ActiveUsersPager\getPageHeader(), UsersPager\getPageHeader(), Skin\getRelevantTitle(), OutputPage\getScriptsForBottomQueue(), HistoryPager\getStartBody(), CategoryPager\getStartForm(), Skin\getUndeleteLink(), OutputPage\headElement(), HistoryPager\historyLine(), Skin\isRevisionCurrent(), HistoryPager\lastLink(), Skin\lastModified(), DifferenceEngine\loadRevisionData(), DifferenceEngine\loadRevisionIds(), IndexPager\makeLink(), SkinTemplate\outputPage(), OutputPage\parse(), Skin\preloadExistence(), OutputPage\prepareErrorPage(), Skin\printSource(), OutputPage\readOnlyPage(), EnhancedChangesList\recentChangesBlockGroup(), DifferenceEngine\renderNewRevision(), HistoryPager\revLink(), OutputPage\setFeedAppendQuery(), DifferenceEngine\showDiffPage(), Skin\subPageSubtitle(), and OutputPage\userCanPreview().

Here is the call graph for this function:

Here is the caller graph for this function:

Get the User object.

Since:
1.18
Returns:
User

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 122 of file ContextSource.php.

References getContext().

Referenced by IndexPager\__construct(), OutputPage\addDefaultModules(), OutputPage\blockedPage(), SkinTemplate\buildContentNavigationUrls(), OutputPage\buildCssLinks(), SkinTemplate\buildNavUrls(), SkinTemplate\buildPersonalUrls(), ApiMain\canApiHighLimits(), ApiMain\checkExecutePermissions(), OutputPage\checkLastModified(), DifferenceEngine\deletedLink(), ApiParse\execute(), ApiUndelete\execute(), ApiProtect\execute(), ApiMove\execute(), ApiEmailUser\execute(), ApiWatch\execute(), ApiQueryDeletedrevs\execute(), ApiImport\execute(), ApiLogout\execute(), ApiPatrol\execute(), ApiQueryFilearchive\execute(), ApiEditPage\execute(), ApiPurge\execute(), ApiUnblock\execute(), ApiUpload\execute(), ApiQueryBlocks\execute(), ApiFileRevert\execute(), ApiBlock\execute(), ApiRollback\execute(), ApiDelete\execute(), DeletedContribsPager\formatRow(), HistoryPager\formatRow(), BlockListPager\formatValue(), Skin\getCategories(), Skin\getCategoryLinks(), ApiQueryUserInfo\getCurrentUserInfo(), UploadForm\getDescriptionSection(), HistoryPager\getEndBody(), LogPager\getFilterParams(), OutputPage\getHeadLinks(), HTMLForm\getHiddenFields(), OutputPage\getJSVars(), PreferencesForm\getModifiedUser(), Skin\getNewtalks(), UploadForm\getOptionsSection(), DeletedContribsPager\getQueryInfo(), UsersPager\getQueryInfo(), BlockListPager\getQueryInfo(), NewPagesPager\getQueryInfo(), ApiQueryUserInfo\getRateLimits(), DifferenceEngine\getRevisionHeader(), OutputPage\getScriptsForBottomQueue(), Skin\getSiteNotice(), UploadForm\getSourceSection(), HistoryPager\getStartBody(), Skin\getUndeleteLink(), ApiQueryInfo\getWatchedInfo(), ApiBase\getWatchlistUser(), ApiBase\getWatchlistValue(), HistoryPager\historyLine(), ChangesList\insertDiffHist(), ChangesList\insertRollback(), Skin\lastModified(), LogPager\limitPerformer(), LogPager\limitTitle(), LogPager\limitType(), OutputPage\makeResourceLoaderLink(), DifferenceEngine\markPatrolledLink(), SkinTemplate\outputPage(), ApiUpload\performUpload(), Skin\preloadExistence(), ApiQueryContributions\prepareQuery(), OutputPage\readOnlyPage(), EnhancedChangesList\recentChangesBlockGroup(), EnhancedChangesList\recentChangesLine(), ImportReporter\reportPage(), DifferenceEngine\revisionDeleteLink(), HistoryPager\revLink(), ApiQueryWatchlist\run(), ApiQueryRecentChanges\run(), ApiUpload\selectUploadModule(), ApiMain\setupModule(), SkinSimple\setupSkinUserCss(), ApiBase\setWatch(), ChangesList\showAsUnpatrolled(), DifferenceEngine\showDiffPage(), Skin\showEmailUser(), ApiQueryBase\showHiddenUsersAddBlockInfo(), OutputPage\showPermissionsErrorPage(), HTMLForm\tryAuthorizedSubmit(), and OutputPage\userCanPreview().

Here is the call graph for this function:

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
Returns:
WikiPage

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 102 of file ContextSource.php.

References getContext().

Referenced by HistoryPager\curLink(), OutputPage\getJSVars(), HistoryPager\getQueryInfo(), SkinTemplate\outputPage(), and DifferenceEngine\renderNewRevision().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Since:
1.18
Returns:
Message object

Implements IContextSource.

Definition at line 164 of file ContextSource.php.

References getContext().

Referenced by DeletedContribsPager\__construct(), AllmessagesTablePager\__construct(), OutputPage\addBacklinkSubtitle(), OutputPage\addReturnTo(), Skin\addToSidebarPlain(), OutputPage\addWikiMsgArray(), SkinTemplate\buildContentNavigationUrls(), AllmessagesTablePager\buildForm(), SkinTemplate\buildNavUrls(), SkinTemplate\buildPersonalUrls(), ApiWatch\execute(), Skin\footerLink(), OutputPage\formatPermissionsErrorMessage(), CategoryPager\formatRow(), ActiveUsersPager\formatRow(), DeletedContribsPager\formatRow(), BlockListPager\formatValue(), PreferencesForm\getButtons(), Skin\getCachedNotice(), Skin\getCategoryLinks(), Skin\getCopyright(), BlockListPager\getFieldNames(), AllmessagesTablePager\getFieldNames(), OutputPage\getHeadLinks(), EditWatchlistNormalHTMLForm\getLegend(), DeletedContribsPager\getNavigationBar(), Skin\getNewtalks(), ActiveUsersPager\getPageHeader(), HistoryPager\getRevisionButton(), DifferenceEngine\getRevisionHeader(), AllmessagesTablePager\getStartBody(), HistoryPager\getStartBody(), CategoryPager\getStartForm(), Skin\getUndeleteLink(), OutputPage\headElement(), HistoryPager\historyLine(), Skin\lastModified(), DifferenceEngine\localiseLineNumbersCb(), Skin\logoText(), Skin\mainPageLink(), DifferenceEngine\markPatrolledLink(), SkinTemplate\outputPage(), Skin\printSource(), OutputPage\readOnlyPage(), ImportReporter\reportNotice(), OutputPage\setPageTitle(), HTMLForm\setSubmitTextMsg(), HTMLForm\setWrapperLegendMsg(), DifferenceEngine\showDiffPage(), OutputPage\showErrorPage(), OutputPage\showFatalError(), OutputPage\showFileCopyError(), OutputPage\showFileDeleteError(), OutputPage\showFileNotFoundError(), OutputPage\showFileRenameError(), OutputPage\showPermissionsErrorPage(), OutputPage\showUnexpectedValueError(), Skin\subPageSubtitle(), and OutputPage\versionRequired().

Here is the call graph for this function:


Member Data Documentation


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