EasyBlogStylesheetMinifier
extends EasyBlogCSSmin
in package
Table of Contents
Constants
- CLASSCOLON = '___YUICSSMIN_PSEUDOCLASSCOLON___'
- COMMENT = '___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_'
- NL = '___YUICSSMIN_PRESERVED_NL___'
- QUERY_FRACTION = '___YUICSSMIN_QUERY_FRACTION___'
- TOKEN = '___YUICSSMIN_PRESERVED_TOKEN_'
Properties
- $comments : mixed
- $max_execution_time : mixed
- $memory_limit : mixed
- $pcre_backtrack_limit : mixed
- $pcre_recursion_limit : mixed
- $preserved_tokens : mixed
- $raise_php_limits : mixed
- $stylesheet : mixed
Methods
- __construct() : mixed
- compress() : string
- Minify a string of CSS
- run() : mixed
- set_max_execution_time() : mixed
- Sets the maximum execution time for this script
- set_memory_limit() : mixed
- Sets the memory limit for this script
- set_pcre_backtrack_limit() : mixed
- Sets the PCRE backtrack limit for this script
- set_pcre_recursion_limit() : mixed
- Sets the PCRE recursion limit for this script
- clamp_number() : mixed
- compress_hex_colors() : string
- Utility method to compress hex color values of the form #AABBCC to #ABC or short color name.
- do_raise_php_limits() : mixed
- Try to configure PHP to use at least the suggested minimum settings
- extract_data_urls() : string
- Utility method to replace all data urls with tokens before we start compressing, to avoid performance issues running some of the subsequent regexes against large strings chunks.
- hsl_to_hex() : mixed
- hue_to_rgb() : mixed
- index_of() : int
- PHP port of Javascript's "indexOf" function for strings only Author: Tubal Martin http://blog.margenn.com
- lowercase_common_functions() : mixed
- lowercase_common_functions_values() : mixed
- lowercase_directives() : mixed
- lowercase_properties() : mixed
- lowercase_pseudo_elements() : mixed
- lowercase_pseudo_first() : mixed
- minify() : string
- Does bulk of the minification
- normalize_int() : int
- Convert strings like "64M" or "30" to int values
- preserve_old_IE_specific_matrix_definition() : mixed
- replace_calc() : mixed
- replace_colon() : mixed
- replace_keyframe_zero() : mixed
- replace_string() : mixed
- rgb_to_hex() : mixed
- round_number() : mixed
- str_slice() : string
- PHP port of Javascript's "slice" function for strings only Author: Tubal Martin http://blog.margenn.com Tests: http://margenn.com/tubal/str_slice/
Constants
CLASSCOLON
public
mixed
CLASSCOLON
= '___YUICSSMIN_PSEUDOCLASSCOLON___'
COMMENT
public
mixed
COMMENT
= '___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_'
NL
public
mixed
NL
= '___YUICSSMIN_PRESERVED_NL___'
QUERY_FRACTION
public
mixed
QUERY_FRACTION
= '___YUICSSMIN_QUERY_FRACTION___'
TOKEN
public
mixed
TOKEN
= '___YUICSSMIN_PRESERVED_TOKEN_'
Properties
$comments
private
mixed
$comments
$max_execution_time
private
mixed
$max_execution_time
$memory_limit
private
mixed
$memory_limit
$pcre_backtrack_limit
private
mixed
$pcre_backtrack_limit
$pcre_recursion_limit
private
mixed
$pcre_recursion_limit
$preserved_tokens
private
mixed
$preserved_tokens
$raise_php_limits
private
mixed
$raise_php_limits
$stylesheet
private
mixed
$stylesheet
Methods
__construct()
public
__construct(mixed $stylesheet) : mixed
Parameters
- $stylesheet : mixed
compress()
Minify a string of CSS
public
compress([string $css = '' ][, int|bool $linebreak_pos = FALSE ]) : string
Parameters
- $css : string = ''
- $linebreak_pos : int|bool = FALSE
Return values
stringrun()
public
run(mixed $section[, mixed $options = array() ]) : mixed
Parameters
- $section : mixed
- $options : mixed = array()
set_max_execution_time()
Sets the maximum execution time for this script
public
set_max_execution_time(int|string $seconds) : mixed
Parameters
- $seconds : int|string
set_memory_limit()
Sets the memory limit for this script
public
set_memory_limit(int|string $limit) : mixed
Parameters
- $limit : int|string
set_pcre_backtrack_limit()
Sets the PCRE backtrack limit for this script
public
set_pcre_backtrack_limit(int $limit) : mixed
Parameters
- $limit : int
set_pcre_recursion_limit()
Sets the PCRE recursion limit for this script
public
set_pcre_recursion_limit(int $limit) : mixed
Parameters
- $limit : int
clamp_number()
private
clamp_number(mixed $n, mixed $min, mixed $max) : mixed
Parameters
- $n : mixed
- $min : mixed
- $max : mixed
compress_hex_colors()
Utility method to compress hex color values of the form #AABBCC to #ABC or short color name.
private
compress_hex_colors(string $css) : string
DOES NOT compress CSS ID selectors which match the above pattern (which would break things). e.g. #AddressForm { ... }
DOES NOT compress IE filters, which have hex color values (which would break things). e.g. filter: chroma(color="#FFFFFF");
DOES NOT compress invalid hex values. e.g. background-color: #aabbccdd
Parameters
- $css : string
Return values
stringdo_raise_php_limits()
Try to configure PHP to use at least the suggested minimum settings
private
do_raise_php_limits() : mixed
extract_data_urls()
Utility method to replace all data urls with tokens before we start compressing, to avoid performance issues running some of the subsequent regexes against large strings chunks.
private
extract_data_urls(string $css) : string
Parameters
- $css : string
Return values
stringhsl_to_hex()
private
hsl_to_hex(mixed $matches) : mixed
Parameters
- $matches : mixed
hue_to_rgb()
private
hue_to_rgb(mixed $v1, mixed $v2, mixed $vh) : mixed
Parameters
- $v1 : mixed
- $v2 : mixed
- $vh : mixed
index_of()
PHP port of Javascript's "indexOf" function for strings only Author: Tubal Martin http://blog.margenn.com
private
index_of(string $haystack, string $needle[, int $offset = 0 ]) : int
Parameters
- $haystack : string
- $needle : string
- $offset : int = 0
-
index (optional)
Return values
intlowercase_common_functions()
private
lowercase_common_functions(mixed $matches) : mixed
Parameters
- $matches : mixed
lowercase_common_functions_values()
private
lowercase_common_functions_values(mixed $matches) : mixed
Parameters
- $matches : mixed
lowercase_directives()
private
lowercase_directives(mixed $matches) : mixed
Parameters
- $matches : mixed
lowercase_properties()
private
lowercase_properties(mixed $matches) : mixed
Parameters
- $matches : mixed
lowercase_pseudo_elements()
private
lowercase_pseudo_elements(mixed $matches) : mixed
Parameters
- $matches : mixed
lowercase_pseudo_first()
private
lowercase_pseudo_first(mixed $matches) : mixed
Parameters
- $matches : mixed
minify()
Does bulk of the minification
private
minify(string $css, int|bool $linebreak_pos) : string
Parameters
- $css : string
- $linebreak_pos : int|bool
Return values
stringnormalize_int()
Convert strings like "64M" or "30" to int values
private
normalize_int(mixed $size) : int
Parameters
- $size : mixed
Return values
intpreserve_old_IE_specific_matrix_definition()
private
preserve_old_IE_specific_matrix_definition(mixed $matches) : mixed
Parameters
- $matches : mixed
replace_calc()
private
replace_calc(mixed $matches) : mixed
Parameters
- $matches : mixed
replace_colon()
private
replace_colon(mixed $matches) : mixed
Parameters
- $matches : mixed
replace_keyframe_zero()
private
replace_keyframe_zero(mixed $matches) : mixed
Parameters
- $matches : mixed
replace_string()
private
replace_string(mixed $matches) : mixed
Parameters
- $matches : mixed
rgb_to_hex()
private
rgb_to_hex(mixed $matches) : mixed
Parameters
- $matches : mixed
round_number()
private
round_number(mixed $n) : mixed
Parameters
- $n : mixed
str_slice()
PHP port of Javascript's "slice" function for strings only Author: Tubal Martin http://blog.margenn.com Tests: http://margenn.com/tubal/str_slice/
private
str_slice(string $str[, int $start = 0 ][, int|bool $end = FALSE ]) : string
Parameters
- $str : string
- $start : int = 0
-
index
- $end : int|bool = FALSE
-
index (optional)