MediaWiki  master
MediaWiki\ResourceLoader\FileModule Class Reference

Module based on local JavaScript/CSS files. More...

Inheritance diagram for MediaWiki\ResourceLoader\FileModule:
Collaboration diagram for MediaWiki\ResourceLoader\FileModule:

Public Member Functions

 __construct (array $options=[], string $localBasePath=null, string $remoteBasePath=null)
 Constructs a new module from an options array. More...
 
 enableModuleContentVersion ()
 Disable module content versioning. More...
 
 getAllStyleFiles ()
 Returns all style files and all skin style files used by this module. More...
 
 getDefinitionSummary (Context $context)
 Get the definition summary for this module. More...
 
 getDependencies (Context $context=null)
 Get names of modules this module depends on. More...
 
 getFlip (Context $context)
 Get whether CSS for this module should be flipped. More...
 
 getGroup ()
 Get the name of the group this module should be loaded in. More...
 
 getMessages ()
 Get message keys used by this module. More...
 
 getPackageFiles (Context $context)
 Resolve the package files definition and generates the content of each package file. More...
 
 getScript (Context $context)
 Gets all scripts for a given context concatenated together. More...
 
 getScriptURLsForDebug (Context $context)
 
 getSkipFunction ()
 
 getStyleFiles (Context $context)
 Get a list of file paths for all styles in this module, in order of proper inclusion. More...
 
 getStyles (Context $context)
 Get all styles for a given context. More...
 
 getStyleSheetLang ( $path)
 Infer the stylesheet language from a stylesheet file path. More...
 
 getStyleURLsForDebug (Context $context)
 
 getTargets ()
 Get target(s) for the module, eg ['desktop'] or ['desktop', 'mobile']. More...
 
 getTemplates ()
 Get content of named templates for this module. More...
 
 getType ()
 Get the module's load type. More...
 
 readStyleFiles (array $styles, Context $context)
 Read the contents of a list of CSS files and remap and concatenate these. More...
 
 requiresES6 ()
 Whether the module requires ES6 support in the client. More...
 
 setSkinStylesOverride (array $moduleSkinStyles)
 Provide overrides for skinStyles to modules that support that. More...
 
 supportsURLLoading ()
 
- Public Member Functions inherited from MediaWiki\ResourceLoader\Module
 getConfig ()
 
 getDeprecationInformation (Context $context)
 Get JS representing deprecation information for the current module if available. More...
 
 getHeaders (Context $context)
 Get headers to send as part of a module web response. 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...
 
 getSkins ()
 Get list of skins for which this module must be available to load. More...
 
 getSource ()
 Get the source of this module. 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...
 
 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...
 
 shouldEmbedModule (Context $context)
 Check whether this module should be embedded rather than linked. More...
 

Static Public Member Functions

static extractBasePaths (array $options=[], $localBasePath=null, $remoteBasePath=null)
 Extract a pair of local and remote base paths from module definition information. More...
 
static getPackageFileType ( $path)
 Infer the file type from a package file path. More...
 
- Static Public Member Functions inherited from MediaWiki\ResourceLoader\Module
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...
 

Protected Member Functions

 compileLessString ( $style, $stylePath, Context $context)
 Compile a LESS string into CSS. More...
 
 getAllSkinStyleFiles ()
 Gets a list of file paths for all skin style files in the module, for all available skins. More...
 
 getLocalPath ( $path)
 
 getPath ( $path)
 
 getRemotePath ( $path)
 
 getSkinStyleFiles ( $skinName)
 Gets a list of file paths for all skin styles in the module used by the skin. More...
 
 getVueComponentParser ()
 
 processStyle ( $style, $styleLang, $path, Context $context)
 Process a CSS/LESS string. More...
 
 readStyleFile ( $path, Context $context)
 Read and process a style file. More...
 
 stripBom ( $input)
 Takes an input string and removes the UTF-8 BOM character if present. More...
 
- Protected Member Functions inherited from MediaWiki\ResourceLoader\Module
 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...
 

Static Protected Member Functions

static tryForKey (array $list, $key, $fallback=null)
 Get a list of element that match a key, optionally using a fallback key. More...
 
- Static Protected Member Functions inherited from MediaWiki\ResourceLoader\Module
static safeFileHash ( $filePath)
 Compute a non-cryptographic string hash of a file's contents. More...
 

Protected Attributes

bool $debugRaw = true
 Link to raw files in debug mode. More...
 
array< int, string|FilePath$debugScripts = []
 List of paths to JavaScript files to include in debug mode. More...
 
