BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
ContextSource Class Reference
Inheritance diagram for ContextSource:
Collaboration diagram for ContextSource:

Public Member Functions

 getContext ()
 
 setContext (IContextSource $context)
 
 getConfig ()
 
 getRequest ()
 
 getTitle ()
 
 canUseWikiPage ()
 
 getWikiPage ()
 
 getOutput ()
 
 getUser ()
 
 getLanguage ()
 
 getSkin ()
 
 getTiming ()
 
 getStats ()
 
 msg ($key)
 
 exportSession ()
 

Detailed Description

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

Since
1.18

Member Function Documentation

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

Implements IContextSource.

ContextSource::exportSession ( )

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.

ContextSource::getConfig ( )
Since
1.23
Returns
Config

Implements IContextSource.

ContextSource::getContext ( )

Get the base IContextSource object

Since
1.18
Returns
IContextSource
ContextSource::getLanguage ( )
Since
1.19
Returns
Language

Implements IContextSource.

ContextSource::getOutput ( )
Since
1.18
Returns
OutputPage

Implements IContextSource.

ContextSource::getRequest ( )
Since
1.18
Returns
WebRequest

Implements IContextSource.

ContextSource::getSkin ( )
Since
1.18
Returns
Skin

Implements IContextSource.

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

Implements IContextSource.

ContextSource::getTiming ( )
Since
1.27
Returns
Timing

Implements IContextSource.

ContextSource::getTitle ( )
Since
1.18
Returns
Title|null

Implements IContextSource.

ContextSource::getUser ( )
Since
1.18
Returns
User

Implements IContextSource.

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

Implements IContextSource.

ContextSource::msg (   $key)

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

Since
1.18
Parameters
string|string[]|MessageSpecifier$key Message key, or array of keys, or a MessageSpecifier.
mixed$args,...
Returns
Message

Implements MessageLocalizer.

ContextSource::setContext ( IContextSource  $context)
Since
1.18
Parameters
IContextSource$context

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