MediaWiki
1.30.2
|
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) | |
getDebug () | |
getDirection () | |
getFormat () | |
getHash () | |
All factors that uniquely identify this request, except 'modules'. More... | |
getImage () | |
getImageObj () | |
If this is a request for an image, get the ResourceLoaderImage object. More... | |
getLanguage () | |
getLogger () | |
getModules () | |
getOnly () | |
getRaw () | |
getRequest () | |
getResourceLoader () | |
getSkin () | |
getUser () | |
getUserObj () | |
Get the possibly-cached User object for the specified username. More... | |
getVariant () | |
getVersion () | |
msg ( $key) | |
Get a Message object with context set. More... | |
shouldIncludeMessages () | |
shouldIncludeScripts () | |
shouldIncludeStyles () | |
Static Public Member Functions | |
static | expandModuleNames ( $modules) |
Expand a string of the form jquery.foo,bar|jquery.ui.baz,quux to an array of module names like [ 'jquery.foo', 'jquery.bar', 'jquery.ui.baz', 'jquery.ui.quux' ]. More... | |
static | newDummyContext () |
Return a dummy ResourceLoaderContext object suitable for passing into things that don't "really" need a context. More... | |
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, expandModuleNames(), format, WebRequest\getRawVal(), Skin\getSkinNames(), request, skin(), user, and version.
|
static |
Expand a string of the form jquery.foo,bar|jquery.ui.baz,quux to an array of module names like [ 'jquery.foo', 'jquery.bar', 'jquery.ui.baz', 'jquery.ui.quux' ].
string | $modules | Packed module name list |
Definition at line 107 of file ResourceLoaderContext.php.
References $modules, $retval, and as.
Referenced by __construct(), and ResourceLoaderTest\testExpandModuleNames().
ResourceLoaderContext::getDebug | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 263 of file ResourceLoaderContext.php.
References $debug.
Referenced by getHash(), and ResourceLoaderClientHtml\makeLoad().
ResourceLoaderContext::getDirection | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 196 of file ResourceLoaderContext.php.
References $direction, Language\factory(), getLanguage(), and getRequest().
ResourceLoaderContext::getFormat | ( | ) |
Definition at line 307 of file ResourceLoaderContext.php.
References $format.
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 378 of file ResourceLoaderContext.php.
References $hash, getDebug(), getFormat(), getImage(), getLanguage(), getOnly(), getRaw(), getSkin(), getUser(), getVariant(), and getVersion().
ResourceLoaderContext::getImage | ( | ) |
Definition at line 293 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 317 of file ResourceLoaderContext.php.
References $image, $imageObj, $modules, captcha-old\count, getModules(), and getResourceLoader().
ResourceLoaderContext::getLanguage | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 178 of file ResourceLoaderContext.php.
References $lang, $language, getRequest(), getResourceLoader(), Language\isValidBuiltInCode(), language(), and wfDebug().
Referenced by getDirection(), ResourceLoaderFileModule\getFileHashes(), getHash(), ResourceLoaderModule\getMessageBlob(), ResourceLoaderFileModule\getScriptFiles(), and msg().
ResourceLoaderContext::getLogger | ( | ) |
Definition at line 164 of file ResourceLoaderContext.php.
References $logger.
ResourceLoaderContext::getModules | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 171 of file ResourceLoaderContext.php.
References $modules.
Referenced by getImageObj().
ResourceLoaderContext::getOnly | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 270 of file ResourceLoaderContext.php.
References $only.
Referenced by getHash(), shouldIncludeMessages(), shouldIncludeScripts(), and shouldIncludeStyles().
ResourceLoaderContext::getRaw | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 286 of file ResourceLoaderContext.php.
References $raw.
Referenced by getHash(), and ResourceLoaderClientHtml\makeLoad().
ResourceLoaderContext::getRequest | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 156 of file ResourceLoaderContext.php.
References $request.
Referenced by getDirection(), getLanguage(), and ResourceLoaderClientHtml\makeContext().
ResourceLoaderContext::getResourceLoader | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 149 of file ResourceLoaderContext.php.
References $resourceLoader.
Referenced by ResourceLoaderClientHtml\__construct(), getImageObj(), getLanguage(), ResourceLoaderClientHtml\makeContext(), and ResourceLoaderClientHtml\makeLoad().
ResourceLoaderContext::getSkin | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 210 of file ResourceLoaderContext.php.
References $skin.
Referenced by getHash().
ResourceLoaderContext::getUser | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 217 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 245 of file ResourceLoaderContext.php.
References $username, $userObj, getUser(), User\newFromName(), and User.
Referenced by ResourceLoaderUserModule\getPages(), and ResourceLoaderUserStylesModule\getPages().
ResourceLoaderContext::getVariant | ( | ) |
Definition at line 300 of file ResourceLoaderContext.php.
References $variant.
Referenced by getHash().
ResourceLoaderContext::getVersion | ( | ) |
Reimplemented in DerivativeResourceLoaderContext.
Definition at line 279 of file ResourceLoaderContext.php.
References $version.
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 230 of file ResourceLoaderContext.php.
References getLanguage(), and Title\newFromText().
|
static |
Return a dummy ResourceLoaderContext object suitable for passing into things that don't "really" need a context.
Definition at line 139 of file ResourceLoaderContext.php.
Referenced by ResourceLoaderFileModule\readStyleFiles(), ResourceLoaderContextTest\testDummy(), and ResourceLoaderWikiModuleTest\testGetPages().
ResourceLoaderContext::shouldIncludeMessages | ( | ) |
ResourceLoaderContext::shouldIncludeScripts | ( | ) |
ResourceLoaderContext::shouldIncludeStyles | ( | ) |
|
protected |
Definition at line 40 of file ResourceLoaderContext.php.
Referenced by getDebug().
|
protected |
Definition at line 52 of file ResourceLoaderContext.php.
Referenced by getDirection().
|
protected |
Definition at line 50 of file ResourceLoaderContext.php.
Referenced by getFormat().
|
protected |
Definition at line 53 of file ResourceLoaderContext.php.
Referenced by getHash().
|
protected |
Definition at line 48 of file ResourceLoaderContext.php.
Referenced by getImage(), and getImageObj().
|
protected |
Definition at line 55 of file ResourceLoaderContext.php.
Referenced by getImageObj().
|
protected |
Definition at line 39 of file ResourceLoaderContext.php.
Referenced by getLanguage().
|
protected |
Definition at line 35 of file ResourceLoaderContext.php.
Referenced by getLogger().
|
protected |
Definition at line 44 of file ResourceLoaderContext.php.
Referenced by __construct(), expandModuleNames(), getImageObj(), and getModules().
|
protected |
Definition at line 45 of file ResourceLoaderContext.php.
Referenced by getOnly().
|
protected |
Definition at line 47 of file ResourceLoaderContext.php.
Referenced by getRaw().
|
protected |
Definition at line 34 of file ResourceLoaderContext.php.
Referenced by __construct(), and getRequest().
|
protected |
Definition at line 33 of file ResourceLoaderContext.php.
Referenced by __construct(), and getResourceLoader().
|
protected |
Definition at line 38 of file ResourceLoaderContext.php.
Referenced by getSkin().
|
protected |
Definition at line 41 of file ResourceLoaderContext.php.
Referenced by getUser().
|
protected |
Definition at line 54 of file ResourceLoaderContext.php.
Referenced by getUserObj().
|
protected |
Definition at line 49 of file ResourceLoaderContext.php.
Referenced by getVariant().
|
protected |
Definition at line 46 of file ResourceLoaderContext.php.
Referenced by getVersion().