MediaWiki  REL1_19
CSSMin Class Reference

List of all members.

Static Public Member Functions

static getLocalFileReferences ($source, $path=null)
 Gets a list of local file paths which are referenced in a CSS style sheet.
static minify ($css)
 Removes whitespace from CSS data.
static remap ($source, $local, $remote, $embedData=true)
 Remaps CSS URL paths and automatically embeds data URIs for URL rules preceded by an /* * / comment.

Public Attributes

const EMBED_SIZE_LIMIT = 24576
 Maximum file size to still qualify for in-line embedding as a data-URI.
const URL_REGEX = 'url\(\s*[\'"]?(?P<file>[^\?\)\'"]*)(?P<query>\??[^\)\'"]*)[\'"]?\s*\)'

Static Protected Member Functions

static getMimeType ($file)

Static Protected Attributes

static $mimeTypes

Detailed Description

Definition at line 28 of file CSSMin.php.


Member Function Documentation

static CSSMin::getLocalFileReferences ( source,
path = null 
) [static]

Gets a list of local file paths which are referenced in a CSS style sheet.

Parameters:
$sourcestring CSS data to remap
$pathstring File path where the source was read from (optional)
Returns:
array List of local file references

Definition at line 64 of file CSSMin.php.

References $file, $files, $matches, and $path.

Referenced by ResourceLoaderFileModule\readStyleFile().

Here is the caller graph for this function:

static CSSMin::getMimeType ( file) [static, protected]
Parameters:
$filestring
Returns:
bool|string

Definition at line 86 of file CSSMin.php.

References $ext, and $file.

Referenced by remap().

Here is the caller graph for this function:

static CSSMin::minify ( css) [static]

Removes whitespace from CSS data.

Parameters:
$cssstring CSS data to minify
Returns:
string Minified CSS data

Definition at line 217 of file CSSMin.php.

Referenced by ResourceLoader\filter().

Here is the caller graph for this function:

static CSSMin::remap ( source,
local,
remote,
embedData = true 
) [static]

Remaps CSS URL paths and automatically embeds data URIs for URL rules preceded by an /* * / comment.

Parameters:
$sourcestring CSS data to remap
$localstring File path where the source was read from
$remotestring URL path to the file
$embedDatabool If false, never do any data URI embedding, even if / * * / is found
Returns:
string Remapped CSS data

Definition at line 122 of file CSSMin.php.

References $file, $url, getMimeType(), and wfExpandUrl().

Referenced by ResourceLoaderWikiModule\getStyles(), and ResourceLoaderFileModule\readStyleFile().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

CSSMin::$mimeTypes [static, protected]
Initial value:
 array(
                'gif' => 'image/gif',
                'jpe' => 'image/jpeg',
                'jpeg' => 'image/jpeg',
                'jpg' => 'image/jpeg',
                'png' => 'image/png',
                'tif' => 'image/tiff',
                'tiff' => 'image/tiff',
                'xbm' => 'image/x-xbitmap',
        )

Definition at line 44 of file CSSMin.php.

const CSSMin::EMBED_SIZE_LIMIT = 24576

Maximum file size to still qualify for in-line embedding as a data-URI.

24,576 is used because Internet Explorer has a 32,768 byte limit for data URIs, which when base64 encoded will result in a 1/3 increase in size.

Definition at line 38 of file CSSMin.php.

const CSSMin::URL_REGEX = 'url\(\s*[\'"]?(?P<file>[^\?\)\'"]*)(?P<query>\??[^\)\'"]*)[\'"]?\s*\)'

Definition at line 39 of file CSSMin.php.


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