MediaWiki  REL1_24
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.
 getConfig ()
 Get the Config object.
 getContext ()
 Get the base IContextSource 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 99 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 176 of file ContextSource.php.

Get the Config object.

Since:
1.23
Returns:
Config

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 67 of file ContextSource.php.

Referenced by ApiQueryQueryPage\__construct(), ImageListPager\__construct(), ImageGalleryBase\__construct(), ApiResult\addValue(), OutputPage\addVaryHeader(), ApiQuerySiteinfo\appendDbReplLagInfo(), ApiQuerySiteinfo\appendExtensions(), ApiQuerySiteinfo\appendFileExtensions(), ApiQuerySiteinfo\appendGeneralInfo(), ApiQuerySiteinfo\appendInterwikiMap(), ApiQuerySiteinfo\appendNamespaceAliases(), ApiQuerySiteinfo\appendProtocols(), ApiQuerySiteinfo\appendRestrictions(), ApiQuerySiteinfo\appendRightsInfo(), ApiQuerySiteinfo\appendStatistics(), ApiQuerySiteinfo\appendSubscribedHooks(), ApiQuerySiteinfo\appendUserGroups(), ApiQueryBase\checkRowCount(), ApiProtect\execute(), ApiCreateAccount\execute(), ApiUndelete\execute(), ApiEmailUser\execute(), ApiEditPage\execute(), ApiUpload\execute(), ApiPurge\execute(), ApiQueryAllMessages\execute(), ApiFeedContributions\execute(), ApiQueryBlocks\execute(), ApiFeedRecentChanges\execute(), ApiQueryLogEvents\execute(), ApiQueryAllUsers\execute(), ApiOpenSearch\execute(), ApiLogin\execute(), ApiFeedWatchlist\execute(), ApiQueryInfo\execute(), ApiQueryInfo\extractPageInfo(), ApiQueryRevisions\extractRowInfo(), OldChangesList\formatChangeLine(), UsersPager\formatRow(), ApiQueryLogEvents\getAllowedLogActions(), ApiOpenSearch\getAllowedParams(), ApiImport\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiCreateAccount\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), HTMLForm\getButtons(), ApiQuerySiteinfo\getCacheMode(), ApiQueryUserInfo\getCurrentUserInfo(), UploadForm\getDescriptionSection(), ImageListPager\getFieldNames(), NewFilesPager\getForm(), HTMLForm\getHiddenFields(), ApiQueryExtLinksUsage\getParamDescription(), ApiQueryBlocks\getParamDescription(), ApiQueryCategoryMembers\getParamDescription(), ApiQueryBacklinksprop\getParamDescription(), ApiQueryContributions\getParamDescription(), NewFilesPager\getQueryInfo(), ApiQueryUserInfo\getRateLimits(), UploadForm\getSourceSection(), ApiQueryInfo\getWatcherInfo(), ApiFormatBase\initPrinter(), ImageListPager\isFieldSortable(), ApiQueryImageInfo\mergeThumbParams(), ApiQueryInfo\requestExtraData(), ApiQueryExtLinksUsage\run(), ApiQueryCategoryMembers\run(), ApiQueryQueryPage\run(), ApiQueryAllImages\run(), ApiQueryBacklinksprop\run(), and ApiMain\sendCacheHeaders().

Get the Skin object.

Since:
1.18
Returns:
Skin

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 152 of file ContextSource.php.

Referenced by DerivativeResourceLoaderContext\getSkin().

Get the User object.

Since:
1.18
Returns:
User

Implements IContextSource.

Reimplemented in DerivativeContext.

Definition at line 132 of file ContextSource.php.

Referenced by IndexPager\__construct(), ApiClearHasMsg\execute(), ApiCreateAccount\execute(), ApiProtect\execute(), ApiUndelete\execute(), ApiMove\execute(), ApiEmailUser\execute(), ApiRevisionDelete\execute(), ApiImport\execute(), ApiEditPage\execute(), ApiLogout\execute(), ApiUpload\execute(), ApiWatch\execute(), ApiSetNotificationTimestamp\execute(), ApiPatrol\execute(), ApiQueryTokens\execute(), ApiOptions\execute(), ApiQueryDeletedrevs\execute(), ApiUnblock\execute(), ApiPurge\execute(), ApiRollback\execute(), ApiQueryFilearchive\execute(), ApiDelete\execute(), ApiBlock\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryImageInfo\execute(), ApiImageRotate\execute(), ApiQueryRevisions\execute(), ApiQueryWatchlist\extractRowInfo(), ApiQueryLogEvents\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), ApiQueryRevisions\extractRowInfo(), UsersPager\formatRow(), BlockListPager\formatValue(), ProtectedPagesPager\formatValue(), ApiQueryLogEvents\getCacheMode(), Skin\getCategories(), Skin\getCategoryLinks(), ApiQueryUserInfo\getCurrentUserInfo(), UploadForm\getDescriptionSection(), HTMLForm\getHiddenFields(), PreferencesForm\getModifiedUser(), Skin\getNewtalks(), UploadForm\getOptionsSection(), DeletedContribsPager\getQueryInfo(), UsersPager\getQueryInfo(), BlockListPager\getQueryInfo(), ApiQueryUserInfo\getRateLimits(), Skin\getSiteNotice(), UploadForm\getSourceSection(), Skin\getUndeleteLink(), ApiQueryInfo\getWatchedInfo(), ApiQueryInfo\getWatcherInfo(), Skin\lastModified(), DifferenceEngine\loadNewText(), ApiPurge\mustBePosted(), Skin\preloadExistence(), ApiQueryContributions\prepareQuery(), ImportReporter\reportPage(), ApiQueryWatchlist\run(), ApiQueryRecentChanges\run(), Skin\showEmailUser(), ApiQueryBase\showHiddenUsersAddBlockInfo(), HTMLForm\tryAuthorizedSubmit(), RevDelList\updateLog(), and ApiQueryBase\userCanSeeRevDel().

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


Member Data Documentation


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