[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/libs/ -> CSSMin.php (summary)

Minification of CSS stylesheets. Copyright 2010 Wikimedia Foundation

Author: Trevor Parscal <[email protected]>
Copyright: Copyright 2010 Wikimedia Foundation
License: http://www.apache.org/licenses/LICENSE-2.0
Version: 0.1.1 -- 2010-09-11
File Size: 363 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

CSSMin:: (7 methods):
  getLocalFileReferences()
  encodeImageAsDataURI()
  getMimeType()
  buildUrlValue()
  remap()
  remapOne()
  minify()


Class: CSSMin  - X-Ref

Transforms CSS data

This class provides minification, URL remapping, URL extracting, and data-URL embedding.
getLocalFileReferences( $source, $path = null )   X-Ref
Gets a list of local file paths which are referenced in a CSS style sheet

This function will always return an empty array if the second parameter is not given or null
for backwards-compatibility.

param: string $source CSS data to remap
param: string $path File path where the source was read from (optional)
return: array List of local file references

encodeImageAsDataURI( $file, $type = null,$sizeLimit = self::EMBED_SIZE_LIMIT)   X-Ref
Encode an image file as a base64 data URI.
If the image file has a suitable MIME type and size, encode it as a
base64 data URI. Return false if the image type is unfamiliar or exceeds
the size limit.

param: string $file Image file to encode.
param: string|null $type File's MIME type or null. If null, CSSMin will
param: int|bool $sizeLimit If the size of the target file is greater than
return: string|bool: Image contents encoded as a data URI or false.

getMimeType( $file )   X-Ref

param: $file string
return: bool|string

buildUrlValue( $url )   X-Ref
Build a CSS 'url()' value for the given URL, quoting parentheses (and other funny characters)
and escaping quotes as necessary.

See http://www.w3.org/TR/css-syntax-3/#consume-a-url-token

param: string $url URL to process
return: string 'url()' value, usually just `"url($url)"`, quoted/escaped if necessary

remap( $source, $local, $remote, $embedData = true )   X-Ref
Remaps CSS URL paths and automatically embeds data URIs for CSS rules
or url() values preceded by an / * @embed * / comment.

param: string $source CSS data to remap
param: string $local File path where the source was read from
param: string $remote URL path to the file
param: bool $embedData If false, never do any data URI embedding,
return: string Remapped CSS data

remapOne( $file, $query, $local, $remote, $embed )   X-Ref
No description

minify( $css )   X-Ref
Removes whitespace from CSS data

param: string $css CSS data to minify
return: string Minified CSS data



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1