PHP 클래스 Minify_Lines, minify

저자: Stephen Clay ([email protected])
저자: Adam Pedersen (Issue 55 fix)
파일 보기 프로젝트 열기: mrclay/minify

공개 메소드들

메소드 설명
minify ( string $content, array $options = [] ) : string Add line numbers in C-style comments

비공개 메소드들

메소드 설명
_addNote ( string $line, string $note, boolean $inComment, integer $padTo ) : string Prepend a comment (or note) to the given line
_eolInComment ( string $line, boolean $inComment ) : boolean Is the parser within a C-style comment at the end of this line?
_find ( string $str, string $token ) : boolean Find a token trying to avoid false positives

메소드 상세

minify() 공개 정적인 메소드

This uses a very basic parser easily fooled by comment tokens inside strings or regexes, but, otherwise, generally clean code will not be mangled. URI rewriting can also be performed.
public static minify ( string $content, array $options = [] ) : string
$content string
$options array available options: 'id': (optional) string to identify file. E.g. file name/path 'currentDir': (default null) if given, this is assumed to be the directory of the current CSS file. Using this, minify will rewrite all relative URIs in import/url declarations to correctly point to the desired files, and prepend a comment with debugging information about this process.
리턴 string