MediaWiki master
|
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. More...
Inherits MediaWiki\Context\ContextSource, and MediaWiki\Context\MutableContext.
Public Member Functions | |
__construct (IContextSource $context) | |
canUseWikiPage () | |
Check whether a WikiPage object can be get with getWikiPage(). | |
getActionName () | |
Get the action name for the current web request. | |
getAuthority () | |
getConfig () | |
getLanguage () | |
getOutput () | |
getRequest () | |
getSkin () | |
getTiming () | |
getTitle () | |
getUser () | |
getWikiPage () | |
Get the WikiPage object. | |
msg ( $key,... $params) | |
Get a message using the current context. | |
setActionName (string $action) | |
setAuthority (Authority $authority) | |
setConfig (Config $config) | |
setLanguage ( $language) | |
setOutput (OutputPage $output) | |
setRequest (WebRequest $request) | |
setSkin (Skin $skin) | |
setTitle (Title $title) | |
setUser (User $user) | |
setWikiPage (WikiPage $wikiPage) | |
Public Member Functions inherited from MediaWiki\Context\ContextSource | |
exportSession () | |
Export the resolved user IP, HTTP headers, user ID, and session ID. | |
getContext () | |
Get the base IContextSource object. | |
getCsrfTokenSet () | |
Get a repository to obtain and match CSRF tokens. | |
getLanguageCode () | |
setContext (IContextSource $context) | |
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.
Definition at line 48 of file DerivativeContext.php.
MediaWiki\Context\DerivativeContext::__construct | ( | IContextSource | $context | ) |
IContextSource | $context | Context to inherit from |
Definition at line 108 of file DerivativeContext.php.
References MediaWiki\Context\ContextSource\setContext().
MediaWiki\Context\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.
Reimplemented from MediaWiki\Context\ContextSource.
Definition at line 170 of file DerivativeContext.php.
References MediaWiki\Context\ContextSource\getContext().
MediaWiki\Context\DerivativeContext::getActionName | ( | ) |
Get the action name for the current web request.
Reimplemented from MediaWiki\Context\ContextSource.
Definition at line 226 of file DerivativeContext.php.
MediaWiki\Context\DerivativeContext::getAuthority | ( | ) |
Reimplemented from MediaWiki\Context\ContextSource.
Definition at line 283 of file DerivativeContext.php.
MediaWiki\Context\DerivativeContext::getConfig | ( | ) |
Reimplemented from MediaWiki\Context\ContextSource.
Definition at line 122 of file DerivativeContext.php.
References MediaWiki\Context\ContextSource\getContext().
MediaWiki\Context\DerivativeContext::getLanguage | ( | ) |
Reimplemented from MediaWiki\Context\ContextSource.
Definition at line 306 of file DerivativeContext.php.
MediaWiki\Context\DerivativeContext::getOutput | ( | ) |
Reimplemented from MediaWiki\Context\ContextSource.
Definition at line 248 of file DerivativeContext.php.
MediaWiki\Context\DerivativeContext::getRequest | ( | ) |
Reimplemented from MediaWiki\Context\ContextSource.
Definition at line 143 of file DerivativeContext.php.
References MediaWiki\Context\ContextSource\getContext().
MediaWiki\Context\DerivativeContext::getSkin | ( | ) |
Reimplemented from MediaWiki\Context\ContextSource.
Definition at line 321 of file DerivativeContext.php.
MediaWiki\Context\DerivativeContext::getTiming | ( | ) |
Reimplemented from MediaWiki\Context\ContextSource.
Definition at line 129 of file DerivativeContext.php.
References MediaWiki\Context\ContextSource\getContext().
MediaWiki\Context\DerivativeContext::getTitle | ( | ) |
Reimplemented from MediaWiki\Context\ContextSource.
Definition at line 158 of file DerivativeContext.php.
References MediaWiki\Context\ContextSource\getContext().
MediaWiki\Context\DerivativeContext::getUser | ( | ) |
Reimplemented from MediaWiki\Context\ContextSource.
Definition at line 263 of file DerivativeContext.php.
MediaWiki\Context\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.
Reimplemented from MediaWiki\Context\ContextSource.
Definition at line 204 of file DerivativeContext.php.
References MediaWiki\Context\ContextSource\getContext(), and MediaWiki\MediaWikiServices\getInstance().
MediaWiki\Context\DerivativeContext::msg | ( | $key, | |
$params ) |
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.
string | string[] | MessageSpecifier | $key | Message key, or array of keys, or a MessageSpecifier. @phpcs:ignore Generic.Files.LineLength |
MessageParam|MessageSpecifier|string|int|float|list<MessageParam|MessageSpecifier|string|int|float> | ...$params See Message::params() |
Reimplemented from MediaWiki\Context\ContextSource.
Definition at line 339 of file DerivativeContext.php.
References $params, and wfMessage().
MediaWiki\Context\DerivativeContext::setActionName | ( | string | $action | ) |
string | $action |
Implements MediaWiki\Context\MutableContext.
Definition at line 216 of file DerivativeContext.php.
MediaWiki\Context\DerivativeContext::setAuthority | ( | Authority | $authority | ) |
Authority | $authority |
Implements MediaWiki\Context\MutableContext.
Definition at line 273 of file DerivativeContext.php.
MediaWiki\Context\DerivativeContext::setConfig | ( | Config | $config | ) |
Config | $config |
Implements MediaWiki\Context\MutableContext.
Definition at line 115 of file DerivativeContext.php.
MediaWiki\Context\DerivativeContext::setLanguage | ( | $language | ) |
Language | string | $language | Language instance or language code |
Implements MediaWiki\Context\MutableContext.
Definition at line 291 of file DerivativeContext.php.
MediaWiki\Context\DerivativeContext::setOutput | ( | OutputPage | $output | ) |
OutputPage | $output |
Implements MediaWiki\Context\MutableContext.
Definition at line 241 of file DerivativeContext.php.
MediaWiki\Context\DerivativeContext::setRequest | ( | WebRequest | $request | ) |
WebRequest | $request |
Implements MediaWiki\Context\MutableContext.
Definition at line 136 of file DerivativeContext.php.
MediaWiki\Context\DerivativeContext::setSkin | ( | Skin | $skin | ) |
Skin | $skin |
Implements MediaWiki\Context\MutableContext.
Definition at line 313 of file DerivativeContext.php.
References MediaWiki\Context\ContextSource\setContext().
MediaWiki\Context\DerivativeContext::setTitle | ( | Title | $title | ) |
Title | $title |
Implements MediaWiki\Context\MutableContext.
Definition at line 150 of file DerivativeContext.php.
Referenced by MediaWiki\Context\DerivativeContext\setWikiPage().
MediaWiki\Context\DerivativeContext::setUser | ( | User | $user | ) |
User | $user |
Implements MediaWiki\Context\MutableContext.
Definition at line 255 of file DerivativeContext.php.
MediaWiki\Context\DerivativeContext::setWikiPage | ( | WikiPage | $wikiPage | ) |
WikiPage | $wikiPage |
Implements MediaWiki\Context\MutableContext.
Definition at line 186 of file DerivativeContext.php.
References WikiPage\getTitle(), and MediaWiki\Context\DerivativeContext\setTitle().