PHP 클래스 Leafo\ScssPhp\Server

저자: Leaf Corcoran ([email protected])
파일 보기 프로젝트 열기: leafo/scssphp 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $dir, string $cacheDir = null, Compiler | null $scss = null ) Constructor
checkedCachedCompile ( string $in, string $out, boolean $force = false ) : string Based on explicit input/output files does a full change check on cache before compiling.
checkedCompile ( string $in, string $out ) : boolean Check if file need compiling
compileFile ( string $in, string $out = null ) : string | boolean Compile .scss file
serve ( string $salt = '' ) Compile requested scss and serve css. Outputs HTTP response.
serveFrom ( string $path ) Helper method to serve compiled scss
showErrorsAsCSS ( boolean $show = true ) Render errors as a pseudo-element within valid CSS, displaying the errors on any page that includes this CSS.

보호된 메소드들

메소드 설명
cacheName ( $fname ) : string Get path to cached .css file
compile ( string $in, string $out ) : array Compile .scss file
createErrorCSS ( Exception $error ) : string Format error as a pseudo-element in CSS
findInput ( ) : string Get path to requested .scss file
getIfModifiedSinceHeader ( ) : string | null Get If-Modified-Since header from client request
getIfNoneMatchHeader ( ) : string | null Get If-None-Match header from client request
inputName ( ) : string | null Get name of requested .scss file
join ( string $left, string $right ) : string Join path components
metadataName ( $out ) : string Get path to meta data
needsCompile ( string $out, string &$etag ) : boolean Determine whether .scss file needs to be re-compiled.

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( string $dir, string $cacheDir = null, Compiler | null $scss = null )
$dir string Root directory to .scss files
$cacheDir string Cache directory
$scss Compiler | null SCSS compiler instance

cacheName() 보호된 메소드

Get path to cached .css file
protected cacheName ( $fname ) : string
리턴 string

checkedCachedCompile() 공개 메소드

Based on explicit input/output files does a full change check on cache before compiling.
public checkedCachedCompile ( string $in, string $out, boolean $force = false ) : string
$in string
$out string
$force boolean
리턴 string Compiled CSS results

checkedCompile() 공개 메소드

Check if file need compiling
public checkedCompile ( string $in, string $out ) : boolean
$in string Input file (.scss)
$out string Output file (.css)
리턴 boolean

compile() 보호된 메소드

Compile .scss file
protected compile ( string $in, string $out ) : array
$in string Input path (.scss)
$out string Output path (.css)
리턴 array

compileFile() 공개 메소드

Compile .scss file
public compileFile ( string $in, string $out = null ) : string | boolean
$in string Input file (.scss)
$out string Output file (.css) optional
리턴 string | boolean

createErrorCSS() 보호된 메소드

Format error as a pseudo-element in CSS
protected createErrorCSS ( Exception $error ) : string
$error Exception
리턴 string

findInput() 보호된 메소드

Get path to requested .scss file
protected findInput ( ) : string
리턴 string

getIfModifiedSinceHeader() 보호된 메소드

Get If-Modified-Since header from client request
protected getIfModifiedSinceHeader ( ) : string | null
리턴 string | null

getIfNoneMatchHeader() 보호된 메소드

Get If-None-Match header from client request
protected getIfNoneMatchHeader ( ) : string | null
리턴 string | null

inputName() 보호된 메소드

Get name of requested .scss file
protected inputName ( ) : string | null
리턴 string | null

join() 보호된 메소드

Join path components
protected join ( string $left, string $right ) : string
$left string Path component, left of the directory separator
$right string Path component, right of the directory separator
리턴 string

metadataName() 보호된 메소드

Get path to meta data
protected metadataName ( $out ) : string
리턴 string

needsCompile() 보호된 메소드

Determine whether .scss file needs to be re-compiled.
protected needsCompile ( string $out, string &$etag ) : boolean
$out string Output path
$etag string ETag
리턴 boolean True if compile required.

serve() 공개 메소드

Compile requested scss and serve css. Outputs HTTP response.
public serve ( string $salt = '' )
$salt string Prefix a string to the filename for creating the cache name hash

serveFrom() 공개 정적인 메소드

Helper method to serve compiled scss
public static serveFrom ( string $path )
$path string Root path

showErrorsAsCSS() 공개 메소드

Render errors as a pseudo-element within valid CSS, displaying the errors on any page that includes this CSS.
public showErrorsAsCSS ( boolean $show = true )
$show boolean