|
static | extractBasePaths ( $options=[], $localBasePath=null, $remoteBasePath=null) |
| Extract a pair of local and remote base paths from module definition information.
|
|
static | expandRelativePaths (array $filePaths) |
| Expand directories relative to $IP.
|
|
static | getRelativePaths (array $filePaths) |
| Make file paths relative to MediaWiki directory.
|
|
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' |
|
| compileLessFile ( $fileName, ResourceLoaderContext $context) |
| Compile a LESS file into CSS.
|
|
| getAllSkinStyleFiles () |
| Gets a list of file paths for all skin style files in the module, for all available skins.
|
|
| getLocalPath ( $path) |
|
| getRemotePath ( $path) |
|
| getSkinStyleFiles ( $skinName) |
| Gets a list of file paths for all skin styles in the module used by the skin.
|
|
| readStyleFile ( $path, $flip, $context) |
| Reads a style file.
|
|
| stripBom ( $input) |
| Takes an input string and removes the UTF-8 BOM character if present.
|
|
| buildContent (ResourceLoaderContext $context) |
| Bundle all resources attached to this module into an array.
|
|
| getFileDependencies (ResourceLoaderContext $context) |
| Get the files this module depends on indirectly for a given skin.
|
|
| getLessVars (ResourceLoaderContext $context) |
| Get module-specific LESS variables, if any.
|
|
| getLogger () |
|
| getMessageBlob (ResourceLoaderContext $context) |
| Get the hash of the message blob.
|
|
| getPreloadLinks (ResourceLoaderContext $context) |
| Get a list of resources that web browsers may preload.
|
|
| saveFileDependencies (ResourceLoaderContext $context, $localFileRefs) |
| Set the files this module depends on indirectly for a given skin.
|
|
| validateScriptFile ( $fileName, $contents) |
| Validate a given script file; if valid returns the original source.
|
|
static | collateFilePathListByOption (array $list, $option, $default) |
| Collates file paths by option (where provided).
|
|
static | tryForKey (array $list, $key, $fallback=null) |
| Get a list of element that match a key, optionally using a fallback key.
|
|
static | javaScriptParser () |
|
static | safeFileHash ( $filePath) |
| Compute a non-cryptographic string hash of a file's contents.
|
|
static | safeFilemtime ( $filePath) |
| Safe version of filemtime(), which doesn't throw a PHP warning if the file doesn't exist.
|
|
bool | $debugRaw = true |
| Link to raw files in debug mode.
|
|
array | $debugScripts = [] |
| List of paths to JavaScript files to include in debug mode.
|
|
array | $dependencies = [] |
| List of modules this module depends on.
|
|
string | $group |
| Name of group to load this module in.
|
|
bool | $hasGeneratedStyles = false |
| Whether getStyleURLsForDebug should return raw file paths, or return load.php urls.
|
|
array | $languageScripts = [] |
| List of JavaScript files to include when using a specific language.
|
|
string | $localBasePath = '' |
| Local base path, see __construct()
|
|
array | $localFileRefs = [] |
| Place where readStyleFile() tracks file dependencies.
|
|
array | $messages = [] |
| List of message keys used by this module.
|
|
array | $missingLocalFileRefs = [] |
| Place where readStyleFile() tracks file dependencies for non-existent files.
|
|
bool | $noflip = false |
| Whether CSSJanus flipping should be skipped for this module.
|
|
bool | $raw = false |
| Whether mw.loader.state() call should be omitted.
|
|
string | $remoteBasePath = '' |
| Remote base path, see __construct()
|
|
array | $scripts = [] |
| List of paths to JavaScript files to always include.
|
|
array | $skinScripts = [] |
| List of JavaScript files to include when using a specific skin.
|
|
array | $skinStyles = [] |
| List of paths to CSS files to include when using specific skins.
|
|
string | $skipFunction = null |
| File name containing the body of the skip function.
|
|
array | $styles = [] |
| List of paths to CSS files to always include.
|
|
| $targets = [ 'desktop' ] |
|
array | $templates = [] |
| Saves a list of the templates named by the modules.
|
|
Config | $config |
|
| $contents = [] |
|
array bool | $deprecated = false |
|
| $fileDeps = [] |
|
LoggerInterface | $logger |
|
| $msgBlobs = [] |
|
| $name = null |
|
| $origin = self::ORIGIN_CORE_SITEWIDE |
|
| $targets = [ 'desktop' ] |
|
| $versionHash = [] |
|
ResourceLoaderFileModule for adding the content language Cite CSS.
- Note
- 2011-2018 VisualEditor Team's Cite sub-team and others; see AUTHORS.txt
-
MIT
Definition at line 9 of file CiteCSSFileModule.php.
CiteCSSFileModule::__construct |
( |
| $options = [], |
|
|
| $localBasePath = null, |
|
|
| $remoteBasePath = null ) |
Constructs a new module from an options array.
- Parameters
-
array | $options | List of options; if not given or empty, an empty module will be constructed |
string | null | $localBasePath | Base path to prepend to all local paths in $options. Defaults to $IP |
string | null | $remoteBasePath | Base path to prepend to all remote paths in $options. Defaults to $wgResourceBasePath |
Below is a description for the $options array:
- Exceptions
-
- Construction options:
[
'localBasePath' => [base path],
'remoteBasePath' => [base path],
'remoteExtPath' => [base path],
'remoteSkinPath' => [base path],
'scripts' => [file path
string or
array of file path strings],
'languageScripts' => [
],
'skinScripts' => [
[skin
name] => [file path
string or
array of file path strings],
],
'debugScripts' => [file path
string or
array of file path strings],
'dependencies' => [module
name string or
array of module
name strings],
'templates' => [
[
template alias with file.ext] => [file path to a
template file],
],
'styles' => [file path
string or
array of file path strings],
'skinStyles' => [
[skin
name] => [file path
string or
array of file path strings],
],
'messages' => [
array of message
key strings],
'skipFunction' => [file path]
]
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
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
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
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 use $formDescriptor instead 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 set this to the key of the message First element is the message key
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 local administrators to define code that will be run at certain points in the mainline code
> value, names are case insensitive). Two headers get special handling:If-Modified-Since(value must be a valid HTTP date) and Range(must be of the form "bytes=(\d*-\d*)") will be honored when streaming the file. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page. Return false to stop further processing of the tag $reader:XMLReader object & $pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUnknownUser':When a user doesn 't exist locally, this hook is called to give extensions an opportunity to auto-create it. If the auto-creation is successful, return false. $name:User name 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. & $fullInterwikiPrefix:Interwiki prefix, may contain colons. & $pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. & $importSources:The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. '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 '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 '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 '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. '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 IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() '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 Sanitizer::validateEmail(), 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. 'LanguageGetMagic':DEPRECATED since 1.16! 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) '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 '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:Array with elements of the form "language:title" in the order that they will be output. & $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. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED since 1.28! Use HtmlPageLinkRendererBegin instead. 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) name
Using a hook running we can avoid having all this option specific stuff in our mainline code Using the function 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
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
Reimplemented from ResourceLoaderFileModule.
Definition at line 11 of file CiteCSSFileModule.php.
References $lang, ResourceLoaderFileModule\$localBasePath, $options, ResourceLoaderFileModule\$remoteBasePath, $wgContLang, and ResourceLoaderFileModule\getLocalPath().