MediaWiki  1.29.1
CiteCSSFileModule Class Reference
Inheritance diagram for CiteCSSFileModule:
Collaboration diagram for CiteCSSFileModule:

Public Member Functions

 __construct ( $options=[], $localBasePath=null, $remoteBasePath=null)
 Constructs a new module from an options array. More...
 
- Public Member Functions inherited from ResourceLoaderFileModule
 enableModuleContentVersion ()
 Disable module content versioning. More...
 
 getAllStyleFiles ()
 Returns all style files and all skin style files used by this module. More...
 
 getDefinitionSummary (ResourceLoaderContext $context)
 Get the definition summary for this module. More...
 
 getDependencies (ResourceLoaderContext $context=null)
 Gets list of names of modules this module depends on. More...
 
 getFlip ( $context)
 Get whether CSS for this module should be flipped. More...
 
 getGroup ()
 Gets the name of the group this module should be loaded in. More...
 
 getMessages ()
 Gets list of message keys used by this module. More...
 
 getScript (ResourceLoaderContext $context)
 Gets all scripts for a given context concatenated together. More...
 
 getScriptURLsForDebug (ResourceLoaderContext $context)
 
 getSkipFunction ()
 Get the skip function. More...
 
 getStyleFiles (ResourceLoaderContext $context)
 Get a list of file paths for all styles in this module, in order of proper inclusion. More...
 
 getStyles (ResourceLoaderContext $context)
 Get all styles for a given context. More...
 
 getStyleSheetLang ( $path)
 Infer the stylesheet language from a stylesheet file path. More...
 
 getStyleURLsForDebug (ResourceLoaderContext $context)
 
 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...
 
 isRaw ()
 
 readStyleFiles (array $styles, $flip, $context=null)
 Gets the contents of a list of CSS files. More...
 
 supportsURLLoading ()
 
- Public Member Functions inherited from ResourceLoaderModule
 getConfig ()
 
 getDefinitionMtime (ResourceLoaderContext $context)
 Back-compat dummy for old subclass implementations of getModifiedTime(). More...
 
 getHashMtime (ResourceLoaderContext $context)
 Back-compat dummy for old subclass implementations of getModifiedTime(). More...
 
 getModifiedHash (ResourceLoaderContext $context)
 Helper method for providing a version hash to getVersionHash(). More...
 
 getModifiedTime (ResourceLoaderContext $context)
 Get this module's last modification timestamp for a given context. More...
 
 getModuleContent (ResourceLoaderContext $context)
 Get an array of this module's resources. More...
 
 getName ()
 Get this module's name. More...
 
 getOrigin ()
 Get this module's origin. More...
 
 getPosition ()
 From where in the page HTML should this module be loaded? More...
 
 getSource ()
 Get the origin of this module. More...
 
 getVersionHash (ResourceLoaderContext $context)
 Get a string identifying the current version of this module in a given context. More...
 
 isKnownEmpty (ResourceLoaderContext $context)
 Check whether this module is known to be empty. More...
 
 setConfig (Config $config)
 
 setFileDependencies (ResourceLoaderContext $context, $files)
 Set in-object cache for file dependencies. More...
 
 setLogger (LoggerInterface $logger)
 
 setMessageBlob ( $blob, $lang)
 Set in-object cache for message blobs. More...
 
 setName ( $name)
 Set this module's name. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ResourceLoaderFileModule
static extractBasePaths ( $options=[], $localBasePath=null, $remoteBasePath=null)
 Extract a pair of local and remote base paths from module definition information. More...
 
- Static Public Member Functions inherited from ResourceLoaderModule
static expandRelativePaths (array $filePaths)
 Expand directories relative to $IP. More...
 
static getRelativePaths (array $filePaths)
 Make file paths relative to MediaWiki directory. More...
 
- Public Attributes inherited from ResourceLoaderModule
const LOAD_GENERAL = 'general'
 
const LOAD_STYLES = 'styles'
 
const ORIGIN_ALL = 10
 
const ORIGIN_CORE_INDIVIDUAL = 2
 
const ORIGIN_CORE_SITEWIDE = 1
 
const ORIGIN_USER_INDIVIDUAL = 4
 
const ORIGIN_USER_SITEWIDE = 3
 
const TYPE_COMBINED = 'combined'
 
const TYPE_SCRIPTS = 'scripts'
 
const TYPE_STYLES = 'styles'
 