string[] $dependencies = []
 List of modules this module depends on. More...
 
bool $es6 = false
 Whether this module requires the client to support ES6. More...
 
null string $group = null
 Name of group to load this module in. More...
 
bool $hasGeneratedStyles = false
 Whether getStyleURLsForDebug should return raw file paths, or return load.php urls. More...
 
array< string, array< int, string|FilePath > > $languageScripts = []
 Lists of JavaScript files by language code. More...
 
string $localBasePath = ''
 Local base path, see __construct() More...
 
string[] $localFileRefs = []
 Place where readStyleFile() tracks file dependencies. More...
 
string[] $messages = []
 List of message keys used by this module. More...
 
string[] $missingLocalFileRefs = []
 Place where readStyleFile() tracks file dependencies for non-existent files. More...
 
bool $noflip = false
 Whether CSSJanus flipping should be skipped for this module. More...
 
null array $packageFiles = null
 Packaged files definition, to bundle and make available client-side via require(). More...
 
string $remoteBasePath = ''
 Remote base path, see __construct() More...
 
array< int, string|FilePath$scripts = []
 List of JavaScript file paths to always include. More...
 
array< string, array< int, string|FilePath > > $skinScripts = []
 Lists of JavaScript files by skin name. More...
 
array< string, array< int, string|FilePath > > $skinStyles = []
 Lists of CSS files by skin name. More...
 
null string $skipFunction = null
 File name containing the body of the skip function. More...
 
array< int, string|FilePath$styles = []
 List of CSS file files to always include. More...
 
array< int|string, string|FilePath$templates = []
 List of the named templates used by this module. More...
 
VueComponentParser null $vueComponentParser = null
 Lazy-created by getVueComponentParser() More...
 
- Protected Attributes inherited from MediaWiki\ResourceLoader\Module
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...
 

Detailed Description

Module based on local JavaScript/CSS files.

The following public methods can query the database:

See also
$wgResourceModules
Since
1.17

Definition at line 53 of file FileModule.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\ResourceLoader\FileModule::__construct ( array  $options = [],
string  $localBasePath = null,
string  $remoteBasePath = null 
)

Constructs a new module from an options array.

Parameters
array$optionsSee $wgResourceModules for the available options.
string | null$localBasePathBase path to prepend to all local paths in $options. Defaults to $IP
string | null$remoteBasePathBase path to prepend to all remote paths in $options. Defaults to $wgResourceBasePath

Definition at line 172 of file FileModule.php.

References MediaWiki\ResourceLoader\FileModule\$localBasePath, MediaWiki\ResourceLoader\FileModule\$remoteBasePath, MediaWiki\ResourceLoader\FileModule\extractBasePaths(), and MediaWiki\ResourceLoader\FileModule\getPath().

Member Function Documentation

◆ compileLessString()

MediaWiki\ResourceLoader\FileModule::compileLessString (   $style,
  $stylePath,
Context  $context 
)
protected

Compile a LESS string into CSS.

Keeps track of all used files and adds them to localFileRefs.

Since
1.35
Parameters
string$styleLESS source to compile
string$stylePathFile path of LESS source, used for resolving relative file paths
Context$contextContext in which to generate script
Returns
string CSS source

Definition at line 1077 of file FileModule.php.

References $path, CACHE_ANYTHING, FileContentsHasher\getFileContentsHash(), ExtensionRegistry\getInstance(), ObjectCache\getLocalServerInstance(), MediaWiki\ResourceLoader\Context\getResourceLoader(), and MediaWiki\ResourceLoader\Context\getSkin().

◆ enableModuleContentVersion()

MediaWiki\ResourceLoader\FileModule::enableModuleContentVersion ( )

Disable module content versioning.

This class uses getDefinitionSummary() instead, to avoid filesystem overhead involved with building the full module content inside a startup request.

Returns
bool

Reimplemented from MediaWiki\ResourceLoader\Module.

Reimplemented in MediaWiki\ResourceLoader\LanguageDataModule.

Definition at line 506 of file FileModule.php.

◆ extractBasePaths()

static MediaWiki\ResourceLoader\FileModule::extractBasePaths ( array  $options = [],
  $localBasePath = null,
  $remoteBasePath = null 
)
static

Extract a pair of local and remote base paths from module definition information.

Implementation note: the amount of global state used in this function is staggering.

