MediaWiki  REL1_22
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().
 exportSession ()
 Export the resolved user IP, HTTP headers, user ID, and session ID.
 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

IContextSource $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 87 of file ContextSource.php.

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

The result will be reasonably sized to allow for serialization.

Returns:
Array
Since:
1.21

Implements IContextSource.

Definition at line 174 of file ContextSource.php.

Get the Language object.

Deprecated:
since 1.19 Use getLanguage instead
Returns:
Language

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 130 of file ContextSource.php.

Get the Skin object.

Since:
1.18
Returns:
Skin

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 151 of file ContextSource.php.

Referenced by OutputPage\output().

Get the User object.

Since:
1.18
Returns:
User

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 120 of file ContextSource.php.

Referenced by IndexPager\__construct(), OutputPage\blockedPage(), SkinTemplate\buildContentNavigationUrls(), SkinTemplate\buildNavUrls(), SkinTemplate\buildPersonalUrls(), ApiCreateAccount\execute(), ApiProtect\execute(), ApiUndelete\execute(), ApiEmailUser\execute(), ApiMove\execute(), ApiWatch\execute(), ApiImport\execute(), ApiLogout\execute(), ApiSetNotificationTimestamp\execute(), ApiPatrol\execute(), ApiEditPage\execute(), ApiOptions\execute(), ApiUnblock\execute(), ApiUpload\execute(), ApiQueryDeletedrevs\execute(), ApiFileRevert\execute(), ApiRollback\execute(), ApiQueryFilearchive\execute(), ApiBlock\execute(), ApiDelete\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiImageRotate\execute(), ApiPurge\execute(), ApiQueryRevisions\execute(), UsersPager\formatRow(), HistoryPager\formatRow(), BlockListPager\formatValue(), ApiQueryLogEvents\getCacheMode(), Skin\getCategories(), Skin\getCategoryLinks(), ApiQueryUserInfo\getCurrentUserInfo(), HistoryPager\getEndBody(), LogPager\getFilterParams(), PreferencesForm\getModifiedUser(), Skin\getNewtalks(), DeletedContribsPager\getQueryInfo(), UsersPager\getQueryInfo(), BlockListPager\getQueryInfo(), ApiQueryUserInfo\getRateLimits(), Skin\getSiteNotice(), Skin\getUndeleteLink(), ApiQueryInfo\getWatchedInfo(), ApiQueryInfo\getWatcherInfo(), ApiBase\getWatchlistUser(), ApiBase\getWatchlistValue(), ImageHistoryList\imageHistoryLine(), Skin\lastModified(), LogPager\limitPerformer(), LogPager\limitTitle(), LogPager\limitType(), ApiPurge\mustBePosted(), SkinTemplate\outputPage(), Skin\preloadExistence(), ApiQueryContributions\prepareQuery(), EnhancedChangesList\recentChangesBlockGroup(), EnhancedChangesList\recentChangesLine(), ImportReporter\reportPage(), ApiQueryWatchlist\run(), ApiQueryRecentChanges\run(), SkinTemplate\setupTemplateForOutput(), ApiBase\setWatch(), ChangesList\showAsUnpatrolled(), Skin\showEmailUser(), ApiQueryBase\showHiddenUsersAddBlockInfo(), and RevDel_List\updateLog().

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 100 of file ContextSource.php.

Referenced by HistoryPager\getQueryInfo(), and SkinTemplate\outputPage().

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

Since:
1.18
Returns:
Message

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 162 of file ContextSource.php.

Referenced by DeletedContribsPager\__construct(), Skin\addToSidebarPlain(), SkinTemplate\buildContentNavigationUrls(), SkinTemplate\buildNavUrls(), SkinTemplate\buildPersonalUrls(), ImportReporter\close(), EnhancedChangesList\downArrow(), ApiWatch\execute(), Skin\footerLink(), CategoryPager\formatRow(), UsersPager\formatRow(), BlockListPager\formatValue(), PreferencesForm\getButtons(), Skin\getCachedNotice(), Skin\getCategoryLinks(), Skin\getCopyright(), ImageListPager\getFieldNames(), BlockListPager\getFieldNames(), NewFilesPager\getForm(), EditWatchlistNormalHTMLForm\getLegend(), DeletedContribsPager\getNavigationBar(), ReverseChronologicalPager\getNavigationBar(), Skin\getNewtalks(), UsersPager\getPageHeader(), HistoryPager\getRevisionButton(), CategoryPager\getStartForm(), Skin\getUndeleteLink(), ImageHistoryList\imageHistoryLine(), Skin\lastModified(), Skin\logoText(), Skin\mainPageLink(), SkinTemplate\outputPage(), Skin\printSource(), EnhancedChangesList\recentChangesBlockGroup(), EnhancedChangesList\recentChangesBlockLine(), EnhancedChangesList\recentChangesLine(), ImportReporter\reportNotice(), ImportReporter\reportPage(), OutputPage\showFileCopyError(), OutputPage\showFileDeleteError(), OutputPage\showFileNotFoundError(), OutputPage\showFileRenameError(), EnhancedChangesList\sideArrow(), Skin\subPageSubtitle(), and TraditionalImageGallery\toHTML().


Member Data Documentation


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