MediaWiki REL1_33
|
Object passed around to modules which contains information about the state of a specific loader request. More...
Public Member Functions | |
__construct (ResourceLoader $resourceLoader, WebRequest $request) | |
getConfig () | |
getContentOverrideCallback () | |
Return the replaced-content mapping callback. | |
getDebug () | |
getDirection () | |
getFormat () | |
getHash () | |
All factors that uniquely identify this request, except 'modules'. | |
getImage () | |
getImageObj () | |
If this is a request for an image, get the ResourceLoaderImage object. | |
getLanguage () | |
getLogger () | |
getModules () | |
getOnly () | |
getRaw () | |
getRequest () | |
getResourceLoader () | |
getSkin () | |
getUser () | |
getUserObj () | |
Get the possibly-cached User object for the specified username. | |
getVariant () | |
getVersion () | |
msg ( $key) | |
Get a Message object with context set. | |
shouldIncludeMessages () | |
shouldIncludeScripts () | |
shouldIncludeStyles () | |
Static Public Member Functions | |
static | expandModuleNames ( $modules) |
Reverse the process done by ResourceLoader::makePackedModulesString(). | |
static | newDummyContext () |
Return a dummy ResourceLoaderContext object suitable for passing into things that don't "really" need a context. | |
Protected Attributes | |
$debug | |
$direction | |
$format | |
$hash | |
$image | |
$imageObj | |
$language | |
$logger | |
$modules | |
$only | |
$raw | |
$request | |
$resourceLoader | |
$skin | |
$user | |
$userObj | |
$variant | |
$version | |
Object passed around to modules which contains information about the state of a specific loader request.
Definition at line 32 of file ResourceLoaderContext.php.
ResourceLoaderContext::__construct | ( | ResourceLoader | $resourceLoader, |
WebRequest | $request ) |
ResourceLoader | $resourceLoader | |
WebRequest | $request |
Definition at line 61 of file ResourceLoaderContext.php.
References $modules, $request, $resourceLoader, and(), getConfig(), WebRequest\getRawVal(), and version.
|
static |
Reverse the process done by ResourceLoader::makePackedModulesString().
string | $modules | Packed module name list |
Definition at line 101 of file ResourceLoaderContext.php.
References $modules, and wfDeprecated().
ResourceLoaderContext::getConfig | ( | ) |
Definition at line 137 of file ResourceLoaderContext.php.
References getResourceLoader().
Referenced by __construct(), and getLanguage().
ResourceLoaderContext::getContentOverrideCallback | ( | ) |
Return the replaced-content mapping callback.
When editing a page that's used to generate the scripts or styles of a ResourceLoaderWikiModule, 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 in DerivativeResourceLoaderContext.
Definition at line 345 of file ResourceLoaderContext.php.
ResourceLoaderContext::getDebug | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 250 of file ResourceLoaderContext.php.
References $debug.
Referenced by getHash().
ResourceLoaderContext::getDirection | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 183 of file ResourceLoaderContext.php.
References getLanguage(), and getRequest().
ResourceLoaderContext::getFormat | ( | ) |
Definition at line 294 of file ResourceLoaderContext.php.
Referenced by getHash().
ResourceLoaderContext::getHash | ( | ) |
All factors that uniquely identify this request, except 'modules'.
The list of modules is excluded here for legacy reasons as most callers already split up handling of individual modules. Including it here would massively fragment the cache and decrease its usefulness.
E.g. Used by RequestFileCache to form a cache key for storing the reponse output.
Definition at line 381 of file ResourceLoaderContext.php.
References and(), getDebug(), getFormat(), getImage(), getLanguage(), getOnly(), getRaw(), getSkin(), getUser(), getVariant(), and getVersion().
ResourceLoaderContext::getImage | ( | ) |
Definition at line 280 of file ResourceLoaderContext.php.
References $image.
Referenced by getHash().
ResourceLoaderContext::getImageObj | ( | ) |
If this is a request for an image, get the ResourceLoaderImage object.
Definition at line 304 of file ResourceLoaderContext.php.
References $image, $modules, getModules(), and getResourceLoader().
ResourceLoaderContext::getLanguage | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 166 of file ResourceLoaderContext.php.
References $lang, getConfig(), getRequest(), and language().
Referenced by getDirection(), getHash(), ResourceLoaderModule\getMessageBlob(), and msg().
ResourceLoaderContext::getLogger | ( | ) |
ResourceLoaderContext::getModules | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 159 of file ResourceLoaderContext.php.
References $modules.
Referenced by getImageObj().
ResourceLoaderContext::getOnly | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 257 of file ResourceLoaderContext.php.
Referenced by getHash(), ResourceLoaderStartUpModule\getScript(), shouldIncludeMessages(), shouldIncludeScripts(), and shouldIncludeStyles().
ResourceLoaderContext::getRaw | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 273 of file ResourceLoaderContext.php.
Referenced by getHash(), and ResourceLoaderClientHtml\makeLoad().
ResourceLoaderContext::getRequest | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 144 of file ResourceLoaderContext.php.
References $request.
Referenced by getDirection(), and getLanguage().
ResourceLoaderContext::getResourceLoader | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 130 of file ResourceLoaderContext.php.
References $resourceLoader.
Referenced by ResourceLoaderClientHtml\__construct(), getConfig(), and getImageObj().
ResourceLoaderContext::getSkin | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 197 of file ResourceLoaderContext.php.
References $skin.
Referenced by getHash().
ResourceLoaderContext::getUser | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 204 of file ResourceLoaderContext.php.
References $user.
Referenced by getHash(), and getUserObj().
ResourceLoaderContext::getUserObj | ( | ) |
Get the possibly-cached User object for the specified username.
Definition at line 232 of file ResourceLoaderContext.php.
References $username, getUser(), and User\newFromName().
ResourceLoaderContext::getVariant | ( | ) |
Definition at line 287 of file ResourceLoaderContext.php.
Referenced by getHash().
ResourceLoaderContext::getVersion | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 266 of file ResourceLoaderContext.php.
Referenced by getHash().
ResourceLoaderContext::msg | ( | $key | ) |
Get a Message object with context set.
See wfMessage for parameters.
string | string[] | MessageSpecifier | $key | Message key, or array of keys, or a MessageSpecifier. |
mixed | $args,... |
Implements MessageLocalizer.
Definition at line 217 of file ResourceLoaderContext.php.
References and(), getLanguage(), and wfMessage().
|
static |
Return a dummy ResourceLoaderContext object suitable for passing into things that don't "really" need a context.
Use cases:
Definition at line 115 of file ResourceLoaderContext.php.
ResourceLoaderContext::shouldIncludeMessages | ( | ) |
ResourceLoaderContext::shouldIncludeScripts | ( | ) |
ResourceLoaderContext::shouldIncludeStyles | ( | ) |
|
protected |
Definition at line 40 of file ResourceLoaderContext.php.
|
protected |
Definition at line 52 of file ResourceLoaderContext.php.
|
protected |
Definition at line 50 of file ResourceLoaderContext.php.
|
protected |
Definition at line 53 of file ResourceLoaderContext.php.
|
protected |
Definition at line 48 of file ResourceLoaderContext.php.
|
protected |
Definition at line 55 of file ResourceLoaderContext.php.
|
protected |
Definition at line 39 of file ResourceLoaderContext.php.
|
protected |
Definition at line 35 of file ResourceLoaderContext.php.
|
protected |
Definition at line 44 of file ResourceLoaderContext.php.
|
protected |
Definition at line 45 of file ResourceLoaderContext.php.
|
protected |
Definition at line 47 of file ResourceLoaderContext.php.
|
protected |
Definition at line 34 of file ResourceLoaderContext.php.
|
protected |
Definition at line 33 of file ResourceLoaderContext.php.
|
protected |
Definition at line 38 of file ResourceLoaderContext.php.
|
protected |
Definition at line 41 of file ResourceLoaderContext.php.
|
protected |
Definition at line 54 of file ResourceLoaderContext.php.
|
protected |
Definition at line 49 of file ResourceLoaderContext.php.
|
protected |
Definition at line 46 of file ResourceLoaderContext.php.