PHP 클래스 MatthiasMullie\Minify\CSS

Please report bugs on https://github.com/matthiasmullie/minify/issues
저자: Matthias Mullie ([email protected])
저자: Tijs Verkoyen ([email protected])
상속: extends Minify
파일 보기 프로젝트 열기: matthiasmullie/minify 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$importExtensions string[]
$maxImportSize integer

공개 메소드들

메소드 설명
execute ( string[optional] $path = null, string[] $parents = [] ) : string Minify the data.
setImportExtensions ( array $extensions ) Set the type of extensions to be imported into the CSS (to save network connections).
setMaxImportSize ( integer $size ) Set the maximum size if files to be imported.

보호된 메소드들

메소드 설명
canImportBySize ( string $path ) : boolean Check if file is small enough to be imported.
combineImports ( string $source, string $content, string[] $parents ) : string Combine CSS from import statements.
importFiles ( string $source, string $content ) : string Import files into the CSS, base64-ized.
move ( MatthiasMullie\PathConverter\Converter $converter, string $content ) : string Moving a css file should update all relative urls.
moveImportsToTop ( string $content ) : string Move any import statements to the top.
shortenFontWeights ( string $content ) : string Shorten CSS font weights.
shortenHex ( string $content ) : string Shorthand hex color codes.
shortenZeroes ( string $content ) : string Shorthand 0 values to plain 0, instead of e.g. -0em.
stripComments ( ) Strip comments from source code.
stripEmptyTags ( string $content ) : string Strip comments from source code.
stripWhitespace ( string $content ) : string Strip whitespace.

메소드 상세

canImportBySize() 보호된 메소드

Check if file is small enough to be imported.
protected canImportBySize ( string $path ) : boolean
$path string The path to the file
리턴 boolean

combineImports() 보호된 메소드

Combine CSS from import statements.
protected combineImports ( string $source, string $content, string[] $parents ) : string
$source string The file to combine imports for
$content string The CSS content to combine imports for
$parents string[] Parent paths, for circular reference checks
리턴 string

execute() 공개 메소드

Perform CSS optimizations.
public execute ( string[optional] $path = null, string[] $parents = [] ) : string
$path string[optional]
$parents string[] Parent paths, for circular reference checks
리턴 string The minified data

importFiles() 보호된 메소드

Import files into the CSS, base64-ized.
protected importFiles ( string $source, string $content ) : string
$source string The file to import files for
$content string The CSS content to import files for
리턴 string

move() 보호된 메소드

Relative references (e.g. ../images/image.gif) in a certain css file, will have to be updated when a file is being saved at another location (e.g. ../../images/image.gif, if the new CSS file is 1 folder deeper).
protected move ( MatthiasMullie\PathConverter\Converter $converter, string $content ) : string
$converter MatthiasMullie\PathConverter\Converter Relative path converter
$content string The CSS content to update relative urls for
리턴 string

moveImportsToTop() 보호된 메소드

Move any import statements to the top.
protected moveImportsToTop ( string $content ) : string
$content string Nearly finished CSS content
리턴 string

setImportExtensions() 공개 메소드

Keys of the array should be the file extensions & respective values should be the data type.
public setImportExtensions ( array $extensions )
$extensions array Array of file extensions

setMaxImportSize() 공개 메소드

Files larger than this size (in kB) will not be imported into the CSS. Importing files into the CSS as data-uri will save you some connections, but we should only import relatively small decorative images so that our CSS file doesn't get too bulky.
public setMaxImportSize ( integer $size )
$size integer Size in kB

shortenFontWeights() 보호된 메소드

Shorten CSS font weights.
protected shortenFontWeights ( string $content ) : string
$content string The CSS content to shorten the font weights for
리턴 string

shortenHex() 보호된 메소드

#FF0000 -> #F00.
protected shortenHex ( string $content ) : string
$content string The CSS content to shorten the hex color codes for
리턴 string

shortenZeroes() 보호된 메소드

Shorthand 0 values to plain 0, instead of e.g. -0em.
protected shortenZeroes ( string $content ) : string
$content string The CSS content to shorten the zero values for
리턴 string

stripComments() 보호된 메소드

Strip comments from source code.
protected stripComments ( )

stripEmptyTags() 보호된 메소드

Strip comments from source code.
protected stripEmptyTags ( string $content ) : string
$content string
리턴 string

stripWhitespace() 보호된 메소드

Strip whitespace.
protected stripWhitespace ( string $content ) : string
$content string The CSS content to strip the whitespace for
리턴 string

프로퍼티 상세

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

protected string[] $importExtensions
리턴 string[]

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

protected int $maxImportSize
리턴 integer