MediaWiki  1.23.2
ResourceLoaderModule.php
Go to the documentation of this file.
1 <?php
28 abstract class ResourceLoaderModule {
29 
30  # Type of resource
31  const TYPE_SCRIPTS = 'scripts';
32  const TYPE_STYLES = 'styles';
33  const TYPE_MESSAGES = 'messages';
34  const TYPE_COMBINED = 'combined';
35 
36  # sitewide core module like a skin file or jQuery component
38 
39  # per-user module generated by the software
41 
42  # sitewide module generated from user-editable files, like MediaWiki:Common.js, or
43  # modules accessible to multiple users, such as those generated by the Gadgets extension.
45 
46  # per-user module generated from user-editable files, like User:Me/vector.js
48 
49  # an access constant; make sure this is kept as the largest number in this group
50  const ORIGIN_ALL = 10;
51 
52  # script and style modules form a hierarchy of trustworthiness, with core modules like
53  # skins and jQuery as most trustworthy, and user scripts as least trustworthy. We can
54  # limit the types of scripts and styles we allow to load on, say, sensitive special
55  # pages like Special:UserLogin and Special:Preferences
57 
58  /* Protected Members */
59 
60  protected $name = null;
61  protected $targets = array( 'desktop' );
62 
63  // In-object cache for file dependencies
64  protected $fileDeps = array();
65  // In-object cache for message blob mtime
66  protected $msgBlobMtime = array();
67 
68  /* Methods */
69 
76  public function getName() {
77  return $this->name;
78  }
79 
86  public function setName( $name ) {
87  $this->name = $name;
88  }
89 
97  public function getOrigin() {
98  return $this->origin;
99  }
100 
107  public function setOrigin( $origin ) {
108  $this->origin = $origin;
109  }
110 
115  public function getFlip( $context ) {
117 
118  return $wgContLang->getDir() !== $context->getDirection();
119  }
120 
128  public function getScript( ResourceLoaderContext $context ) {
129  // Stub, override expected
130  return '';
131  }
132 
147  public function getScriptURLsForDebug( ResourceLoaderContext $context ) {
149  array( $this->getName() ),
150  $context->getLanguage(),
151  $context->getSkin(),
152  $context->getUser(),
153  $context->getVersion(),
154  true, // debug
155  'scripts', // only
156  $context->getRequest()->getBool( 'printable' ),
157  $context->getRequest()->getBool( 'handheld' )
158  );
159  return array( $url );
160  }
161 
168  public function supportsURLLoading() {
169  return true;
170  }
171 
180  public function getStyles( ResourceLoaderContext $context ) {
181  // Stub, override expected
182  return array();
183  }
184 
194  public function getStyleURLsForDebug( ResourceLoaderContext $context ) {
196  array( $this->getName() ),
197  $context->getLanguage(),
198  $context->getSkin(),
199  $context->getUser(),
200  $context->getVersion(),
201  true, // debug
202  'styles', // only
203  $context->getRequest()->getBool( 'printable' ),
204  $context->getRequest()->getBool( 'handheld' )
205  );
206  return array( 'all' => array( $url ) );
207  }
208 
216  public function getMessages() {
217  // Stub, override expected
218  return array();
219  }
220 
226  public function getGroup() {
227  // Stub, override expected
228  return null;
229  }
230 
236  public function getSource() {
237  // Stub, override expected
238  return 'local';
239  }
240 
248  public function getPosition() {
249  return 'bottom';
250  }
251 
259  public function isRaw() {
260  return false;
261  }
262 
268  public function getLoaderScript() {
269  // Stub, override expected
270  return false;
271  }
272 
283  public function getDependencies() {
284  // Stub, override expected
285  return array();
286  }
287 
293  public function getTargets() {
294  return $this->targets;
295  }
296 
304  public function getFileDependencies( $skin ) {
305  // Try in-object cache first
306  if ( isset( $this->fileDeps[$skin] ) ) {
307  return $this->fileDeps[$skin];
308  }
309 
310  $dbr = wfGetDB( DB_SLAVE );
311  $deps = $dbr->selectField( 'module_deps', 'md_deps', array(
312  'md_module' => $this->getName(),
313  'md_skin' => $skin,
314  ), __METHOD__
315  );
316  if ( !is_null( $deps ) ) {
317  $this->fileDeps[$skin] = (array)FormatJson::decode( $deps, true );
318  } else {
319  $this->fileDeps[$skin] = array();
320  }
321  return $this->fileDeps[$skin];
322  }
323 
330  public function setFileDependencies( $skin, $deps ) {
331  $this->fileDeps[$skin] = $deps;
332  }
333 
340  public function getMsgBlobMtime( $lang ) {
341  if ( !isset( $this->msgBlobMtime[$lang] ) ) {
342  if ( !count( $this->getMessages() ) ) {
343  return 0;
344  }
345 
346  $dbr = wfGetDB( DB_SLAVE );
347  $msgBlobMtime = $dbr->selectField( 'msg_resource', 'mr_timestamp', array(
348  'mr_resource' => $this->getName(),
349  'mr_lang' => $lang
350  ), __METHOD__
351  );
352  // If no blob was found, but the module does have messages, that means we need
353  // to regenerate it. Return NOW
354  if ( $msgBlobMtime === false ) {
356  }
357  $this->msgBlobMtime[$lang] = wfTimestamp( TS_UNIX, $msgBlobMtime );
358  }
359  return $this->msgBlobMtime[$lang];
360  }
361 
368  public function setMsgBlobMtime( $lang, $mtime ) {
369  $this->msgBlobMtime[$lang] = $mtime;
370  }
371 
372  /* Abstract Methods */
373 
392  public function getModifiedTime( ResourceLoaderContext $context ) {
393  // 0 would mean now
394  return 1;
395  }
396 
404  public function getHashMtime( ResourceLoaderContext $context ) {
405  $hash = $this->getModifiedHash( $context );
406  if ( !is_string( $hash ) ) {
407  return 0;
408  }
409 
411  $key = wfMemcKey( 'resourceloader', 'modulemodifiedhash', $this->getName(), $hash );
412 
413  $data = $cache->get( $key );
414  if ( is_array( $data ) && $data['hash'] === $hash ) {
415  // Hash is still the same, re-use the timestamp of when we first saw this hash.
416  return $data['timestamp'];
417  }
418 
420  $cache->set( $key, array(
421  'hash' => $hash,
422  'timestamp' => $timestamp,
423  ) );
424 
425  return $timestamp;
426  }
427 
437  public function getModifiedHash( ResourceLoaderContext $context ) {
438  return null;
439  }
440 
447  public function getDefinitionMtime( ResourceLoaderContext $context ) {
448  wfProfileIn( __METHOD__ );
449  $summary = $this->getDefinitionSummary( $context );
450  if ( $summary === null ) {
451  wfProfileOut( __METHOD__ );
452  return 0;
453  }
454 
455  $hash = md5( json_encode( $summary ) );
456 
458 
459  // Embed the hash itself in the cache key. This allows for a few nifty things:
460  // - During deployment, servers with old and new versions of the code communicating
461  // with the same memcached will not override the same key repeatedly increasing
462  // the timestamp.
463  // - In case of the definition changing and then changing back in a short period of time
464  // (e.g. in case of a revert or a corrupt server) the old timestamp and client-side cache
465  // url will be re-used.
466  // - If different context-combinations (e.g. same skin, same language or some combination
467  // thereof) result in the same definition, they will use the same hash and timestamp.
468  $key = wfMemcKey( 'resourceloader', 'moduledefinition', $this->getName(), $hash );
469 
470  $data = $cache->get( $key );
471  if ( is_int( $data ) && $data > 0 ) {
472  // We've seen this hash before, re-use the timestamp of when we first saw it.
473  wfProfileOut( __METHOD__ );
474  return $data;
475  }
476 
477  wfDebugLog( 'resourceloader', __METHOD__ . ": New definition hash for module {$this->getName()} in context {$context->getHash()}: $hash." );
478 
479  $timestamp = time();
480  $cache->set( $key, $timestamp );
481 
482  wfProfileOut( __METHOD__ );
483  return $timestamp;
484  }
485 
510  public function getDefinitionSummary( ResourceLoaderContext $context ) {
511  return array(
512  'class' => get_class( $this ),
513  );
514  }
515 
525  public function isKnownEmpty( ResourceLoaderContext $context ) {
526  return false;
527  }
528 
530  private static $jsParser;
531  private static $parseCacheVersion = 1;
532 
541  protected function validateScriptFile( $fileName, $contents ) {
542  global $wgResourceLoaderValidateJS;
543  if ( $wgResourceLoaderValidateJS ) {
544  // Try for cache hit
545  // Use CACHE_ANYTHING since filtering is very slow compared to DB queries
546  $key = wfMemcKey( 'resourceloader', 'jsparse', self::$parseCacheVersion, md5( $contents ) );
548  $cacheEntry = $cache->get( $key );
549  if ( is_string( $cacheEntry ) ) {
550  return $cacheEntry;
551  }
552 
554  try {
555  $parser->parse( $contents, $fileName, 1 );
556  $result = $contents;
557  } catch ( Exception $e ) {
558  // We'll save this to cache to avoid having to validate broken JS over and over...
559  $err = $e->getMessage();
560  $result = "throw new Error(" . Xml::encodeJsVar( "JavaScript parse error: $err" ) . ");";
561  }
562 
563  $cache->set( $key, $result );
564  return $result;
565  } else {
566  return $contents;
567  }
568  }
569 
573  protected static function javaScriptParser() {
574  if ( !self::$jsParser ) {
575  self::$jsParser = new JSParser();
576  }
577  return self::$jsParser;
578  }
579 
586  protected static function safeFilemtime( $filename ) {
587  if ( file_exists( $filename ) ) {
588  return filemtime( $filename );
589  } else {
590  // We only ever map this function on an array if we're gonna call max() after,
591  // so return our standard minimum timestamps here. This is 1, not 0, because
592  // wfTimestamp(0) == NOW
593  return 1;
594  }
595  }
596 }
ResourceLoaderModule\getDependencies
getDependencies()
Get a list of modules this module depends on.
Definition: ResourceLoaderModule.php:283
ResourceLoaderContext
Object passed around to modules which contains information about the state of a specific loader reque...
Definition: ResourceLoaderContext.php:29
$result
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. $reader:XMLReader object $logInfo:Array of information Return false to stop further processing of the tag 'ImportHandlePageXMLTag':When parsing a XML tag in a page. $reader:XMLReader object $pageInfo:Array of information Return false to stop further processing of the tag 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information Return false to stop further processing of the tag 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. $reader:XMLReader object Return false to stop further processing of the tag 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. $reader:XMLReader object $revisionInfo:Array of information Return false to stop further processing of the tag 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. $title:Title object for the current page $request:WebRequest $ignoreRedirect:boolean to skip redirect check $target:Title/string of redirect target $article:Article object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) $article:article(object) being checked 'IsTrustedProxy':Override the result of wfIsTrustedProxy() $ip:IP being check $result:Change this value to override the result of wfIsTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of User::isValidEmailAddr(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetMagic':DEPRECATED, use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetSpecialPageAliases':DEPRECATED, use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Associative array mapping language codes to prefixed links of the form "language:title". & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LinkBegin':Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
Definition: hooks.txt:1528
ResourceLoaderModule\getFlip
getFlip( $context)
Definition: ResourceLoaderModule.php:115
ResourceLoaderModule\supportsURLLoading
supportsURLLoading()
Whether this module supports URL loading.
Definition: ResourceLoaderModule.php:168
ResourceLoaderModule\$msgBlobMtime
$msgBlobMtime
Definition: ResourceLoaderModule.php:66
ResourceLoaderModule\getStyleURLsForDebug
getStyleURLsForDebug(ResourceLoaderContext $context)
Get the URL or URLs to load for this module's CSS in debug mode.
Definition: ResourceLoaderModule.php:194
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
ResourceLoaderModule\getModifiedTime
getModifiedTime(ResourceLoaderContext $context)
Get this module's last modification timestamp for a given combination of language,...
Definition: ResourceLoaderModule.php:392
ResourceLoaderModule\TYPE_COMBINED
const TYPE_COMBINED
Definition: ResourceLoaderModule.php:34
ResourceLoaderModule\setMsgBlobMtime
setMsgBlobMtime( $lang, $mtime)
Set a preloaded message blob last modification timestamp.
Definition: ResourceLoaderModule.php:368
ResourceLoaderModule\ORIGIN_CORE_SITEWIDE
const ORIGIN_CORE_SITEWIDE
Definition: ResourceLoaderModule.php:37
ResourceLoaderModule\ORIGIN_USER_SITEWIDE
const ORIGIN_USER_SITEWIDE
Definition: ResourceLoaderModule.php:44
ResourceLoaderModule\isRaw
isRaw()
Whether this module's JS expects to work without the client-side ResourceLoader module.
Definition: ResourceLoaderModule.php:259
wfGetDB
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:3650
$timestamp
if( $limit) $timestamp
Definition: importImages.php:104
ResourceLoaderModule\getHashMtime
getHashMtime(ResourceLoaderContext $context)
Helper method for calculating when the module's hash (if it has one) changed.
Definition: ResourceLoaderModule.php:404
ResourceLoaderModule\setName
setName( $name)
Set this module's name.
Definition: ResourceLoaderModule.php:86
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:2483
wfDebugLog
wfDebugLog( $logGroup, $text, $dest='all')
Send a line to a supplementary debug log file, if configured, or main debug log if not.
Definition: GlobalFunctions.php:1040
wfProfileIn
wfProfileIn( $functionname)
Begin profiling of a function.
Definition: Profiler.php:33
ResourceLoaderModule\getTargets
getTargets()
Get target(s) for the module, eg ['desktop'] or ['desktop', 'mobile'].
Definition: ResourceLoaderModule.php:293
ResourceLoaderModule\TYPE_MESSAGES
const TYPE_MESSAGES
Definition: ResourceLoaderModule.php:33
wfGetCache
wfGetCache( $inputType)
Get a cache object.
Definition: GlobalFunctions.php:3948
ResourceLoaderModule\$origin
$origin
Definition: ResourceLoaderModule.php:56
$wgContLang
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
Definition: design.txt:56
ResourceLoaderModule\getStyles
getStyles(ResourceLoaderContext $context)
Get all CSS for this module for a given skin.
Definition: ResourceLoaderModule.php:180
Xml\encodeJsVar
static encodeJsVar( $value, $pretty=false)
Encode a variable of arbitrary type to JavaScript.
Definition: Xml.php:647
$dbr
$dbr
Definition: testCompression.php:48
ResourceLoaderModule\setOrigin
setOrigin( $origin)
Set this module's origin.
Definition: ResourceLoaderModule.php:107
FormatJson\decode
static decode( $value, $assoc=false)
Decodes a JSON string.
Definition: FormatJson.php:126
ResourceLoaderModule\getGroup
getGroup()
Get the group this module is in.
Definition: ResourceLoaderModule.php:226
wfMemcKey
wfMemcKey()
Get a cache key.
Definition: GlobalFunctions.php:3571
ResourceLoaderContext\getRequest
getRequest()
Definition: ResourceLoaderContext.php:129
ResourceLoaderModule\getDefinitionMtime
getDefinitionMtime(ResourceLoaderContext $context)
Helper method for calculating when this module's definition summary was last changed.
Definition: ResourceLoaderModule.php:447
ResourceLoaderModule\getScript
getScript(ResourceLoaderContext $context)
Get all JS for this module for a given language and skin.
Definition: ResourceLoaderModule.php:128
$parser
do that in ParserLimitReportFormat instead $parser
Definition: hooks.txt:1956
wfProfileOut
wfProfileOut( $functionname='missing')
Stop profiling of a function.
Definition: Profiler.php:46
ResourceLoaderModule\TYPE_SCRIPTS
const TYPE_SCRIPTS
Definition: ResourceLoaderModule.php:31
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
wfTimestampNow
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
Definition: GlobalFunctions.php:2514
ResourceLoader\makeLoaderURL
static makeLoaderURL( $modules, $lang, $skin, $user=null, $version=null, $debug=false, $only=null, $printable=false, $handheld=false, $extraQuery=array())
Build a load.php URL.
Definition: ResourceLoader.php:1212
ResourceLoaderContext\getLanguage
getLanguage()
Definition: ResourceLoaderContext.php:143
ResourceLoaderContext\getVersion
getVersion()
Definition: ResourceLoaderContext.php:196
ResourceLoaderModule\getOrigin
getOrigin()
Get this module's origin.
Definition: ResourceLoaderModule.php:97
ResourceLoaderModule\$parseCacheVersion
static $parseCacheVersion
Definition: ResourceLoaderModule.php:531
ResourceLoaderModule\isKnownEmpty
isKnownEmpty(ResourceLoaderContext $context)
Check whether this module is known to be empty.
Definition: ResourceLoaderModule.php:525
ResourceLoaderModule\ORIGIN_USER_INDIVIDUAL
const ORIGIN_USER_INDIVIDUAL
Definition: ResourceLoaderModule.php:47
ResourceLoaderModule\getPosition
getPosition()
Where on the HTML page should this module's JS be loaded?
Definition: ResourceLoaderModule.php:248
ResourceLoaderModule\$targets
$targets
Definition: ResourceLoaderModule.php:61
ResourceLoaderModule\$name
$name
Definition: ResourceLoaderModule.php:60
CACHE_ANYTHING
const CACHE_ANYTHING
Definition: Defines.php:111
ResourceLoaderModule\getMessages
getMessages()
Get the messages needed for this module.
Definition: ResourceLoaderModule.php:216
ResourceLoaderModule\validateScriptFile
validateScriptFile( $fileName, $contents)
Validate a given script file; if valid returns the original source.
Definition: ResourceLoaderModule.php:541
ResourceLoaderModule\getModifiedHash
getModifiedHash(ResourceLoaderContext $context)
Get the hash for whatever this module may contain.
Definition: ResourceLoaderModule.php:437
ResourceLoaderModule\getDefinitionSummary
getDefinitionSummary(ResourceLoaderContext $context)
Get the definition summary for this module.
Definition: ResourceLoaderModule.php:510
ResourceLoaderModule\ORIGIN_CORE_INDIVIDUAL
const ORIGIN_CORE_INDIVIDUAL
Definition: ResourceLoaderModule.php:40
ResourceLoaderContext\getSkin
getSkin()
Definition: ResourceLoaderContext.php:168
ResourceLoaderModule\safeFilemtime
static safeFilemtime( $filename)
Safe version of filemtime(), which doesn't throw a PHP warning if the file doesn't exist but returns ...
Definition: ResourceLoaderModule.php:586
ResourceLoaderModule\$jsParser
static $jsParser
Definition: ResourceLoaderModule.php:530
ResourceLoaderContext\getUser
getUser()
Definition: ResourceLoaderContext.php:175
ResourceLoaderModule\ORIGIN_ALL
const ORIGIN_ALL
Definition: ResourceLoaderModule.php:50
$hash
return false to override stock group addition can be modified try getUserPermissionsErrors userCan checks are continued by internal code can override on output return false to not delete it return false to override the default password checks & $hash
Definition: hooks.txt:2697
ResourceLoaderModule\getMsgBlobMtime
getMsgBlobMtime( $lang)
Get the last modification timestamp of the message blob for this module in a given language.
Definition: ResourceLoaderModule.php:340
$summary
$summary
Definition: importImages.php:120
$skin
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 noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned $skin
Definition: hooks.txt:1530
DB_SLAVE
const DB_SLAVE
Definition: Defines.php:55
ResourceLoaderModule
Abstraction for resource loader modules, with name registration and maxage functionality.
Definition: ResourceLoaderModule.php:28
ResourceLoaderModule\$fileDeps
$fileDeps
Definition: ResourceLoaderModule.php:64
$cache
$cache
Definition: mcc.php:32
ResourceLoaderModule\getScriptURLsForDebug
getScriptURLsForDebug(ResourceLoaderContext $context)
Get the URL or URLs to load for this module's JS in debug mode.
Definition: ResourceLoaderModule.php:147
TS_UNIX
const TS_UNIX
Unix time - the number of seconds since 1970-01-01 00:00:00 UTC.
Definition: GlobalFunctions.php:2426
ResourceLoaderModule\TYPE_STYLES
const TYPE_STYLES
Definition: ResourceLoaderModule.php:32
ResourceLoaderModule\getSource
getSource()
Get the origin of this module.
Definition: ResourceLoaderModule.php:236
JSParser
Definition: jsminplus.php:673
name
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at name
Definition: design.txt:12
ResourceLoaderModule\javaScriptParser
static javaScriptParser()
Definition: ResourceLoaderModule.php:573
$e
if( $useReadline) $e
Definition: eval.php:66
ResourceLoaderModule\getLoaderScript
getLoaderScript()
Get the loader JS for this module, if set.
Definition: ResourceLoaderModule.php:268
ResourceLoaderModule\getFileDependencies
getFileDependencies( $skin)
Get the files this module depends on indirectly for a given skin.
Definition: ResourceLoaderModule.php:304
ResourceLoaderModule\getName
getName()
Get this module's name.
Definition: ResourceLoaderModule.php:76
ResourceLoaderModule\setFileDependencies
setFileDependencies( $skin, $deps)
Set preloaded file dependency information.
Definition: ResourceLoaderModule.php:330