Parameters
array$optionsModule definition
string | null$localBasePathPath to use if not provided in module definition. Defaults to $IP
string | null$remoteBasePathPath to use if not provided in module definition. Defaults to $wgResourceBasePath
Returns
string[] [ localBasePath, remoteBasePath ]

Definition at line 278 of file FileModule.php.

References $IP, MediaWiki\ResourceLoader\FileModule\$localBasePath, MediaWiki\ResourceLoader\FileModule\$remoteBasePath, MediaWiki\MainConfigNames\ExtensionAssetsPath, MediaWiki\MediaWikiServices\getInstance(), MediaWiki\MainConfigNames\ResourceBasePath, and MediaWiki\MainConfigNames\StylePath.

Referenced by MediaWiki\ResourceLoader\FileModule\__construct(), MediaWiki\ResourceLoader\SkinModule\getStyleFiles(), and MediaWiki\ResourceLoader\getThemePaths().

◆ getAllSkinStyleFiles()

MediaWiki\ResourceLoader\FileModule::getAllSkinStyleFiles ( )
protected

Gets a list of file paths for all skin style files in the module, for all available skins.

Returns
array A list of file paths collated by media type

Definition at line 878 of file FileModule.php.

◆ getAllStyleFiles()

MediaWiki\ResourceLoader\FileModule::getAllStyleFiles ( )

Returns all style files and all skin style files used by this module.

Returns
array

Definition at line 900 of file FileModule.php.

◆ getDefinitionSummary()

MediaWiki\ResourceLoader\FileModule::getDefinitionSummary ( Context  $context)

Get the definition summary for this module.

Parameters
Context$context
Returns
array

Reimplemented from MediaWiki\ResourceLoader\Module.

Reimplemented in MediaWiki\ResourceLoader\SkinModule.

Definition at line 576 of file FileModule.php.

References MediaWiki\ResourceLoader\FileModule\$packageFiles, MediaWiki\ResourceLoader\Module\getLessVars(), and MediaWiki\ResourceLoader\Module\getMessageBlob().

◆ getDependencies()

MediaWiki\ResourceLoader\FileModule::getDependencies ( Context  $context = null)

Get names of modules this module depends on.

Parameters
Context | null$context
Returns
string[] List of module names

Reimplemented from MediaWiki\ResourceLoader\Module.

Reimplemented in MediaWiki\ResourceLoader\ForeignApiModule.

Definition at line 465 of file FileModule.php.

References MediaWiki\ResourceLoader\FileModule\$dependencies.

◆ getFlip()

MediaWiki\ResourceLoader\FileModule::getFlip ( Context  $context)

Get whether CSS for this module should be flipped.

Parameters
Context$context
Returns
bool

Reimplemented from MediaWiki\ResourceLoader\Module.

Definition at line 1031 of file FileModule.php.

References MediaWiki\ResourceLoader\Context\getDirection().

◆ getGroup()

MediaWiki\ResourceLoader\FileModule::getGroup ( )

Get the name of the group this module should be loaded in.

Returns
null|string Group name

Reimplemented from MediaWiki\ResourceLoader\Module.

Definition at line 455 of file FileModule.php.

References MediaWiki\ResourceLoader\FileModule\$group.

◆ getLocalPath()

MediaWiki\ResourceLoader\FileModule::getLocalPath (   $path)
protected
Parameters
string | FilePath$path
Returns
string

Definition at line 658 of file FileModule.php.

References $path.

Referenced by MediaWiki\ResourceLoader\FileModule\getSkipFunction().

◆ getMessages()

MediaWiki\ResourceLoader\FileModule::getMessages ( )

Get message keys used by this module.

Returns
string[] List of message keys

Reimplemented from MediaWiki\ResourceLoader\Module.

Reimplemented in MediaWiki\ResourceLoader\LessVarFileModule.

Definition at line 446 of file FileModule.php.

References MediaWiki\ResourceLoader\FileModule\$messages.

◆ getPackageFiles()

MediaWiki\ResourceLoader\FileModule::getPackageFiles ( Context  $context)

Resolve the package files definition and generates the content of each package file.

Parameters
Context$context
Returns
array|null Package files data structure, see ResourceLoaderModule::getScript()

Definition at line 1311 of file FileModule.php.

References $content, MediaWiki\ResourceLoader\Context\getDebug(), and MediaWiki\ResourceLoader\Context\getHash().

Referenced by MediaWiki\ResourceLoader\FileModule\getScript(), and MediaWiki\ResourceLoader\FileModule\getStyles().

◆ getPackageFileType()

static MediaWiki\ResourceLoader\FileModule::getPackageFileType (   $path)
static

