PHP 클래스 Minify_CSS_Compressor, minify

This is a heavy regex-based removal of whitespace, unnecessary comments and tokens, and some CSS value minimization, where practical. Many steps have been taken to avoid breaking comment-based hacks, including the ie5/mac filter (and its inversion), but expect tricky hacks involving comment tokens in 'content' value strings to break minimization badly. A test suite is available. Note: This replaces a lot of spaces with line breaks. It's rumored (https://github.com/yui/yuicompressor/blob/master/README.md#global-options) that some source control tools and old browsers don't like very long lines. Compressed files with shorter lines are also easier to diff. If this is unacceptable please use CSSmin instead.
사용 중단: Use CSSmin (tubalmartin/cssmin)
저자: Stephen Clay ([email protected])
저자: http://code.google.com/u/1stvamp/ (Issue 64 patch)
파일 보기 프로젝트 열기: mrclay/minify 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_inHack boolean Are we "in" a hack? I.e. are some browsers targetted until the next comment?
$_options array

공개 메소드들

메소드 설명
process ( string $css, array $options = [] ) : string Minify a CSS string

보호된 메소드들

메소드 설명
_commentCB ( array $m ) : string Process a comment and return a replacement
_fontFamilyCB ( array $m ) : string Process a font-family listing and return a replacement
_process ( string $css ) : string Minify a CSS string
_selectorsCB ( array $m ) : string Replace what looks like a set of selectors

비공개 메소드들

메소드 설명
__construct ( array $options ) Constructor

메소드 상세

_commentCB() 보호된 메소드

Process a comment and return a replacement
protected _commentCB ( array $m ) : string
$m array regex matches
리턴 string

_fontFamilyCB() 보호된 메소드

Process a font-family listing and return a replacement
protected _fontFamilyCB ( array $m ) : string
$m array regex matches
리턴 string

_process() 보호된 메소드

Minify a CSS string
protected _process ( string $css ) : string
$css string
리턴 string

_selectorsCB() 보호된 메소드

Replace what looks like a set of selectors
protected _selectorsCB ( array $m ) : string
$m array regex matches
리턴 string

process() 공개 정적인 메소드

Minify a CSS string
public static process ( string $css, array $options = [] ) : string
$css string
$options array (currently ignored)
리턴 string

프로퍼티 상세

$_inHack 보호되어 있는 프로퍼티

Are we "in" a hack? I.e. are some browsers targetted until the next comment?
protected bool $_inHack
리턴 boolean

$_options 보호되어 있는 프로퍼티

protected array $_options
리턴 array