MediaWiki  1.23.13
ResourceLoaderLESSFunctions.php
Go to the documentation of this file.
1 <?php
38  public static function embeddable( $frame, $less ) {
39  $base = pathinfo( $less->parser->sourceName, PATHINFO_DIRNAME );
40  $url = trim( $less->compileValue( $frame ), '"\'' );
41  $file = realpath( $base . '/' . $url );
42  return $less->toBool( $file
43  && strpos( $url, '//' ) === false
44  && filesize( $file ) < CSSMin::EMBED_SIZE_LIMIT
45  && CSSMin::getMimeType( $file ) !== false );
46  }
47 
58  public static function embed( $frame, $less ) {
59  $base = pathinfo( $less->parser->sourceName, PATHINFO_DIRNAME );
60  $url = trim( $less->compileValue( $frame ), '"\'' );
61  $file = realpath( $base . '/' . $url );
62 
64  $less->addParsedFile( $file );
65  return 'url(' . $data . ')';
66  }
67 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
ResourceLoaderLESSFunctions\embeddable
static embeddable( $frame, $less)
Check if an image file reference is suitable for embedding.
Definition: ResourceLoaderLESSFunctions.php:38
CSSMin\encodeImageAsDataURI
static encodeImageAsDataURI( $file, $type=null, $sizeLimit=self::EMBED_SIZE_LIMIT)
Encode an image file as a base64 data URI.
Definition: CSSMin.php:115
ResourceLoaderLESSFunctions
Definition: ResourceLoaderLESSFunctions.php:23
$file
if(PHP_SAPI !='cli') $file
Definition: UtfNormalTest2.php:30
ResourceLoaderLESSFunctions\embed
static embed( $frame, $less)
Convert an image URI to a base64-encoded data URI.
Definition: ResourceLoaderLESSFunctions.php:58
CSSMin\getMimeType
static getMimeType( $file)
Definition: CSSMin.php:133
CSSMin\EMBED_SIZE_LIMIT
const EMBED_SIZE_LIMIT
Maximum file size to still qualify for in-line embedding as a data-URI.
Definition: CSSMin.php:40