MediaWiki REL1_32
|
Abstraction for ResourceLoader modules, with name registration and maxage functionality. More...
Public Member Functions | |
enableModuleContentVersion () | |
Whether to generate version hash based on module content. | |
getConfig () | |
getDefinitionSummary (ResourceLoaderContext $context) | |
Get the definition summary for this module. | |
getDependencies (ResourceLoaderContext $context=null) | |
Get a list of modules this module depends on. | |
getDeprecationInformation () | |
Get JS representing deprecation information for the current module if available. | |
getFlip ( $context) | |
getGroup () | |
Get the group this module is in. | |
getHeaders (ResourceLoaderContext $context) | |
Get headers to send as part of a module web response. | |
getMessages () | |
Get the messages needed for this module. | |
getModuleContent (ResourceLoaderContext $context) | |
Get an array of this module's resources. | |
getName () | |
Get this module's name. | |
getOrigin () | |
Get this module's origin. | |
getScript (ResourceLoaderContext $context) | |
Get all JS for this module for a given language and skin. | |
getScriptURLsForDebug (ResourceLoaderContext $context) | |
Get the URL or URLs to load for this module's JS in debug mode. | |
getSkipFunction () | |
Get the skip function. | |
getSource () | |
Get the source of this module. | |
getStyles (ResourceLoaderContext $context) | |
Get all CSS for this module for a given skin. | |
getStyleURLsForDebug (ResourceLoaderContext $context) | |
Get the URL or URLs to load for this module's CSS in debug mode. | |
getTargets () | |
Get target(s) for the module, eg ['desktop'] or ['desktop', 'mobile']. | |
getTemplates () | |
Takes named templates by the module and returns an array mapping. | |
getType () | |
Get the module's load type. | |
getVersionHash (ResourceLoaderContext $context) | |
Get a string identifying the current version of this module in a given context. | |
isKnownEmpty (ResourceLoaderContext $context) | |
Check whether this module is known to be empty. | |
isRaw () | |
Whether this module's JS expects to work without the client-side ResourceLoader module. | |
setConfig (Config $config) | |
setFileDependencies (ResourceLoaderContext $context, $files) | |
Set in-object cache for file dependencies. | |
setLogger (LoggerInterface $logger) | |
setMessageBlob ( $blob, $lang) | |
Set in-object cache for message blobs. | |
setName ( $name) | |
Set this module's name. | |
shouldEmbedModule (ResourceLoaderContext $context) | |
Check whether this module should be embeded rather than linked. | |
supportsURLLoading () | |
Whether this module supports URL loading. | |
Static Public Member Functions | |
static | expandRelativePaths (array $filePaths) |
Expand directories relative to $IP. | |
static | getRelativePaths (array $filePaths) |
Make file paths relative to MediaWiki directory. | |
Public Attributes | |
const | LOAD_GENERAL = 'general' |
const | LOAD_STYLES = 'styles' |
const | ORIGIN_ALL = 10 |
const | ORIGIN_CORE_INDIVIDUAL = 2 |
const | ORIGIN_CORE_SITEWIDE = 1 |
const | ORIGIN_USER_INDIVIDUAL = 4 |
const | ORIGIN_USER_SITEWIDE = 3 |
const | TYPE_COMBINED = 'combined' |
const | TYPE_SCRIPTS = 'scripts' |
const | TYPE_STYLES = 'styles' |
Protected Member Functions | |
buildContent (ResourceLoaderContext $context) | |
Bundle all resources attached to this module into an array. | |
getFileDependencies (ResourceLoaderContext $context) | |
Get the files this module depends on indirectly for a given skin. | |
getLessVars (ResourceLoaderContext $context) | |
Get module-specific LESS variables, if any. | |
getLogger () | |
getMessageBlob (ResourceLoaderContext $context) | |
Get the hash of the message blob. | |
getPreloadLinks (ResourceLoaderContext $context) | |
Get a list of resources that web browsers may preload. | |
saveFileDependencies (ResourceLoaderContext $context, $localFileRefs) | |
Set the files this module depends on indirectly for a given skin. | |
validateScriptFile ( $fileName, $contents) | |
Validate a given script file; if valid returns the original source. | |
Static Protected Member Functions | |
static | javaScriptParser () |
static | safeFileHash ( $filePath) |
Compute a non-cryptographic string hash of a file's contents. | |
static | safeFilemtime ( $filePath) |
Safe version of filemtime(), which doesn't throw a PHP warning if the file doesn't exist. | |
Protected Attributes | |
Config | $config |
$contents = [] | |
array bool | $deprecated = false |
$fileDeps = [] | |
LoggerInterface | $logger |
$msgBlobs = [] | |
$name = null | |
$origin = self::ORIGIN_CORE_SITEWIDE | |
$targets = [ 'desktop' ] | |
$versionHash = [] | |
Static Private Attributes | |
static JSParser | $jsParser |
Lazy-initialized; use self::javaScriptParser() | |
static | $parseCacheVersion = 1 |
Abstraction for ResourceLoader modules, with name registration and maxage functionality.
Definition at line 35 of file ResourceLoaderModule.php.
|
finalprotected |
Bundle all resources attached to this module into an array.
ResourceLoaderContext | $context |
Definition at line 687 of file ResourceLoaderModule.php.
References $blob, $content, $context, ResourceLoader\filter(), getHeaders(), getMessageBlob(), getName(), getScript(), getScriptURLsForDebug(), getStyles(), getStyleURLsForDebug(), and getTemplates().
Referenced by getModuleContent().
ResourceLoaderModule::enableModuleContentVersion | ( | ) |
Whether to generate version hash based on module content.
If a module requires database or file system access to build the module content, consider disabling this in favour of manually tracking relevant aspects in getDefinitionSummary(). See getVersionHash() for how this is used.
Reimplemented in ResourceLoaderSyntaxHighlightVisualEditorModule, ResourceLoaderFileModule, ResourceLoaderJqueryMsgModule, ResourceLoaderLanguageDataModule, ResourceLoaderLanguageNamesModule, ResourceLoaderMediaWikiUtilModule, ResourceLoaderSpecialCharacterDataModule, ResourceLoaderStartUpModule, ResourceLoaderUploadDialogModule, ResourceLoaderUserDefaultsModule, ResourceLoaderUserOptionsModule, ResourceLoaderWikiModule, and ResourceLoaderTestModule.
Definition at line 836 of file ResourceLoaderModule.php.
Referenced by getVersionHash().
|
static |
Expand directories relative to $IP.
array | $filePaths |
Definition at line 533 of file ResourceLoaderModule.php.
References $IP.
Referenced by getFileDependencies(), and ResourceLoader\preloadModuleInfo().
ResourceLoaderModule::getConfig | ( | ) |
Definition at line 184 of file ResourceLoaderModule.php.
References $config.
Referenced by ResourceLoaderStartUpModule\getConfigSettings(), ResourceLoaderWikiModule\getContentObj(), ResourceLoaderSkinModule\getDefinitionSummary(), ResourceLoaderSkinModule\getLogoPreloadlinks(), ResourceLoaderStartUpModule\getModuleRegistrations(), ResourceLoaderSiteModule\getPages(), ResourceLoaderSiteStylesModule\getPages(), ResourceLoaderUserModule\getPages(), ResourceLoaderUserStylesModule\getPages(), ResourceLoaderWikiModule\getPages(), ResourceLoaderJqueryMsgModule\getScript(), ResourceLoaderMediaWikiUtilModule\getScript(), ResourceLoaderStartUpModule\getScript(), ResourceLoaderFileModule\getScriptURLsForDebug(), ResourceLoaderSkinModule\getStyles(), ResourceLoaderWikiModule\getStyles(), ResourceLoaderFileModule\getStyleURLsForDebug(), and validateScriptFile().
ResourceLoaderModule::getDefinitionSummary | ( | ResourceLoaderContext | $context | ) |
Get the definition summary for this module.
This is the method subclasses are recommended to use to track values in their version hash. Call this in getVersionHash() and pass it to e.g. json_encode.
Subclasses must call the parent getDefinitionSummary() and build on that. It is recommended that each subclass appends its own new array. This prevents clashes or accidental overwrites of existing keys and gives each subclass its own scope for simple array keys.
Return an array containing values from all significant properties of this module's definition.
Be careful not to normalise too much. Especially preserve the order of things that carry significance in getScript and getStyles (T39812).
Avoid including things that are insiginificant (e.g. order of message keys is insignificant and should be sorted to avoid unnecessary cache invalidation).
This data structure must exclusively contain arrays and scalars as values (avoid object instances) to allow simple serialisation using json_encode.
If modules have a hash or timestamp from another source, that may be incuded as-is.
A number of utility methods are available to help you gather data. These are not called by default and must be included by the subclass' getDefinitionSummary().
ResourceLoaderContext | $context |
Reimplemented in CiteDataModule, ResourceLoaderFileModule, ResourceLoaderImageModule, ResourceLoaderSkinModule, and ResourceLoaderWikiModule.
Definition at line 883 of file ResourceLoaderModule.php.
Referenced by getVersionHash().
ResourceLoaderModule::getDependencies | ( | ResourceLoaderContext | $context = null | ) |
Get a list of modules this module depends on.
Dependency information is taken into account when loading a module on the client side.
Note: It is expected that $context will be made non-optional in the near future.
ResourceLoaderContext | null | $context |
Reimplemented in CiteDataModule, GadgetResourceLoaderModule, ResourceLoaderFileModule, ResourceLoaderForeignApiModule, ResourceLoaderLanguageNamesModule, ResourceLoaderSiteModule, ResourceLoaderSpecialCharacterDataModule, ResourceLoaderUserOptionsModule, and ResourceLoaderTestModule.
Definition at line 352 of file ResourceLoaderModule.php.
Referenced by ResourceLoaderWikiModule\isKnownEmpty().
ResourceLoaderModule::getDeprecationInformation | ( | ) |
Get JS representing deprecation information for the current module if available.
Definition at line 141 of file ResourceLoaderModule.php.
References $deprecated, and getName().
Referenced by ResourceLoaderFileModule\getScript().
|
protected |
Get the files this module depends on indirectly for a given skin.
These are only image files referenced by the module's stylesheet.
ResourceLoaderContext | $context |
Definition at line 402 of file ResourceLoaderModule.php.
References $context, $dbr, array(), DB_REPLICA, expandRelativePaths(), getName(), and wfGetDB().
Referenced by ResourceLoaderFileModule\getFileHashes(), and saveFileDependencies().
ResourceLoaderModule::getFlip | ( | $context | ) |
ResourceLoaderContext | $context |
Reimplemented in ResourceLoaderFileModule.
Definition at line 131 of file ResourceLoaderModule.php.
References $context.
Referenced by ResourceLoaderWikiModule\getStyles().
ResourceLoaderModule::getGroup | ( | ) |
Get the group this module is in.
Reimplemented in GadgetResourceLoaderModule, ResourceLoaderFileModule, ResourceLoaderSiteStylesModule, ResourceLoaderStartUpModule, ResourceLoaderUserModule, ResourceLoaderUserOptionsModule, ResourceLoaderUserStylesModule, ResourceLoaderUserTokensModule, ResourceLoaderWikiModule, and ResourceLoaderTestModule.
Definition at line 314 of file ResourceLoaderModule.php.
Referenced by shouldEmbedModule().
|
final |
Get headers to send as part of a module web response.
It is not supported to send headers through this method that are required to be unique or otherwise sent once in an HTTP response because clients may make batch requests for multiple modules (as is the default behaviour for ResourceLoader clients).
For exclusive or aggregated headers, see ResourceLoader::sendResponseHeaders().
ResourceLoaderContext | $context |
Definition at line 591 of file ResourceLoaderModule.php.
References $attribs, $link, and getPreloadLinks().
Referenced by buildContent().
|
protected |
Get module-specific LESS variables, if any.
ResourceLoaderContext | $context |
Reimplemented in ResourceLoaderLessVarFileModule, Vector\ResourceLoaderLessModule, and ResourceLoaderFileTestModule.
Definition at line 659 of file ResourceLoaderModule.php.
Referenced by ResourceLoaderFileModule\compileLessFile(), and ResourceLoaderFileModule\getDefinitionSummary().
|
protected |
Definition at line 214 of file ResourceLoaderModule.php.
References $logger.
Referenced by ResourceLoaderWikiModule\getContentObj(), and getMessageBlob().
|
protected |
Get the hash of the message blob.
ResourceLoaderContext | $context |
Reimplemented in ResourceLoaderLessVarFileModule.
Definition at line 547 of file ResourceLoaderModule.php.
References $context, $lang, ResourceLoaderContext\getLanguage(), getLogger(), getMessages(), and getName().
Referenced by buildContent(), and ResourceLoaderFileModule\getDefinitionSummary().
ResourceLoaderModule::getMessages | ( | ) |
Get the messages needed for this module.
To get a JSON blob with messages, use MessageBlobStore::get()
Reimplemented in GadgetResourceLoaderModule, ResourceLoaderFileModule, ResourceLoaderLessVarFileModule, ResourceLoaderSpecialCharacterDataModule, and ResourceLoaderTestModule.
Definition at line 304 of file ResourceLoaderModule.php.
Referenced by MessageBlobStore\generateMessageBlob(), getMessageBlob(), and MessageBlobStore\makeCacheKey().
ResourceLoaderModule::getModuleContent | ( | ResourceLoaderContext | $context | ) |
Get an array of this module's resources.
Ready for serving to the web.
ResourceLoaderContext | $context |
Definition at line 670 of file ResourceLoaderModule.php.
References $context, buildContent(), and contents.
Referenced by getVersionHash().
ResourceLoaderModule::getName | ( | ) |
Get this module's name.
This is set when the module is registered with ResourceLoader::register()
Definition at line 102 of file ResourceLoaderModule.php.
References $name.
Referenced by buildContent(), MessageBlobStore\generateMessageBlob(), MessageBlobStore\getBlob(), getDeprecationInformation(), getFileDependencies(), ResourceLoaderImageModule\getImages(), getMessageBlob(), getScriptURLsForDebug(), getStyleURLsForDebug(), MessageBlobStore\makeCacheKey(), and saveFileDependencies().
ResourceLoaderModule::getOrigin | ( | ) |
Get this module's origin.
This is set when the module is registered with ResourceLoader::register()
Definition at line 123 of file ResourceLoaderModule.php.
References $origin.
Referenced by OutputPage\filterModules().
|
protected |
Get a list of resources that web browsers may preload.
Behaviour of rel=preload link is specified at https://www.w3.org/TR/preload/.
Use case for ResourceLoader originally part of T164299.
ResourceLoaderContext | $context |
Reimplemented in ResourceLoaderSkinModule.
Definition at line 648 of file ResourceLoaderModule.php.
Referenced by getHeaders().
|
static |
Make file paths relative to MediaWiki directory.
This is used to make file paths safe for storing in a database without the paths becoming stale or incorrect when MediaWiki is moved or upgraded (T111481).
array | $filePaths |
Definition at line 519 of file ResourceLoaderModule.php.
References $IP.
Referenced by saveFileDependencies().
ResourceLoaderModule::getScript | ( | ResourceLoaderContext | $context | ) |
Get all JS for this module for a given language and skin.
Includes all relevant JS except loader scripts.
ResourceLoaderContext | $context |
Reimplemented in CiteDataModule, ResourceLoaderSyntaxHighlightVisualEditorModule, ResourceLoaderFileModule, ResourceLoaderJqueryMsgModule, ResourceLoaderLanguageDataModule, ResourceLoaderLanguageNamesModule, ResourceLoaderMediaWikiUtilModule, ResourceLoaderSpecialCharacterDataModule, ResourceLoaderStartUpModule, ResourceLoaderUploadDialogModule, ResourceLoaderUserDefaultsModule, ResourceLoaderUserOptionsModule, ResourceLoaderUserTokensModule, ResourceLoaderWikiModule, and ResourceLoaderTestModule.
Definition at line 165 of file ResourceLoaderModule.php.
Referenced by buildContent().
ResourceLoaderModule::getScriptURLsForDebug | ( | ResourceLoaderContext | $context | ) |
Get the URL or URLs to load for this module's JS in debug mode.
The default behavior is to return a load.php?only=scripts URL for the module, but file-based modules will want to override this to load the files directly.
This function is called only when 1) we're in debug mode, 2) there is no only= parameter and 3) supportsURLLoading() returns true. #2 is important to prevent an infinite loop, therefore this function MUST return either an only= URL or a non-load.php URL.
ResourceLoaderContext | $context |
Reimplemented in ResourceLoaderSyntaxHighlightVisualEditorModule, ResourceLoaderFileModule, and ResourceLoaderJqueryMsgModule.
Definition at line 235 of file ResourceLoaderModule.php.
References $context, $resourceLoader, getName(), and getSource().
Referenced by buildContent(), ResourceLoaderSyntaxHighlightVisualEditorModule\getScriptURLsForDebug(), and ResourceLoaderJqueryMsgModule\getScriptURLsForDebug().
ResourceLoaderModule::getSkipFunction | ( | ) |
Get the skip function.
Modules that provide fallback functionality can provide a "skip function". This function, if provided, will be passed along to the module registry on the client. When this module is loaded (either directly or as a dependency of another module), then this function is executed first. If the function returns true, the module will instantly be considered "ready" without requesting the associated module resources.
The value returned here must be valid javascript for execution in a private function. It must not contain the "function () {" and "}" wrapper though.
Reimplemented in ResourceLoaderFileModule, and ResourceLoaderTestModule.
Definition at line 390 of file ResourceLoaderModule.php.
ResourceLoaderModule::getSource | ( | ) |
Get the source of this module.
Should only be overridden for foreign modules.
Reimplemented in ResourceLoaderTestModule.
Definition at line 324 of file ResourceLoaderModule.php.
Referenced by getScriptURLsForDebug(), ResourceLoaderImageModule\getStyles(), getStyleURLsForDebug(), and ResourceLoaderWikiModule\shouldEmbedModule().
ResourceLoaderModule::getStyles | ( | ResourceLoaderContext | $context | ) |
Get all CSS for this module for a given skin.
ResourceLoaderContext | $context |
Reimplemented in ResourceLoaderFileModule, ResourceLoaderImageModule, ResourceLoaderSkinModule, ResourceLoaderWikiModule, and ResourceLoaderTestModule.
Definition at line 268 of file ResourceLoaderModule.php.
Referenced by buildContent().
ResourceLoaderModule::getStyleURLsForDebug | ( | ResourceLoaderContext | $context | ) |
Get the URL or URLs to load for this module's CSS in debug mode.
The default behavior is to return a load.php?only=styles URL for the module, but file-based modules will want to override this to load the files directly. See also getScriptURLsForDebug()
ResourceLoaderContext | $context |
Reimplemented in ResourceLoaderFileModule.
Definition at line 282 of file ResourceLoaderModule.php.
References $context, $resourceLoader, getName(), and getSource().
Referenced by buildContent().
ResourceLoaderModule::getTargets | ( | ) |
Get target(s) for the module, eg ['desktop'] or ['desktop', 'mobile'].
Reimplemented in GadgetResourceLoaderModule, and ResourceLoaderFileModule.
Definition at line 362 of file ResourceLoaderModule.php.
References $targets.
ResourceLoaderModule::getTemplates | ( | ) |
Takes named templates by the module and returns an array mapping.
Reimplemented in ResourceLoaderFileModule.
Definition at line 175 of file ResourceLoaderModule.php.
Referenced by buildContent().
ResourceLoaderModule::getType | ( | ) |
Get the module's load type.
Reimplemented in GadgetResourceLoaderModule, ResourceLoaderFileModule, ResourceLoaderImageModule, ResourceLoaderSiteStylesModule, ResourceLoaderUserStylesModule, ResourceLoaderWikiModule, and ResourceLoaderTestModule.
Definition at line 372 of file ResourceLoaderModule.php.
References LOAD_GENERAL.
ResourceLoaderModule::getVersionHash | ( | ResourceLoaderContext | $context | ) |
Get a string identifying the current version of this module in a given context.
Whenever anything happens that changes the module's response (e.g. scripts, styles, and messages) this value must change. This value is used to store module responses in cache. (Both client-side and server-side.)
It is not recommended to override this directly. Use getDefinitionSummary() instead. If overridden, one must call the parent getVersionHash(), append data and re-hash.
This method should be quick because it is frequently run by ResourceLoaderStartUpModule to propagate changes to the client and effectively invalidate cache.
ResourceLoaderContext | $context |
Definition at line 805 of file ResourceLoaderModule.php.
References $context, enableModuleContentVersion(), getDefinitionSummary(), getModuleContent(), and ResourceLoader\makeHash().
ResourceLoaderModule::isKnownEmpty | ( | ResourceLoaderContext | $context | ) |
Check whether this module is known to be empty.
If a child class has an easy and cheap way to determine that this module is definitely going to be empty, it should override this method to return true in that case. Callers may optimize the request for this module away if this function returns true.
ResourceLoaderContext | $context |
Reimplemented in ResourceLoaderSkinModule, ResourceLoaderUserOptionsModule, ResourceLoaderWikiModule, and ResourceLoaderTestModule.
Definition at line 901 of file ResourceLoaderModule.php.
ResourceLoaderModule::isRaw | ( | ) |
Whether this module's JS expects to work without the client-side ResourceLoader module.
Returning true from this function will prevent mw.loader.state() call from being appended to the bottom of the script.
Reimplemented in ResourceLoaderFileModule, ResourceLoaderStartUpModule, and ResourceLoaderTestModule.
Definition at line 336 of file ResourceLoaderModule.php.
|
staticprotected |
Definition at line 964 of file ResourceLoaderModule.php.
References $jsParser.
Referenced by validateScriptFile().
|
staticprotected |
Compute a non-cryptographic string hash of a file's contents.
If the file does not exist or cannot be read, returns an empty string.
string | $filePath | File path |
Definition at line 993 of file ResourceLoaderModule.php.
References FileContentsHasher\getFileContentsHash().
|
staticprotected |
Safe version of filemtime(), which doesn't throw a PHP warning if the file doesn't exist.
Defaults to 1.
string | $filePath | File path |
Definition at line 978 of file ResourceLoaderModule.php.
|
protected |
Set the files this module depends on indirectly for a given skin.
ResourceLoaderContext | $context | |
array | $localFileRefs | List of files |
Definition at line 449 of file ResourceLoaderModule.php.
References $cache, $context, $e, DB_MASTER, getFileDependencies(), getName(), getRelativePaths(), wfDebugLog(), and wfGetDB().
Referenced by ResourceLoaderFileModule\getStyles().
ResourceLoaderModule::setConfig | ( | Config | $config | ) |
Config | $config |
Definition at line 197 of file ResourceLoaderModule.php.
References $config.
ResourceLoaderModule::setFileDependencies | ( | ResourceLoaderContext | $context, |
$files ) |
Set in-object cache for file dependencies.
This is used to retrieve data in batches. See ResourceLoader::preloadModuleInfo(). To save the data, use saveFileDependencies().
ResourceLoaderContext | $context | |
string[] | $files | Array of file names |
Definition at line 437 of file ResourceLoaderModule.php.
References $context.
ResourceLoaderModule::setLogger | ( | LoggerInterface | $logger | ) |
LoggerInterface | $logger |
Definition at line 206 of file ResourceLoaderModule.php.
References $logger.
ResourceLoaderModule::setMessageBlob | ( | $blob, | |
$lang ) |
Set in-object cache for message blobs.
Used to allow fetching of message blobs in batches. See ResourceLoader::preloadModuleInfo().
string | null | $blob | JSON blob or null |
string | $lang | Language code |
Definition at line 573 of file ResourceLoaderModule.php.
ResourceLoaderModule::setName | ( | $name | ) |
Set this module's name.
This is called by ResourceLoader::register() when registering the module. Other code should not call this.
string | $name |
Definition at line 112 of file ResourceLoaderModule.php.
References $name.
ResourceLoaderModule::shouldEmbedModule | ( | ResourceLoaderContext | $context | ) |
Check whether this module should be embeded rather than linked.
Modules returning true here will be embedded rather than loaded by ResourceLoaderClientHtml.
ResourceLoaderContext | $context |
Reimplemented in ResourceLoaderWikiModule, and ResourceLoaderTestModule.
Definition at line 915 of file ResourceLoaderModule.php.
References getGroup().
ResourceLoaderModule::supportsURLLoading | ( | ) |
Whether this module supports URL loading.
If this function returns false, getScript() will be used even in cases (debug mode, no only param) where getScriptURLsForDebug() would normally be used instead.
Reimplemented in ResourceLoaderFileModule, ResourceLoaderImageModule, ResourceLoaderLanguageDataModule, ResourceLoaderMediaWikiUtilModule, ResourceLoaderStartUpModule, ResourceLoaderUserOptionsModule, and ResourceLoaderUserTokensModule.
Definition at line 256 of file ResourceLoaderModule.php.
|
protected |
Validate a given script file; if valid returns the original source.
If invalid, returns replacement JS source that throws an exception.
string | $fileName | |
string | $contents |
Definition at line 931 of file ResourceLoaderModule.php.
References $cache, $contents, $e, $parser, $result, getConfig(), and javaScriptParser().
Referenced by ResourceLoaderWikiModule\getScript(), and ResourceLoaderTestModule\getScript().
|
protected |
Definition at line 84 of file ResourceLoaderModule.php.
Referenced by getConfig(), ResourceLoaderImageModule\getGlobalVariants(), ResourceLoaderUserModule\getPages(), ResourceLoaderUserStylesModule\getPages(), ResourceLoaderWikiModule\getPages(), ResourceLoaderUploadDialogModule\getScript(), and setConfig().
|
protected |
Definition at line 79 of file ResourceLoaderModule.php.
Referenced by ResourceLoaderFileModule\getSkipFunction(), ResourceLoaderFileModule\readScriptFiles(), and validateScriptFile().
|
protected |
Definition at line 89 of file ResourceLoaderModule.php.
Referenced by getDeprecationInformation().
|
protected |
Definition at line 73 of file ResourceLoaderModule.php.
|
staticprivate |
Lazy-initialized; use self::javaScriptParser()
Definition at line 920 of file ResourceLoaderModule.php.
Referenced by javaScriptParser().
|
protected |
Definition at line 94 of file ResourceLoaderModule.php.
Referenced by getLogger(), and setLogger().
|
protected |
Definition at line 75 of file ResourceLoaderModule.php.
|
protected |
Definition at line 69 of file ResourceLoaderModule.php.
Referenced by ResourceLoaderImageModule\getGlobalVariants(), ResourceLoaderImageModule\getImage(), ResourceLoaderStartUpModule\getModuleRegistrations(), getName(), and setName().
|
protected |
Definition at line 67 of file ResourceLoaderModule.php.
Referenced by getOrigin().
|
staticprivate |
Definition at line 921 of file ResourceLoaderModule.php.
|
protected |
Definition at line 70 of file ResourceLoaderModule.php.
Referenced by getTargets().
|
protected |
Definition at line 77 of file ResourceLoaderModule.php.
Referenced by ResourceLoaderStartUpModule\getModuleRegistrations().
const ResourceLoaderModule::LOAD_GENERAL = 'general' |
Definition at line 45 of file ResourceLoaderModule.php.
Referenced by GadgetResourceLoaderModule\getType(), getType(), and GadgetTest\provideGetType().
const ResourceLoaderModule::LOAD_STYLES = 'styles' |
Definition at line 43 of file ResourceLoaderModule.php.
Referenced by ResourceLoaderClientHtml\getData(), GadgetResourceLoaderModule\getType(), ResourceLoaderImageModule\getType(), ResourceLoaderSiteStylesModule\getType(), ResourceLoaderUserStylesModule\getType(), ResourceLoaderClientHtmlTest\makeSampleModules(), and GadgetTest\provideGetType().
const ResourceLoaderModule::ORIGIN_ALL = 10 |
Definition at line 61 of file ResourceLoaderModule.php.
Referenced by OutputPage\getAllowedModules().
const ResourceLoaderModule::ORIGIN_CORE_INDIVIDUAL = 2 |
Definition at line 51 of file ResourceLoaderModule.php.
Referenced by OutputPage\disallowUserJs(), ResourceLoaderStartUpModule\getModuleRegistrations(), OutputPage\getRlClient(), and ResourceLoaderStartUpModuleTest\provideGetModuleRegistrations().
const ResourceLoaderModule::ORIGIN_CORE_SITEWIDE = 1 |
Definition at line 48 of file ResourceLoaderModule.php.
const ResourceLoaderModule::ORIGIN_USER_INDIVIDUAL = 4 |
Definition at line 58 of file ResourceLoaderModule.php.
Referenced by ResourceLoaderStartUpModuleTest\provideGetModuleRegistrations().
const ResourceLoaderModule::ORIGIN_USER_SITEWIDE = 3 |
Definition at line 55 of file ResourceLoaderModule.php.
Referenced by OutputPage\disallowUserJs(), and ResourceLoaderStartUpModuleTest\provideGetModuleRegistrations().
const ResourceLoaderModule::TYPE_COMBINED = 'combined' |
Definition at line 39 of file ResourceLoaderModule.php.
Referenced by OutputPage\getAllowedModules(), ResourceLoaderClientHtml\getData(), ResourceLoaderClientHtml\getHeadHtml(), OutputPage\getRlClient(), ResourceLoaderClientHtml\makeContext(), ResourceLoaderClientHtmlTest\provideMakeLoad(), and OutputPageTest\provideMakeResourceLoaderLink().
const ResourceLoaderModule::TYPE_SCRIPTS = 'scripts' |
Definition at line 37 of file ResourceLoaderModule.php.
Referenced by OutputPage\disallowUserJs(), ResourceLoaderClientHtml\getData(), ResourceLoaderClientHtml\getHeadHtml(), OutputPage\getModuleScripts(), OutputPage\headElement(), SpecialJavaScriptTest\plainQUnit(), ResourceLoaderClientHtmlTest\provideMakeLoad(), and OutputPageTest\provideMakeResourceLoaderLink().
const ResourceLoaderModule::TYPE_STYLES = 'styles' |
Definition at line 38 of file ResourceLoaderModule.php.
Referenced by OutputPage\buildExemptModules(), OutputPage\disallowUserJs(), ResourceLoaderClientHtml\getData(), ResourceLoaderClientHtml\getHeadHtml(), OutputPage\getModuleStyles(), ResourceLoaderClientHtml\makeLoad(), SpecialJavaScriptTest\plainQUnit(), ResourceLoaderClientHtmlTest\provideMakeLoad(), and OutputPageTest\provideMakeResourceLoaderLink().