Infer the file type from a package file path.

Parameters
string$path
Returns
string 'script', 'script-vue', or 'data'

Definition at line 704 of file FileModule.php.

References $path.

◆ getPath()

MediaWiki\ResourceLoader\FileModule::getPath (   $path)
protected
Parameters
string | FilePath$path
Returns
string

Definition at line 646 of file FileModule.php.

References $path.

Referenced by MediaWiki\ResourceLoader\FileModule\__construct().

◆ getRemotePath()

MediaWiki\ResourceLoader\FileModule::getRemotePath (   $path)
protected
Parameters
string | FilePath$path
Returns
string

Definition at line 673 of file FileModule.php.

References $path.

Referenced by MediaWiki\ResourceLoader\FileModule\getScriptURLsForDebug(), and MediaWiki\ResourceLoader\FileModule\getStyleURLsForDebug().

◆ getScript()

MediaWiki\ResourceLoader\FileModule::getScript ( Context  $context)

Gets all scripts for a given context concatenated together.

Parameters
Context$contextContext in which to generate script
Returns
string|array JavaScript code for $context, or package files data structure

Reimplemented from MediaWiki\ResourceLoader\Module.

Reimplemented in MediaWiki\ResourceLoader\LanguageDataModule.

Definition at line 333 of file FileModule.php.

References $file, MediaWiki\ResourceLoader\FileModule\$packageFiles, MediaWiki\ResourceLoader\Module\getDeprecationInformation(), and MediaWiki\ResourceLoader\FileModule\getPackageFiles().

◆ getScriptURLsForDebug()

◆ getSkinStyleFiles()

MediaWiki\ResourceLoader\FileModule::getSkinStyleFiles (   $skinName)
protected

Gets a list of file paths for all skin styles in the module used by the skin.

Parameters
string$skinNameThe name of the skin
Returns
array A list of file paths collated by media type

Definition at line 866 of file FileModule.php.

◆ getSkipFunction()

MediaWiki\ResourceLoader\FileModule::getSkipFunction ( )
Returns
null|string

Reimplemented from MediaWiki\ResourceLoader\Module.

Definition at line 486 of file FileModule.php.

References MediaWiki\ResourceLoader\FileModule\getLocalPath().

◆ getStyleFiles()

MediaWiki\ResourceLoader\FileModule::getStyleFiles ( Context  $context)

Get a list of file paths for all styles in this module, in order of proper inclusion.

Access: internal
Exposed only for use by structure phpunit tests.
Parameters
Context$context
Returns
array<string,array<int,string|FilePath>> Map from media type to list of file paths

Reimplemented in MediaWiki\ResourceLoader\SkinModule, and MediaWiki\ResourceLoader\CodexModule.

Definition at line 850 of file FileModule.php.

References MediaWiki\ResourceLoader\Context\getSkin().

Referenced by MediaWiki\ResourceLoader\FileModule\getStyles(), and MediaWiki\ResourceLoader\FileModule\getStyleURLsForDebug().

◆ getStyles()

MediaWiki\ResourceLoader\FileModule::getStyles ( Context  $context)

◆ getStyleSheetLang()

MediaWiki\ResourceLoader\FileModule::getStyleSheetLang (   $path)

Infer the stylesheet language from a stylesheet file path.

Since
1.22
Parameters
string$path
Returns
string The stylesheet language name

Definition at line 695 of file FileModule.php.

References $path.

◆ getStyleURLsForDebug()

MediaWiki\ResourceLoader\FileModule::getStyleURLsForDebug ( Context  $context)

◆ getTargets()

MediaWiki\ResourceLoader\FileModule::getTargets ( )

Get target(s) for the module, eg ['desktop'] or ['desktop', 'mobile'].

Returns
string[]

Reimplemented from MediaWiki\ResourceLoader\Module.

Definition at line 1040 of file FileModule.php.

◆ getTemplates()

MediaWiki\ResourceLoader\FileModule::getTemplates ( )

Get content of named templates for this module.

Returns
array<string,string> Templates mapping template alias to content

Reimplemented from MediaWiki\ResourceLoader\Module.

Definition at line 1140 of file FileModule.php.

References $content.

◆ getType()

MediaWiki\ResourceLoader\FileModule::getType ( )

Get the module's load type.

Since
1.28
Returns
string

Reimplemented from MediaWiki\ResourceLoader\Module.

Definition at line 1050 of file FileModule.php.

◆ getVueComponentParser()

MediaWiki\ResourceLoader\FileModule::getVueComponentParser ( )
protected

