/** @var string Name of group to load this module in */
protected $group;
- /** @var string Position on the page to load this module at */
- protected $position = 'bottom';
-
/** @var bool Link to raw files in debug mode */
protected $debugRaw = true;
* 'messages' => [array of message key strings],
* // Group which this module should be loaded together with
* 'group' => [group name string],
- * // Position on the page to load this module at
- * 'position' => ['bottom' (default) or 'top']
* // Function that, if it returns true, makes the loader skip this module.
* // The file must contain valid JavaScript for execution in a private function.
* // The file must not contain the "function () {" and "}" wrapper though.
$this->{$member} = $option;
break;
// Single strings
- case 'position':
case 'group':
case 'skipFunction':
$this->{$member} = (string)$option;
return $this->group;
}
- /**
- * @return string
- */
- public function getPosition() {
- return $this->position;
- }
-
/**
* Gets list of names of modules this module depends on.
* @param ResourceLoaderContext|null $context
// - dependencies (provided via startup module)
// - targets
// - group (provided via startup module)
- // - position (only used by OutputPage)
'scripts',
'debugScripts',
'styles',
'fileHashes' => $this->getFileHashes( $context ),
'messageBlob' => $this->getMessageBlob( $context ),
];
+
+ $lessVars = $this->getLessVars( $context );
+ if ( $lessVars ) {
+ $summary[] = [ 'lessVars' => $lessVars ];
+ }
+
return $summary;
}
$files = $compiler->AllParsedFiles();
$this->localFileRefs = array_merge( $this->localFileRefs, $files );
+ // Cache for 24 hours (86400 seconds).
$cache->set( $cacheKey, [
'css' => $css,
'files' => $files,
'hash' => FileContentsHasher::getFileContentsHash( $files ),
- ], 60 * 60 * 24 ); // 86400 seconds, or 24 hours.
+ ], 3600 * 24 );
return $css;
}
/**
* Takes named templates by the module and returns an array mapping.
- * @return array of templates mapping template alias to content
+ * @return array Templates mapping template alias to content
* @throws MWException
*/
public function getTemplates() {
* the BOM character is not valid in the middle of a string.
* We already assume UTF-8 everywhere, so this should be safe.
*
- * @return string input minus the intial BOM char
+ * @param string $input
+ * @return string Input minus the intial BOM char
*/
protected function stripBom( $input ) {
if ( substr_compare( "\xef\xbb\xbf", $input, 0, 3 ) === 0 ) {