- Protected Member Functions inherited from ResourceLoaderFileModule
 compileLessFile ( $fileName, ResourceLoaderContext $context)
 Compile a LESS file into CSS. More...
 
 getAllSkinStyleFiles ()
 Gets a list of file paths for all skin style files in the module, for all available skins. More...
 
 getFileHashes (ResourceLoaderContext $context)
 Helper method to gather file hashes for getDefinitionSummary. More...
 
 getLocalPath ( $path)
 
 getRemotePath ( $path)
 
 getScriptFiles (ResourceLoaderContext $context)
 Get a list of file paths for all scripts in this module, in order of proper execution. More...
 
 getSkinStyleFiles ( $skinName)
 Gets a list of file paths for all skin styles in the module used by the skin. More...
 
 readScriptFiles (array $scripts)
 Gets the contents of a list of JavaScript files. More...
 
 readStyleFile ( $path, $flip, $context)
 Reads 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 ResourceLoaderModule
 buildContent (ResourceLoaderContext $context)
 Bundle all resources attached to this module into an array. More...
 
 getDeprecationInformation ()
 Get JS representing deprecation information for the current module if available. More...
 
 getFileDependencies (ResourceLoaderContext $context)
 Get the files this module depends on indirectly for a given skin. More...
 
 getLessVars (ResourceLoaderContext $context)
 Get module-specific LESS variables, if any. More...
 
 getLogger ()
 
 getMessageBlob (ResourceLoaderContext $context)
 Get the hash of the message blob. More...
 
 saveFileDependencies (ResourceLoaderContext $context, $localFileRefs)
 Set the files this module depends on indirectly for a given skin. More...
 
 validateScriptFile ( $fileName, $contents)
 Validate a given script file; if valid returns the original source. More...
 
- Static Protected Member Functions inherited from ResourceLoaderFileModule
static collateFilePathListByOption (array $list, $option, $default)
 Collates file paths by option (where provided). More...
 
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 ResourceLoaderModule
static javaScriptParser ()
 
static safeFileHash ( $filePath)
 Compute a non-cryptographic string hash of a file's contents. More...
 
static safeFilemtime ( $filePath)
 Safe version of filemtime(), which doesn't throw a PHP warning if the file doesn't exist. More...
 
- Protected Attributes inherited from ResourceLoaderFileModule
bool $debugRaw = true
 Link to raw files in debug mode. More...
 
array $debugScripts = []
 List of paths to JavaScript files to include in debug mode. More...
 
array $dependencies = []
 List of modules this module depends on. More...
 
string $group
 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 $languageScripts = []
 List of JavaScript files to include when using a specific language. More...
 
string $localBasePath = ''
 Local base path, see __construct() More...
 
array $localFileRefs = []
 Place where readStyleFile() tracks file dependencies. More...
 
array $messages = []
 List of message keys used by this module. More...
 
array $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...
 
bool $raw = false
 Whether mw.loader.state() call should be omitted. More...
 
string $remoteBasePath = ''
 Remote base path, see __construct() More...
 
array $scripts = []
 List of paths to JavaScript files to always include. More...
 
array $skinScripts = []
 List of JavaScript files to include when using a specific skin. More...
 
array $skinStyles = []
 List of paths to CSS files to include when using specific skins. More...
 
string $skipFunction = null
 File name containing the body of the skip function. More...
 
array $styles = []
 List of paths to CSS files to always include. More...
 
 $targets = [ 'desktop' ]
 
array $templates = []
 Saves a list of the templates named by the modules. More...
 
- Protected Attributes inherited from ResourceLoaderModule
Config $config
 
 $contents = []
 
array bool $deprecated = false
 
 $fileDeps = []
 
LoggerInterface $logger
 
 $msgBlobs = []
 
 $name = null
 
 $origin = self::ORIGIN_CORE_SITEWIDE
 
 $targets = [ 'desktop' ]
 
 $versionHash = []
 

Detailed Description

Definition at line 11 of file CiteCSSFileModule.php.

Constructor & Destructor Documentation

◆ __construct()

CiteCSSFileModule::__construct (   $options = [],
  $localBasePath = null,
  $remoteBasePath = null 
)

Constructs a new module from an options array.

Parameters
array$optionsList of options; if not given or empty, an empty module will be constructed
string$localBasePathBase path to prepend to all local paths in $options. Defaults to $IP
string$remoteBasePathBase path to prepend to all remote paths in $options. Defaults to $wgResourceBasePath

Below is a description for the $options array:

Exceptions
InvalidArgumentException
Construction options:
[
// Base path to prepend to all local paths in $options. Defaults to $IP
'localBasePath' => [base path],
// Base path to prepend to all remote paths in $options. Defaults to $wgResourceBasePath
'remoteBasePath' => [base path],
// Equivalent of remoteBasePath, but relative to $wgExtensionAssetsPath
'remoteExtPath' => [base path],
// Equivalent of remoteBasePath, but relative to $wgStylePath
'remoteSkinPath' => [base path],
// Scripts to always include
'scripts' => [file path string or array of file path strings],
// Scripts to include in specific language contexts
'languageScripts' => [
[language code] => [file path string or array of file path strings],
],
// Scripts to include in specific skin contexts
'skinScripts' => [
[skin name] => [file path string or array of file path strings],
],
// Scripts to include in debug contexts
'debugScripts' => [file path string or array of file path strings],
// Modules which must be loaded before this module
'dependencies' => [module name string or array of module name strings],
'templates' => [
[template alias with file.ext] => [file path to a template file],
],
// Styles to always load
'styles' => [file path string or array of file path strings],
// Styles to include in specific skin contexts
'skinStyles' => [
[skin name] => [file path string or array of file path strings],
],
// Messages to always load
'messages' => [array of message key strings],
// Group which this module should be loaded together with
'group' => [group name string],
// 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.
'skipFunction' => [file path]
]