◆ processStyle()

MediaWiki\ResourceLoader\FileModule::processStyle (   $style,
  $styleLang,
  $path,
Context  $context 
)
protected

Process a CSS/LESS string.

This method performs the following processing steps:

  • LESS compilation (if $styleLang = 'less')
  • RTL flipping with CSSJanus (if getFlip() returns true)
  • Registration of references to local files in $localFileRefs and $missingLocalFileRefs
  • URL remapping and data URI embedding
Access: internal
Parameters
string$styleCSS or LESS code
string$styleLangLanguage of $style code ('css' or 'less')
string | FilePath$pathPath to code file, used for resolving relative file paths
Context$context
Returns
string Processed CSS code

Definition at line 993 of file FileModule.php.

References $file, and $path.

Referenced by MediaWiki\ResourceLoader\FileModule\getStyles().

◆ readStyleFile()

MediaWiki\ResourceLoader\FileModule::readStyleFile (   $path,
Context  $context 
)
protected

Read and process a style file.

Reads a file from disk and runs it through processStyle().

This method can be used as a callback for array_map()

Access: internal
Parameters
string | FilePath$pathPath of style file to read
Context$context
Returns
string CSS code

Definition at line 969 of file FileModule.php.

References $path.

◆ readStyleFiles()

MediaWiki\ResourceLoader\FileModule::readStyleFiles ( array  $styles,
Context  $context 
)

Read the contents of a list of CSS files and remap and concatenate these.

Access: internal
This is considered a private method. Exposed for internal use by WebInstallerOutput.
Parameters
array<string,array<int,string|FilePath>>$styles Map of media type to file paths
Context$context
Returns
array<string,string> Map of combined CSS code, keyed by media type

Definition at line 944 of file FileModule.php.

References $file.

Referenced by MediaWiki\ResourceLoader\FileModule\getStyles().

◆ requiresES6()

MediaWiki\ResourceLoader\FileModule::requiresES6 ( )

Whether the module requires ES6 support in the client.

If the client does not support ES6, attempting to load a module that requires ES6 will result in an error.

Stability: stable
to override
Since
1.36
Returns
bool

Reimplemented from MediaWiki\ResourceLoader\Module.

Definition at line 494 of file FileModule.php.

References MediaWiki\ResourceLoader\FileModule\$es6.

◆ setSkinStylesOverride()

MediaWiki\ResourceLoader\FileModule::setSkinStylesOverride ( array  $moduleSkinStyles)

Provide overrides for skinStyles to modules that support that.

This MUST be called after self::setName().

Since
1.37
See also
$wgResourceModuleSkinStyles
Parameters
array$moduleSkinStyles

Reimplemented from MediaWiki\ResourceLoader\Module.

Reimplemented in MediaWiki\ResourceLoader\OOUIFileModule.

Definition at line 808 of file FileModule.php.

References $path.

◆ stripBom()

MediaWiki\ResourceLoader\FileModule::stripBom (   $input)
protected

Takes an input string and removes the UTF-8 BOM character if present.

We need to remove these after reading a file, because we concatenate our files and the BOM character is not valid in the middle of a string. We already assume UTF-8 everywhere, so this should be safe.

Parameters
string$input
Returns
string Input minus the initial BOM char

Definition at line 1407 of file FileModule.php.

◆ supportsURLLoading()

MediaWiki\ResourceLoader\FileModule::supportsURLLoading ( )
Returns
bool

Reimplemented from MediaWiki\ResourceLoader\Module.

Reimplemented in MediaWiki\ResourceLoader\LanguageDataModule.

Definition at line 376 of file FileModule.php.

References MediaWiki\ResourceLoader\FileModule\$packageFiles.

◆ tryForKey()

static MediaWiki\ResourceLoader\FileModule::tryForKey ( array  $list,
  $key,
  $fallback = null 
)
staticprotected

Get a list of element that match a key, optionally using a fallback key.

Parameters
array[]$listList of lists to select from
string$keyKey to look for in $list
string | null$fallbackKey to look for in $list if $key doesn't exist
Returns
array List of elements from $list which matched $key or $fallback, or an empty list in case of no match

Definition at line 745 of file FileModule.php.

References $fallback.

Member Data Documentation

◆ $debugRaw

bool MediaWiki\ResourceLoader\FileModule::$debugRaw = true
protected

Link to raw files in debug mode.

Definition at line 133 of file FileModule.php.

◆ $debugScripts

