MediaWiki REL1_31
ResourceLoaderLessModule.php
Go to the documentation of this file.
1<?php
23namespace Vector;
24
25use CSSMin;
30
46 $lessVars = parent::getLessVars( $context );
47 try {
48 $config = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 'vector' );
49 $printLogo = $config->get( 'VectorPrintLogo' );
50 } catch ( ConfigException $e ) {
51 // Config is not available when running in the context of the MediaWiki installer. (T183640)
52 $printLogo = false;
53 }
54 if ( $printLogo ) {
55 $lessVars[ 'printLogo' ] = true;
56 $lessVars[ 'printLogoUrl' ] = CSSMin::buildUrlValue( $printLogo['url'] );
57 $lessVars[ 'printLogoWidth' ] = intval( $printLogo['width'] );
58 $lessVars[ 'printLogoHeight' ] = intval( $printLogo['height'] );
59 } else {
60 $lessVars[ 'printLogo' ] = false;
61 }
62 return $lessVars;
63 }
64}
Transforms CSS data.
Definition CSSMin.php:30
Exceptions for config failures.
MediaWikiServices is the service locator for the application scope of MediaWiki.
Object passed around to modules which contains information about the state of a specific loader reque...
ResourceLoader module based on local JavaScript/CSS files.
ResourceLoader module for print styles.
getLessVars(ResourceLoaderContext $context)
Get language-specific LESS variables for this module.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
Definition hooks.txt:2811
returning false will NOT prevent logging $e
Definition hooks.txt:2176