MediaWiki
master
|
Module for ResourceLoader initialization. More...
Public Member Functions | |
enableModuleContentVersion () | |
getModuleRegistrations (Context $context) | |
Get registration code for all modules. More... | |
getScript (Context $context) | |
supportsURLLoading () | |
![]() | |
getConfig () | |
getDefinitionSummary (Context $context) | |
Get the definition summary for this module. More... | |
getDependencies (Context $context=null) | |
Get a list of modules this module depends on. More... | |
getDeprecationInformation (Context $context) | |
Get JS representing deprecation information for the current module if available. More... | |
getFlip (Context $context) | |
getGroup () | |
Get the group this module is in. More... | |
getHeaders (Context $context) | |
Get headers to send as part of a module web response. More... | |
getMessages () | |
Get the messages needed for this module. More... | |
getModuleContent (Context $context) | |
Get an array of this module's resources. More... | |
getName () | |
Get this module's name. More... | |
getOrigin () | |
Get this module's origin. More... | |
getScriptURLsForDebug (Context $context) | |
Get alternative script URLs for legacy debug mode. More... | |
getSkins () | |
Get list of skins for which this module must be available to load. More... | |
getSkipFunction () | |
Get the skip function. More... | |
getSource () | |
Get the source of this module. More... | |
getStyles (Context $context) | |
Get all CSS for this module for a given skin. More... | |
getStyleURLsForDebug (Context $context) | |
Get the URL or URLs to load for this module's CSS in debug mode. More... | |
getTargets () | |
Get target(s) for the module, eg ['desktop'] or ['desktop', 'mobile']. More... | |
getTemplates () | |
Takes named templates by the module and returns an array mapping. More... | |
getType () | |
Get the module's load type. More... | |
getVersionHash (Context $context) | |
Get a string identifying the current version of this module in a given context. More... | |
isKnownEmpty (Context $context) | |
Check whether this module is known to be empty. More... | |
requiresES6 () | |
Whether the module requires ES6 support in the client. More... | |
setConfig (Config $config) | |
setDependencyAccessCallbacks (callable $loadCallback, callable $saveCallback) | |
Inject the functions that load/save the indirect file path dependency list from storage. More... | |
setFileDependencies (Context $context, array $paths) | |
Set the indirect dependencies for this module pursuant to the skin/language context. More... | |
setHookContainer (HookContainer $hookContainer) | |
setLogger (LoggerInterface $logger) | |
setMessageBlob ( $blob, $lang) | |
Set in-object cache for message blobs. More... | |
setName ( $name) | |
Set this module's name. More... | |
setSkinStylesOverride (array $moduleSkinStyles) | |
Provide overrides for skinStyles to modules that support that. More... | |
shouldEmbedModule (Context $context) | |
Check whether this module should be embedded rather than linked. More... | |
Static Public Member Functions | |
static | compileUnresolvedDependencies (array &$registryData) |
Optimize the dependency tree in $this->modules. More... | |
![]() | |
static | expandRelativePaths (array $filePaths) |
Expand directories relative to $IP. More... | |
static | getRelativePaths (array $filePaths) |
Make file paths relative to MediaWiki directory. More... | |
static | getVary (Context $context) |
Get vary string. More... | |
Static Protected Member Functions | |
static | getImplicitDependencies (array $registryData, string $moduleName, array $handled=[]) |
Recursively get all explicit and implicit dependencies for to the given module. More... | |
![]() | |
static | safeFileHash ( $filePath) |
Compute a non-cryptographic string hash of a file's contents. More... | |
Additional Inherited Members | |
![]() | |
buildContent (Context $context) | |
Bundle all resources attached to this module into an array. More... | |
getFileDependencies (Context $context) | |
Get the indirect dependencies for this module pursuant to the skin/language context. More... | |
getHookRunner () | |
Get a HookRunner for running core hooks. More... | |
getLessVars (Context $context) | |
Get module-specific LESS variables, if any. More... | |
getLogger () | |
getMessageBlob (Context $context) | |
Get the hash of the message blob. More... | |
getPreloadLinks (Context $context) | |
Get a list of resources that web browsers may preload. More... | |
saveFileDependencies (Context $context, array $curFileRefs) | |
Save the indirect dependencies for this module pursuant to the skin/language context. More... | |
validateScriptFile ( $fileName, $contents) | |
Validate a user-provided JavaScript blob. More... | |
![]() | |
Config | $config |
array | $contents = [] |
Map of (context hash => cached module content) More... | |
string bool | $deprecated = false |
Deprecation string or true if deprecated; false otherwise. More... | |
array | $fileDeps = [] |
Map of (variant => indirect file dependencies) More... | |
LoggerInterface | $logger |
array | $msgBlobs = [] |
Map of (language => in-object cache for message blob) More... | |
string null | $name = null |
Module name. More... | |
int | $origin = self::ORIGIN_CORE_SITEWIDE |
Script and style modules form a hierarchy of trustworthiness, with core modules like skins and jQuery as most trustworthy, and user scripts as least trustworthy. More... | |
string[] null | $skins = null |
Skin names. More... | |
string[] | $targets = [ 'desktop', 'mobile' ] |
What client platforms the module targets (e.g. More... | |
array | $versionHash = [] |
Map of (context hash => cached module version hash) More... | |
Module for ResourceLoader initialization.
See also https://www.mediawiki.org/wiki/ResourceLoader/Features#Startup_Module
The startup module, as being called only from ClientHtml, has the ability to vary based extra query parameters, in addition to those from Context:
Definition at line 48 of file StartUpModule.php.
|
static |
Optimize the dependency tree in $this->modules.
The optimization basically works like this: Given we have module A with the dependencies B and C and module B with the dependency C. Now we don't have to tell the client to explicitly fetch module C as that's already included in module B.
This way we can reasonably reduce the amount of module registration data send to the client.
array[] | &$registryData | Modules keyed by name with properties:
|
Definition at line 132 of file StartUpModule.php.
MediaWiki\ResourceLoader\StartUpModule::enableModuleContentVersion | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Module.
Definition at line 430 of file StartUpModule.php.
|
staticprotected |
Recursively get all explicit and implicit dependencies for to the given module.
array | $registryData | |
string | $moduleName | |
string[] | $handled | Internal parameter for recursion. (Optional) |
CircularDependencyError |
Definition at line 68 of file StartUpModule.php.
MediaWiki\ResourceLoader\StartUpModule::getModuleRegistrations | ( | Context | $context | ) |
Get registration code for all modules.
Context | $context |
Definition at line 156 of file StartUpModule.php.
MediaWiki\ResourceLoader\StartUpModule::getScript | ( | Context | $context | ) |
Context | $context |
Reimplemented from MediaWiki\ResourceLoader\Module.
Definition at line 348 of file StartUpModule.php.
MediaWiki\ResourceLoader\StartUpModule::supportsURLLoading | ( | ) |
Reimplemented from MediaWiki\ResourceLoader\Module.
Definition at line 423 of file StartUpModule.php.