MediaWiki
1.28.0
|
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 () | |
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 31 of file ResourceLoaderContext.php.
ResourceLoaderContext::__construct | ( | ResourceLoader | $resourceLoader, |
WebRequest | $request | ||
) |
ResourceLoader | $resourceLoader | |
WebRequest | $request |
Definition at line 60 of file ResourceLoaderContext.php.
References $modules, $request, $resourceLoader, format, ResourceLoader\getConfig(), WebRequest\getFuzzyBool(), ResourceLoader\getLogger(), 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 106 of file ResourceLoaderContext.php.
References $modules, $retval, and as.
Referenced by ResourceLoaderTest\testExpandModuleNames().
ResourceLoaderContext::getDebug | ( | ) |
Definition at line 260 of file ResourceLoaderContext.php.
References $debug.
Referenced by ResourceLoaderModule\buildContent(), ResourceLoaderFileModule\getFileHashes(), getHash(), ResourceLoaderFileModule\getScriptFiles(), ResourceLoaderClientHtml\makeLoad(), ResourceLoader\makeModuleResponse(), ResourceLoader\respond(), ResourceLoader\sendResponseHeaders(), ResourceLoader\tryRespondFromFileCache(), and ResourceLoader\tryRespondNotModified().
ResourceLoaderContext::getDirection | ( | ) |
Definition at line 195 of file ResourceLoaderContext.php.
References $direction, Language\factory(), getLanguage(), and getRequest().
Referenced by ResourceLoaderImage\getPath().
ResourceLoaderContext::getFormat | ( | ) |
Definition at line 304 of file ResourceLoaderContext.php.
References $format.
Referenced by getHash(), ResourceLoaderImage\getImageData(), and ResourceLoaderImage\sendResponseHeaders().
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 375 of file ResourceLoaderContext.php.
References $hash, getDebug(), getFormat(), getImage(), getLanguage(), getOnly(), getRaw(), getSkin(), getUser(), getVariant(), and getVersion().
Referenced by ResourceLoaderStartUpModule\getAllModuleHashes(), ResourceLoaderModule\getModuleContent(), ResourceLoaderModule\getVersionHash(), and ResourceFileCache\newFromContext().
ResourceLoaderContext::getImage | ( | ) |
Definition at line 290 of file ResourceLoaderContext.php.
References $image.
Referenced by getHash(), and ResourceFileCache\newFromContext().
ResourceLoaderContext::getImageObj | ( | ) |
If this is a request for an image, get the ResourceLoaderImage object.
Definition at line 314 of file ResourceLoaderContext.php.
References $image, $imageObj, $modules, getModules(), and getResourceLoader().
Referenced by ResourceLoader\makeModuleResponse(), ResourceLoader\respond(), and ResourceLoader\sendResponseHeaders().
ResourceLoaderContext::getLanguage | ( | ) |
Definition at line 177 of file ResourceLoaderContext.php.
References $lang, $language, getRequest(), getResourceLoader(), Language\isValidBuiltInCode(), and wfDebug().
Referenced by ResourceLoaderLanguageDataModule\getData(), ResourceLoaderLanguageNamesModule\getData(), getDirection(), ResourceLoaderModule\getFileDependencies(), ResourceLoaderFileModule\getFileHashes(), getHash(), ResourceLoaderEditToolbarModule\getLessVars(), ResourceLoaderModule\getMessageBlob(), ResourceLoaderImage\getPath(), ResourceLoaderLanguageNamesModule\getScript(), ResourceLoaderLanguageDataModule\getScript(), ResourceLoaderFileModule\getScriptFiles(), ResourceLoaderImage\getUrl(), msg(), ResourceLoader\preloadModuleInfo(), ResourceLoaderModule\saveFileDependencies(), and ResourceLoaderModule\setFileDependencies().
ResourceLoaderContext::getLogger | ( | ) |
Definition at line 163 of file ResourceLoaderContext.php.
References $logger.
Referenced by ResourceLoaderStartUpModule\getModuleRegistrations().
ResourceLoaderContext::getModules | ( | ) |
Definition at line 170 of file ResourceLoaderContext.php.
References $modules.
Referenced by getImageObj(), ResourceLoader\makeVersionQuery(), ResourceFileCache\newFromContext(), and ResourceLoader\respond().
ResourceLoaderContext::getOnly | ( | ) |
Definition at line 267 of file ResourceLoaderContext.php.
References $only.
Referenced by ResourceLoaderModule\buildContent(), getHash(), ResourceLoaderStartUpModule\getScript(), ResourceLoader\makeModuleResponse(), ResourceFileCache\newFromContext(), ResourceLoader\sendResponseHeaders(), shouldIncludeMessages(), shouldIncludeScripts(), and shouldIncludeStyles().
ResourceLoaderContext::getRaw | ( | ) |
Definition at line 283 of file ResourceLoaderContext.php.
References $raw.
Referenced by getHash(), ResourceLoaderClientHtml\makeLoad(), and ResourceLoader\makeModuleResponse().
ResourceLoaderContext::getRequest | ( | ) |
Definition at line 155 of file ResourceLoaderContext.php.
References $request.
Referenced by getDirection(), getLanguage(), ResourceLoaderStartUpModule\getModuleRegistrations(), ResourceLoaderUserModule\getPages(), ResourceLoaderUserStylesModule\getPages(), ResourceLoaderClientHtml\makeContext(), ResourceLoader\respond(), ResourceLoader\tryRespondNotModified(), and ResourceFileCache\useFileCache().
ResourceLoaderContext::getResourceLoader | ( | ) |
Definition at line 148 of file ResourceLoaderContext.php.
References $resourceLoader.
Referenced by ResourceLoaderClientHtml\__construct(), ResourceLoaderModule\buildContent(), ResourceLoaderFileModule\compileLessFile(), ResourceLoaderStartUpModule\getAllModuleHashes(), getImageObj(), getLanguage(), ResourceLoaderModule\getMessageBlob(), ResourceLoaderStartUpModule\getModuleRegistrations(), ResourceLoaderUploadDialogModule\getScript(), ResourceLoaderModule\getScriptURLsForDebug(), ResourceLoaderStartUpModule\getStartupModulesUrl(), ResourceLoaderImageModule\getStyles(), ResourceLoaderModule\getStyleURLsForDebug(), ResourceLoaderClientHtml\makeContext(), ResourceLoaderClientHtml\makeLoad(), and ResourceLoaderWikiModule\preloadTitleInfo().
ResourceLoaderContext::getSkin | ( | ) |
Definition at line 209 of file ResourceLoaderContext.php.
References $skin.
Referenced by ResourceLoaderModule\getFileDependencies(), ResourceLoaderFileModule\getFileHashes(), ResourceLoaderImageModule\getGlobalVariants(), getHash(), ResourceLoaderImageModule\getImages(), ResourceLoaderUserStylesModule\getPages(), ResourceLoaderUserModule\getPages(), ResourceLoaderSiteModule\getPages(), ResourceLoaderSiteStylesModule\getPages(), ResourceLoaderFileModule\getScriptFiles(), ResourceLoaderFileModule\getStyleFiles(), ResourceLoader\preloadModuleInfo(), ResourceLoaderModule\saveFileDependencies(), and ResourceLoaderModule\setFileDependencies().
ResourceLoaderContext::getUser | ( | ) |
Definition at line 216 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 242 of file ResourceLoaderContext.php.
References $username, $userObj, getUser(), User\newFromName(), and User.
Referenced by ResourceLoaderUserTokensModule\contextUserTokens(), ResourceLoaderUserStylesModule\getPages(), ResourceLoaderUserModule\getPages(), ResourceLoaderUserOptionsModule\getScript(), and ResourceLoaderUserCSSPrefsModule\getStyles().
ResourceLoaderContext::getVariant | ( | ) |
Definition at line 297 of file ResourceLoaderContext.php.
References $variant.
Referenced by getHash(), and ResourceLoaderImage\getImageData().
ResourceLoaderContext::getVersion | ( | ) |
Definition at line 276 of file ResourceLoaderContext.php.
References $version.
Referenced by getHash(), ResourceLoaderImage\getUrl(), ResourceLoader\sendResponseHeaders(), and ResourceLoader\tryRespondFromFileCache().
ResourceLoaderContext::msg | ( | ) |
Get a Message object with context set.
See wfMessage for parameters.
mixed | ... |
Definition at line 227 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 138 of file ResourceLoaderContext.php.
References ConfigFactory\getDefaultInstance().
Referenced by ResourceLoaderFileModule\readStyleFiles(), ResourceLoaderContextTest\testDummy(), and ResourceLoaderWikiModuleTest\testGetPages().
ResourceLoaderContext::shouldIncludeMessages | ( | ) |
ResourceLoaderContext::shouldIncludeScripts | ( | ) |
Definition at line 346 of file ResourceLoaderContext.php.
References getOnly().
Referenced by ResourceLoaderModule\buildContent(), ResourceLoader\makeModuleResponse(), and ResourceLoader\respond().
ResourceLoaderContext::shouldIncludeStyles | ( | ) |
Definition at line 353 of file ResourceLoaderContext.php.
References getOnly().
Referenced by ResourceLoaderModule\buildContent().
|
protected |
Definition at line 39 of file ResourceLoaderContext.php.
Referenced by getDebug().
|
protected |
Definition at line 51 of file ResourceLoaderContext.php.
Referenced by getDirection().
|
protected |
Definition at line 49 of file ResourceLoaderContext.php.
Referenced by getFormat().
|
protected |
Definition at line 52 of file ResourceLoaderContext.php.
Referenced by getHash().
|
protected |
Definition at line 47 of file ResourceLoaderContext.php.
Referenced by getImage(), and getImageObj().
|
protected |
Definition at line 54 of file ResourceLoaderContext.php.
Referenced by getImageObj().
|
protected |
Definition at line 38 of file ResourceLoaderContext.php.
Referenced by getLanguage().
|
protected |
Definition at line 34 of file ResourceLoaderContext.php.
Referenced by getLogger().
|
protected |
Definition at line 43 of file ResourceLoaderContext.php.
Referenced by __construct(), expandModuleNames(), getImageObj(), and getModules().
|
protected |
Definition at line 44 of file ResourceLoaderContext.php.
Referenced by getOnly().
|
protected |
Definition at line 46 of file ResourceLoaderContext.php.
Referenced by getRaw().
|
protected |
Definition at line 33 of file ResourceLoaderContext.php.
Referenced by __construct(), and getRequest().
|
protected |
Definition at line 32 of file ResourceLoaderContext.php.
Referenced by __construct(), and getResourceLoader().
|
protected |
Definition at line 37 of file ResourceLoaderContext.php.
Referenced by getSkin().
|
protected |
Definition at line 40 of file ResourceLoaderContext.php.
Referenced by getUser().
|
protected |
Definition at line 53 of file ResourceLoaderContext.php.
Referenced by getUserObj().
|
protected |
Definition at line 48 of file ResourceLoaderContext.php.
Referenced by getVariant().
|
protected |
Definition at line 45 of file ResourceLoaderContext.php.
Referenced by getVersion().