array<int,string|FilePath> MediaWiki\ResourceLoader\FileModule::$debugScripts = []
protected

List of paths to JavaScript files to include in debug mode.

Definition at line 78 of file FileModule.php.

◆ $dependencies

string [] MediaWiki\ResourceLoader\FileModule::$dependencies = []
protected

List of modules this module depends on.

Definition at line 114 of file FileModule.php.

Referenced by MediaWiki\ResourceLoader\FileModule\getDependencies(), and MediaWiki\ResourceLoader\ForeignApiModule\getDependencies().

◆ $es6

bool MediaWiki\ResourceLoader\FileModule::$es6 = false
protected

Whether this module requires the client to support ES6.

Definition at line 139 of file FileModule.php.

Referenced by MediaWiki\ResourceLoader\FileModule\requiresES6().

◆ $group

null string MediaWiki\ResourceLoader\FileModule::$group = null
protected

Name of group to load this module in.

Definition at line 130 of file FileModule.php.

Referenced by MediaWiki\ResourceLoader\FileModule\getGroup().

◆ $hasGeneratedStyles

bool MediaWiki\ResourceLoader\FileModule::$hasGeneratedStyles = false
protected

Whether getStyleURLsForDebug should return raw file paths, or return load.php urls.

Definition at line 145 of file FileModule.php.

◆ $languageScripts

array<string,array<int,string|FilePath> > MediaWiki\ResourceLoader\FileModule::$languageScripts = []
protected

Lists of JavaScript files by language code.

Definition at line 68 of file FileModule.php.

◆ $localBasePath

◆ $localFileRefs

string [] MediaWiki\ResourceLoader\FileModule::$localFileRefs = []
protected

Place where readStyleFile() tracks file dependencies.

Definition at line 150 of file FileModule.php.

◆ $messages

string [] MediaWiki\ResourceLoader\FileModule::$messages = []
protected

◆ $missingLocalFileRefs

string [] MediaWiki\ResourceLoader\FileModule::$missingLocalFileRefs = []
protected

Place where readStyleFile() tracks file dependencies for non-existent files.

Used in tests to detect missing dependencies.

Definition at line 156 of file FileModule.php.

◆ $noflip

bool MediaWiki\ResourceLoader\FileModule::$noflip = false
protected

Whether CSSJanus flipping should be skipped for this module.

Definition at line 136 of file FileModule.php.

◆ $packageFiles

null array MediaWiki\ResourceLoader\FileModule::$packageFiles = null
protected

Packaged files definition, to bundle and make available client-side via require().

See also
FileModule::expandPackageFiles()

Definition at line 97 of file FileModule.php.

Referenced by MediaWiki\ResourceLoader\FileModule\getDefinitionSummary(), MediaWiki\ResourceLoader\FileModule\getScript(), MediaWiki\ResourceLoader\FileModule\getStyles(), and MediaWiki\ResourceLoader\FileModule\supportsURLLoading().

◆ $remoteBasePath

◆ $scripts

array<int,string|FilePath> MediaWiki\ResourceLoader\FileModule::$scripts = []
protected

List of JavaScript file paths to always include.

Definition at line 63 of file FileModule.php.

◆ $skinScripts

array<string,array<int,string|FilePath> > MediaWiki\ResourceLoader\FileModule::$skinScripts = []
protected

Lists of JavaScript files by skin name.

Definition at line 73 of file FileModule.php.

Referenced by MediaWiki\ResourceLoader\OOUIFileModule\__construct().

◆ $skinStyles

array<string,array<int,string|FilePath> > MediaWiki\ResourceLoader\FileModule::$skinStyles = []
protected

Lists of CSS files by skin name.

Definition at line 88 of file FileModule.php.

◆ $skipFunction

null string MediaWiki\ResourceLoader\FileModule::$skipFunction = null
protected

File name containing the body of the skip function.

Definition at line 119 of file FileModule.php.

◆ $styles

array<int,string|FilePath> MediaWiki\ResourceLoader\FileModule::$styles = []
protected

List of CSS file files to always include.

Definition at line 83 of file FileModule.php.

Referenced by MediaWiki\ResourceLoader\FileModule\getStyles().

◆ $templates

array<int|string,string|FilePath> MediaWiki\ResourceLoader\FileModule::$templates = []
protected

List of the named templates used by this module.

Definition at line 127 of file FileModule.php.

◆ $vueComponentParser

VueComponentParser null MediaWiki\ResourceLoader\FileModule::$vueComponentParser = null
protected

The documentation for this class was generated from the following file: