Go to the documentation of this file.
4 use Psr\Log\LoggerInterface;
5 use Psr\Log\NullLogger;
33 'modules' =>
'startup',
45 'target' =>
'phpunit',
49 ->setMethods( [
'getDirection' ] )
51 $ctx->method(
'getDirection' )->willReturn(
$options[
'dir'] );
58 'ResourceLoaderDebug' =>
true,
61 'CacheEpoch' =>
'20140101000000',
65 'Script' =>
'/w/index.php',
66 'LoadScript' =>
'/w/load.php',
73 ResourceLoader::clearCache();
76 foreach ( self::getSettings()
as $key =>
$value ) {
77 $globals[
'wg' . $key] =
$value;
145 return $this->shouldEmbed ?? parent::shouldEmbedModule(
$context );
159 foreach ( $test
as $key =>
$value ) {
176 $this->setLogger( $logger ?:
new NullLogger() );
177 $this->config = $config ?: MediaWikiServices::getInstance()->getMainConfig();
179 $this->addSource(
'local', $this->config->get(
'LoadScript' ) );
180 $this->setMessageBlobStore(
new MessageBlobStore( $this, $this->getLogger() ) );
184 return $this->errors;
enableModuleContentVersion()
Whether to generate version hash based on module content.
Object passed around to modules which contains information about the state of a specific loader reque...
WebRequest clone which takes values from a provided array.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
getLessVars(ResourceLoaderContext $context)
Get module-specific LESS variables, if any.
getStyles(ResourceLoaderContext $context)
Get all CSS for this module for a given skin.
getGroup()
Get the group this module is in.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext such as when responding to a resource loader request or generating HTML output & $resourceLoader
getMessages()
Get the messages needed for this module.
isRaw()
Whether this module's JS expects to work without the client-side ResourceLoader module.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
script(document.cookie)%253c/script%253e</pre ></div > !! end !! test XSS is escaped(inline) !!input< source lang
ResourceLoader module based on local JavaScript/CSS files.
Interface for configuration instances.
shouldEmbedModule(ResourceLoaderContext $context)
Check whether this module should be embeded rather than linked.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
isKnownEmpty(ResourceLoaderContext $context)
Check whether this module is known to be empty.
__construct(Config $config=null, LoggerInterface $logger=null)
__construct( $options=[])
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
getSource()
Get the source of this module.
validateScriptFile( $fileName, $contents)
Validate a given script file; if valid returns the original source.
getScript(ResourceLoaderContext $context)
Get all JS for this module for a given language and skin.
Abstraction for ResourceLoader modules, with name registration and maxage functionality.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
getSkipFunction()
Get the skip function.
getResourceLoaderContext( $options=[], ResourceLoader $rl=null)
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
This class generates message blobs for use by ResourceLoader modules.
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
getDependencies(ResourceLoaderContext $context=null)
Get a list of modules this module depends on.
getType()
Get the module's load type.
__construct( $options=[], $test=[])