Spork Code Libraries

Stylus

Wrapper class for Stylus CSS preprocessor (http://learnboost.github.io/stylus/)

Looks for stylus executable on system path. You can specify a full path for the compiler.

If the class is created as a Service Manager factory it will look for configuration options under 'css-stylus'.

Extends

Properties

$arguments

$arguments : array

Option arguments to be passed to compiler

Type

array
Inherited from
\Spork\CSS\AbstractCompiler

$cache

$cache : \Zend\Cache\Storage\Adapter\AbstractAdapter

Type

\Zend\Cache\Storage\Adapter\AbstractAdapter
Inherited from
\Spork\CSS\AbstractCompiler

$compiler

$compiler : string

Full path to compiler executable

Type

string

$compress

$compress : boolean

Type

boolean
Inherited from
\Spork\CSS\AbstractCompiler

$configurationKey

$configurationKey : string

Key name for options in configuration file.

Add definition in child class to enable service configuration

Type

string

$extensions

$extensions : array

List of file extension of source files

Type

array

$includes

$includes : array

List of inlude paths for compiler to use

Type

array
Inherited from
\Spork\CSS\AbstractCompiler

Methods

compile()

compile(string  $source, string|null  $destination = null, array|string|null  $include = null) : string

Compile to file. If destination is not specified return CSS.

Parameters

string $source
string|null $destination
array|string|null $include

Include path(s) to use

Throws

\Exception

on compilation error

Returns

string —

Compiled CSS

Inherited from
\Spork\CSS\AbstractCompiler

getArguments()

getArguments() : array

Get compiler arguments

Returns

array
Inherited from
\Spork\CSS\AbstractCompiler

setArguments()

setArguments(array  $arguments) 

Set compiler arguments

Parameters

array $arguments
Inherited from
\Spork\CSS\AbstractCompiler

getCache()

getCache() : \Zend\Cache\Storage\Adapter\AbstractAdapter

Get cache

Returns

\Zend\Cache\Storage\Adapter\AbstractAdapter
Inherited from
\Spork\CSS\AbstractCompiler

setCache()

setCache(string|array|\Zend\Cache\Storage\Adapter\AbstractAdapter  $cache) 

Set cache for CSS Preprocessor

Cache parameter can be an instance of \Zend\Cache\Storage\Adapter\AbstractAdapter, the name of a cache adapter class or an array of options to be passed to AbstractAdapter::factory()

Parameters

string|array|\Zend\Cache\Storage\Adapter\AbstractAdapter $cache

Throws

\Exception

on invalid cache

Inherited from
\Spork\CSS\AbstractCompiler

getCompiler()

getCompiler() : string

Get compiler path

Returns

string
Inherited from
\Spork\CSS\AbstractCompiler

setCompiler()

setCompiler(string  $compiler) 

Set compiler path

Parameters

string $compiler

Compiler Path

Inherited from
\Spork\CSS\AbstractCompiler

getCompress()

getCompress() : boolean

Get compress flag

Returns

boolean
Inherited from
\Spork\CSS\AbstractCompiler

setCompress()

setCompress(boolean  $flag) 

Set compress flag

Parameters

boolean $flag
Inherited from
\Spork\CSS\AbstractCompiler

getExtensions()

getExtensions() : string

Get source file extension

Returns

string
Inherited from
\Spork\CSS\AbstractCompiler

setExtensions()

setExtensions(array  $extensions) 

Set source file extensions

Parameters

array $extensions
Inherited from
\Spork\CSS\AbstractCompiler

addInclude()

addInclude(  $include) 

Parameters

$include
Inherited from
\Spork\CSS\AbstractCompiler

getIncludes()

getIncludes() : string|boolean|NULL

Get compiler include path

Returns

string|boolean|NULL
Inherited from
\Spork\CSS\AbstractCompiler

setIncludes()

setIncludes(array  $includes) 

Set compiler include path

If set to true the source path is used.

Parameters

array $includes
Inherited from
\Spork\CSS\AbstractCompiler

createService()

createService(\Zend\ServiceManager\ServiceLocatorInterface  $services) : \Spork\Style\AbstractStyle

Create Service

Parameters

\Zend\ServiceManager\ServiceLocatorInterface $services

Returns

\Spork\Style\AbstractStyle
Inherited from
\Spork\CSS\AbstractCompiler
See also

getCommandArguments()

getCommandArguments(  $source,   $destination, array  $includes) : string

Return command line arguments to compile source file or path. If destination is not specified command should print code to standard out.

Parameters

$source
$destination
array $includes

Returns

string

configure()

configure(array  $options) 

configure

Parameters

array $options
Inherited from
\Spork\CSS\AbstractCompiler

getOptions()

getOptions(\Zend\ServiceManager\ServiceLocatorInterface  $services, string  $key) : array

Get options from application configuration

Parameters

\Zend\ServiceManager\ServiceLocatorInterface $services
string $key

Returns

array
Inherited from
\Spork\CSS\AbstractCompiler