PHP Класс titanscss_server

Автор: Leaf Corcoran ([email protected])
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( string $dir, string $cacheDir = null, scssc | null $scss = null ) Constructor
serve ( string $salt = '' ) Compile requested scss and serve css. Outputs HTTP response.
serveFrom ( string $path ) Helper method to serve compiled scss

Защищенные методы

Метод Описание
cacheName ( $fname ) : string Get path to cached .css file
compile ( string $in, string $out ) : string Compile .scss file
findInput ( ) : string Get path to requested .scss file
importsCacheName ( $out ) : string Get path to cached imports
inputName ( ) : string | null Get name of requested .scss file
join ( string $left, string $right ) : string Join path components
needsCompile ( string $in, string $out ) : boolean Determine whether .scss file needs to be re-compiled.

Описание методов

__construct() публичный Метод

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

cacheName() защищенный Метод

Get path to cached .css file
protected cacheName ( $fname ) : string
Результат string

compile() защищенный Метод

Compile .scss file
protected compile ( string $in, string $out ) : string
$in string Input path (.scss)
$out string Output path (.css)
Результат string

findInput() защищенный Метод

Get path to requested .scss file
protected findInput ( ) : string
Результат string

importsCacheName() защищенный Метод

Get path to cached imports
protected importsCacheName ( $out ) : string
Результат string

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

needsCompile() защищенный Метод

Determine whether .scss file needs to be re-compiled.
protected needsCompile ( string $in, string $out ) : boolean
$in string Input path
$out string Output path
Результат 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