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

Public Member Functions

 __construct (IContextSource $context)
 
 setConfig (Config $config)
 
 getConfig ()
 
 getStats ()
 
 getTiming ()
 
 setRequest (WebRequest $request)
 
 getRequest ()
 
 setTitle (Title $title)
 
 getTitle ()
 
 canUseWikiPage ()
 
 setWikiPage (WikiPage $wikiPage)
 
 getWikiPage ()
 
 setOutput (OutputPage $output)
 
 getOutput ()
 
 setUser (User $user)
 
 getUser ()
 
 setLanguage ($language)
 
 getLanguage ()
 
 setSkin (Skin $skin)
 
 getSkin ()
 
 msg ($key)
 
- Public Member Functions inherited from ContextSource
 getContext ()
 
 setContext (IContextSource $context)
 
 getConfig ()
 
 getRequest ()
 
 getTitle ()
 
 canUseWikiPage ()
 
 getWikiPage ()
 
 getOutput ()
 
 getUser ()
 
 getLanguage ()
 
 getSkin ()
 
 getTiming ()
 
 getStats ()
 
 msg ($key)
 
 exportSession ()
 

Detailed Description

An IContextSource implementation which will inherit context from another source but allow individual pieces of context to be changed locally eg: A ContextSource that can inherit from the main RequestContext but have a different Title instance set on it.

Since
1.19

Constructor & Destructor Documentation

DerivativeContext::__construct ( IContextSource  $context)
Parameters
IContextSource$contextContext to inherit from

Member Function Documentation

DerivativeContext::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.

DerivativeContext::getConfig ( )
Returns
Config

Implements IContextSource.

DerivativeContext::getLanguage ( )
Returns
Language
Since
1.19

Implements IContextSource.

DerivativeContext::getOutput ( )
Returns
OutputPage

Implements IContextSource.

DerivativeContext::getRequest ( )
Returns
WebRequest

Implements IContextSource.

DerivativeContext::getSkin ( )
Returns
Skin

Implements IContextSource.

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

Implements IContextSource.

DerivativeContext::getTiming ( )
Returns
Timing

Implements IContextSource.

DerivativeContext::getTitle ( )
Returns
Title|null

Implements IContextSource.

DerivativeContext::getUser ( )
Returns
User

Implements IContextSource.

DerivativeContext::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.

DerivativeContext::msg (   $key)

Get a message using the current context.

This can't just inherit from ContextSource, since then it would set only the original context, and not take into account any changes.

Parameters
string|string[]|MessageSpecifier$key Message key, or array of keys, or a MessageSpecifier.
mixed$args,...Arguments to wfMessage
Returns
Message

Implements MessageLocalizer.

DerivativeContext::setConfig ( Config  $config)
Parameters
Config$config

Implements MutableContext.

DerivativeContext::setLanguage (   $language)
Parameters
Language | string$languageLanguage instance or language code
Exceptions
MWException
Since
1.19

Implements MutableContext.

DerivativeContext::setOutput ( OutputPage  $output)
Parameters
OutputPage$output

Implements MutableContext.

DerivativeContext::setRequest ( WebRequest  $request)
Parameters
WebRequest$request

Implements MutableContext.

DerivativeContext::setSkin ( Skin  $skin)
Parameters
Skin$skin

Implements MutableContext.

DerivativeContext::setTitle ( Title  $title)
Parameters
Title$title

Implements MutableContext.

DerivativeContext::setUser ( User  $user)
Parameters
User$user

Implements MutableContext.

DerivativeContext::setWikiPage ( WikiPage  $wikiPage)
Since
1.19
Parameters
WikiPage$wikiPage

Implements MutableContext.


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