\scss_server

SCSS server

Summary

Methods
Properties
Constants
serve()
__construct()
serveFrom()
No public properties found
No constants found
join()
inputName()
findInput()
cacheName()
importsCacheName()
needsCompile()
compile()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

serve()

serve()

Compile requested scss and serve css. Outputs HTTP response.

__construct()

__construct(string $dir, string $cacheDir, \scssc|null $scss)

Constructor

Parameters

string $dir

Root directory to .scss files

string $cacheDir

Cache directory

\scssc|null $scss

SCSS compiler instance

serveFrom()

serveFrom(string $path)

Helper method to serve compiled scss

Parameters

string $path

Root path

join()

join(string $left, string $right) : string

Join path components

Parameters

string $left

Path component, left of the directory separator

string $right

Path component, right of the directory separator

Returns

string

inputName()

inputName() : string|null

Get name of requested .scss file

Returns

string|null

findInput()

findInput() : string

Get path to requested .scss file

Returns

string

cacheName()

cacheName( $fname) : string

Get path to cached .css file

Parameters

$fname

Returns

string

importsCacheName()

importsCacheName( $out) : string

Get path to cached imports

Parameters

$out

Returns

string

needsCompile()

needsCompile(string $in, string $out) : boolean

Determine whether .scss file needs to be re-compiled.

Parameters

string $in

Input path

string $out

Output path

Returns

boolean —

True if compile required.

compile()

compile(string $in, string $out) : string

Compile .scss file

Parameters

string $in

Input path (.scss)

string $out

Output path (.css)

Returns

string