Reimplemented from ResourceLoaderFileModule.

Definition at line 12 of file CiteCSSFileModule.php.

References $lang, ResourceLoaderFileModule\$localBasePath, $options, ResourceLoaderFileModule\$remoteBasePath, $wgContLang, as, ResourceLoaderFileModule\getLocalPath(), and global.


The documentation for this class was generated from the following file:
strings
it sets a lot of them automatically from query strings
Definition: design.txt:93
file
We ve cleaned up the code here by removing clumps of infrequently used code and moving them off somewhere else It s much easier for someone working with this code to see what s _really_ going and make changes or fix bugs In we can take all the code that deals with the little used title reversing we can concentrate it all in an extension file
Definition: hooks.txt:93
key
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 etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling but I prefer the flexibility This should also do the output encoding The system allocates a global one in $wgOut Title Represents the title of an and does all the work of translating among various forms such as plain database key
Definition: design.txt:25
a
</source > ! result< div class="mw-highlight mw-content-ltr" dir="ltr">< pre >< span ></span >< span class="kd"> var</span >< span class="nx"> a</span >< span class="p"></span ></pre ></div > ! end ! test Multiline< source/> in lists !input *< source > a b</source > *foo< source > a b</source > ! html< ul >< li >< div class="mw-highlight mw-content-ltr" dir="ltr">< pre > a b</pre ></div ></li ></ul >< ul >< li > foo< div class="mw-highlight mw-content-ltr" dir="ltr">< pre > a b</pre ></div ></li ></ul > ! html tidy< ul >< li >< div class="mw-highlight mw-content-ltr" dir="ltr">< pre > a b</pre ></div ></li ></ul >< ul >< li > foo< div class="mw-highlight mw-content-ltr" dir="ltr">< pre > a b</pre ></div ></li ></ul > ! end ! test Custom attributes !input< source lang="javascript" id="foo" class="bar" dir="rtl" style="font-size: larger;"> var a
Definition: parserTests.txt:89
code
and how to run hooks for an and one after Each event has a preferably in CamelCase For ArticleDelete hook A clump of code and data that should be run when an event happens This can be either a function and a chunk of or an object and a method hook function The function part of a third party developers and administrators to define code that will be run at certain points in the mainline code
Definition: hooks.txt:23
message
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a message
Definition: hooks.txt:2114
string
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible true was required This is the default since MediaWiki *some string
Definition: hooks.txt:177
or
or
Definition: COPYING.txt:140
skin
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 skin(according to that user 's preference)
language
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or and a work based on the Program means either the Program or any derivative work under copyright a work containing the Program or a portion of either verbatim or with modifications and or translated into another language(Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying
of
globals txt Globals are evil The original MediaWiki code relied on globals for processing context far too often MediaWiki development since then has been a story of slowly moving context out of global variables and into objects Storing processing context in object member variables allows those objects to be reused in a much more flexible way Consider the elegance of
Definition: globals.txt:10
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
group
no text was provided for refs named< code > blankwithnoreference</code ></span ></li ></ol ></div > ! end ! test with< references/> in group ! wikitext Wikipedia rocks< ref > Proceeds of vol XXI</ref > Wikipedia rocks< ref group=note > Proceeds of vol XXI</ref >< references/>< references group=note/> ! html< p > Wikipedia rocks< sup id="cite_ref-1" class="reference">< a href="#cite_note-1"> &Wikipedia rocks< sup id="cite_ref-2" class="reference">< a href="#cite_note-2"> &</p >< div class="mw-references-wrap">< ol class="references">< li id="cite_note-1">< span class="mw-cite-backlink">< a href="#cite_ref-1"> ↑</a ></span >< span class="reference-text"> Proceeds of vol XXI</span ></li ></ol ></div >< div class="mw-references-wrap">< ol class="references">< li id="cite_note-2">< span class="mw-cite-backlink">< a href="#cite_ref-2"> ↑</a ></span >< span class="reference-text"> Proceeds of vol XXI</span ></li ></ol ></div > ! end ! test with< references/> in group
Definition: citeParserTests.txt:306
array
the array() calling protocol came about after MediaWiki 1.4rc1.