|
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.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.
| |
| 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_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 25 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::__construct | ( | Context | $context | ) |
Definition at line 60 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 237 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::getDebug | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 170 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::getDirection | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 93 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::getLanguage | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 79 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::getModules | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 64 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::getOnly | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 182 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::getRaw | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 206 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::getRequest | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 228 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::getResourceLoader | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 232 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::getSkin | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 109 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::getUser | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 121 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 128 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 147 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::getVersion | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 194 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::isSourceMap | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Context.
Definition at line 217 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::setContentOverrideCallback | ( | $callback | ) |
| callable | null | int | $callback | As per self::getContentOverrideCallback, or self::INHERIT_VALUE |
Definition at line 250 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::setDebug | ( | int | $debug | ) |
Definition at line 177 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::setDirection | ( | string | $direction | ) |
Definition at line 104 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::setIsSourceMap | ( | bool | $sourcemap | ) |
Definition at line 224 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::setLanguage | ( | string | $language | ) |
Definition at line 86 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::setModules | ( | array | $modules | ) |
| string[] | $modules |
Definition at line 75 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::setOnly | ( | ?string | $only | ) |
Definition at line 189 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::setRaw | ( | bool | $raw | ) |
Definition at line 213 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::setSkin | ( | string | $skin | ) |
Definition at line 116 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::setUser | ( | ?string | $user | ) |
Definition at line 162 of file DerivativeContext.php.
| MediaWiki\ResourceLoader\DerivativeContext::setVersion | ( | ?string | $version | ) |
Definition at line 201 of file DerivativeContext.php.
|
protected |
Definition at line 58 of file DerivativeContext.php.
|
protected |
Definition at line 48 of file DerivativeContext.php.
|
protected |
Definition at line 38 of file DerivativeContext.php.
|
protected |
Definition at line 36 of file DerivativeContext.php.
|
protected |
Definition at line 34 of file DerivativeContext.php.
|
protected |
Definition at line 50 of file DerivativeContext.php.
|
protected |
Definition at line 54 of file DerivativeContext.php.
|
protected |
Definition at line 40 of file DerivativeContext.php.
|
protected |
Definition at line 56 of file DerivativeContext.php.
|
protected |
Definition at line 42 of file DerivativeContext.php.
|
protected |
Definition at line 44 of file DerivativeContext.php.
|
protected |
Definition at line 46 of file DerivativeContext.php.
|
protected |
Definition at line 52 of file DerivativeContext.php.