MediaWiki master
|
A mutable version of Context. More...
Inherits MediaWiki\ResourceLoader\Context.
Public Member Functions | |
__construct (Context $context) | |
getContentOverrideCallback () | |
Return the replaced-content mapping callback. | |
getDebug () | |
getDirection () | |
getLanguage () | |
getModules () | |
getOnly () | |
getRaw () | |
getRequest () | |
getResourceLoader () | |
getSkin () | |
getUser () | |
getUserIdentity () | |
Get the possibly-cached UserIdentity object for the specified username. | |
getUserObj () | |
Get the possibly-cached User object for the specified username. | |
getVersion () | |
isSourceMap () | |
setContentOverrideCallback ( $callback) | |
setDebug (int $debug) | |
setDirection (string $direction) | |
setIsSourceMap (bool $sourcemap) | |
setLanguage (string $language) | |
setModules (array $modules) | |
setOnly (?string $only) | |
setRaw (bool $raw) | |
setSkin (string $skin) | |
setUser (?string $user) | |
setVersion (?string $version) | |
Public Member Functions inherited from MediaWiki\ResourceLoader\Context | |
__construct (ResourceLoader $resourceLoader, WebRequest $request, $validSkins=null) | |
encodeJson ( $data) | |
Wrapper around json_encode that avoids needless escapes, and pretty-prints in debug mode. | |
getFormat () | |
getHash () | |
All factors that uniquely identify this request, except 'modules'. | |
getImage () | |
getImageObj () | |
If this is a request for an image, get the Image object. | |
getLogger () | |
getReqBase () | |
Get the request base parameters, omitting any defaults. | |
getVariant () | |
msg ( $key,... $params) | |
Get a Message object with context set. | |
shouldIncludeMessages () | |
shouldIncludeScripts () | |
shouldIncludeStyles () | |
Protected Attributes | |
int callable null | $contentOverrideCallback = self::INHERIT_VALUE |
int | $debug = self::INHERIT_VALUE |
int string null | $direction = self::INHERIT_VALUE |
int string | $language = self::INHERIT_VALUE |
int string[] | $modules = self::INHERIT_VALUE |
int string null | $only = self::INHERIT_VALUE |
int bool | $raw = self::INHERIT_VALUE |
int string | $skin = self::INHERIT_VALUE |
int bool | $sourcemap = self::INHERIT_VALUE |
int string null | $user = self::INHERIT_VALUE |
int UserIdentity null false | $userIdentity = self::INHERIT_VALUE |
int User null | $userObj = self::INHERIT_VALUE |
int string null | $version = self::INHERIT_VALUE |
Protected Attributes inherited from MediaWiki\ResourceLoader\Context | |
int | $debug |
string null | $direction |
string null | $format |
string null | $hash |
string null | $image |
Image false | $imageObj |
string | $language |
LoggerInterface | $logger |
string[] | $modules |
string null | $only |
bool | $raw |
WebRequest | $request |
ResourceLoader | $resourceLoader |
string | $skin |
bool | $sourcemap |
string null | $user |
UserIdentity null false | $userIdentity = false |
User null | $userObj |
string null | $variant |
string null | $version |
Additional Inherited Members | |
Static Public Member Functions inherited from MediaWiki\ResourceLoader\Context | |
static | debugFromString (?string $debug) |
static | newDummyContext () |
Return a dummy Context object suitable for passing into things that don't "really" need a context. | |
Public Attributes inherited from MediaWiki\ResourceLoader\Context | |
const | DEBUG_LEGACY = 1 |
const | DEBUG_MAIN = 2 |
const | DEBUG_OFF = 0 |
const | DEFAULT_LANG = 'qqx' |
const | DEFAULT_SKIN = 'fallback' |
A mutable version of Context.
Allows changing specific properties of a context object, without changing the main one. Inspired by MediaWiki's DerivativeContext.
Definition at line 39 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::__construct | ( | Context | $context | ) |
Definition at line 74 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getContentOverrideCallback | ( | ) |
Return the replaced-content mapping callback.
When editing a page that's used to generate the scripts or styles of a WikiModule, a preview should use the to-be-saved version of the page rather than the current version in the database. A context supporting such previews should return a callback to return these mappings here.
Content|null func( Title $t )
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 259 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getDebug | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 187 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getDirection | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 107 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getLanguage | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 93 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getModules | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 78 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getOnly | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 199 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getRaw | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 229 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getRequest | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 251 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getResourceLoader | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 255 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getSkin | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 123 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getUser | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 135 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getUserIdentity | ( | ) |
Get the possibly-cached UserIdentity object for the specified username.
This will be null on most requests, except for load.php requests that have a 'user' parameter set.
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 142 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getUserObj | ( | ) |
Get the possibly-cached User object for the specified username.
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 161 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getVersion | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 214 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::isSourceMap | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 240 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setContentOverrideCallback | ( | $callback | ) |
callable | null | int | $callback | As per self::getContentOverrideCallback, or self::INHERIT_VALUE |
Definition at line 272 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setDebug | ( | int | $debug | ) |
Definition at line 194 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setDirection | ( | string | $direction | ) |
Definition at line 118 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setIsSourceMap | ( | bool | $sourcemap | ) |
Definition at line 247 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setLanguage | ( | string | $language | ) |
Definition at line 100 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setModules | ( | array | $modules | ) |
string[] | $modules |
Definition at line 89 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setOnly | ( | ?string | $only | ) |
string | null | $only |
Definition at line 209 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setRaw | ( | bool | $raw | ) |
Definition at line 236 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setSkin | ( | string | $skin | ) |
Definition at line 130 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setUser | ( | ?string | $user | ) |
string | null | $user |
Definition at line 179 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setVersion | ( | ?string | $version | ) |
string | null | $version |
Definition at line 224 of file DerivativeContext.php.
|
protected |
Definition at line 72 of file DerivativeContext.php.
|
protected |
Definition at line 62 of file DerivativeContext.php.
|
protected |
Definition at line 52 of file DerivativeContext.php.
|
protected |
Definition at line 50 of file DerivativeContext.php.
|
protected |
Definition at line 48 of file DerivativeContext.php.
|
protected |
Definition at line 64 of file DerivativeContext.php.
|
protected |
Definition at line 68 of file DerivativeContext.php.
|
protected |
Definition at line 54 of file DerivativeContext.php.
|
protected |
Definition at line 70 of file DerivativeContext.php.
|
protected |
Definition at line 56 of file DerivativeContext.php.
|
protected |
Definition at line 58 of file DerivativeContext.php.
|
protected |
Definition at line 60 of file DerivativeContext.php.
|
protected |
Definition at line 66 of file DerivativeContext.php.