MediaWiki REL1_39
|
A mutable version of Context. More...
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 () | |
setContentOverrideCallback ( $callback) | |
setDebug (int $debug) | |
setDirection (string $direction) | |
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) | |
encodeJson ( $data) | |
Wrapper around json_encode that avoids needless escapes, and pretty-prints in debug mode. | |
getConfig () | |
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 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 |
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_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 72 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 246 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getDebug | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 185 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getDirection | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 105 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getLanguage | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 91 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getModules | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 76 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getOnly | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 197 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getRaw | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 227 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getRequest | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 238 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getResourceLoader | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 242 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getSkin | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 121 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getUser | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 133 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 140 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 159 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::getVersion | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 212 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setContentOverrideCallback | ( | $callback | ) |
callable | null | int | $callback | As per self::getContentOverrideCallback, or self::INHERIT_VALUE |
Definition at line 259 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setDebug | ( | int | $debug | ) |
Definition at line 192 of file DerivativeContext.php.
References $debug.
MediaWiki\ResourceLoader\DerivativeContext::setDirection | ( | string | $direction | ) |
Definition at line 116 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setLanguage | ( | string | $language | ) |
Definition at line 98 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setModules | ( | array | $modules | ) |
string[] | $modules |
Definition at line 87 of file DerivativeContext.php.
References $modules.
MediaWiki\ResourceLoader\DerivativeContext::setOnly | ( | ?string | $only | ) |
string | null | $only |
Definition at line 207 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setRaw | ( | bool | $raw | ) |
Definition at line 234 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setSkin | ( | string | $skin | ) |
Definition at line 128 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setUser | ( | ?string | $user | ) |
string | null | $user |
Definition at line 177 of file DerivativeContext.php.
MediaWiki\ResourceLoader\DerivativeContext::setVersion | ( | ?string | $version | ) |
string | null | $version |
Definition at line 222 of file DerivativeContext.php.
|
protected |
Definition at line 70 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 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.