PHP Class Tollwerk\Squeezr\Css

Since: 1.0b
Author: Joschi Kuphal ([email protected])
Inheritance: extends Tollwerk\Squeezr
Afficher le fichier Open project: jkphl/squeezr Class Usage Examples

Protected Properties

Свойство Type Description
$_absoluteCacheCssDir string Parent directory of cached CSS file (absolute path)
$_absoluteCacheCssPath string Cached CSS file (absolute path)
$_absoluteCachePathBase string Base path for all cache files
$_absoluteCachePhpPath string Cached CSS file (absolute path)
$_absoluteCssPath string Requested CSS file (absolute path)
$_blocks array CSS Blocks
$_breakpointCatalog array Media Query condition catalog
$_breakpointIndex array Media Query condition index
$_breakpointTypes array Breakpoint types
$_importPatterns array Import at-rule patterns
$_lines array Line lengths
$_minifier Tollwerk\Squeezr\Css\Minifier Minification provider
$_relativeCssPath string Requested CSS file (relative path to document root)

Méthodes publiques

Méthode Description
instance ( string $css ) : Css Instanciate a CSS proxy
send ( boolean $cache = true ) : void Parse, squeeze and send the CSS file to the client

Méthodes protégées

Méthode Description
__construct ( string $css ) Constructor
_breakpointIndex ( integer $type, array $condition ) : integer Determine / create and return a breakpoint index entry
_breakpoints ( string $mediaQuery ) : array | null Extract the relevant breakpoints out of a @media query
_compileCacheClassCode ( ) : string Compile a PHP cache class representing the loaded CSS stylesheet
_consumeDeclarationBlock ( string $css, integer $peek, integer $offset, integer &$declarationBlockStart ) : string Detect and consume a declaration block within the given CSS text
_minify ( string $css ) : string Minifiy a CSS block (in case a minification provider has been registered)
_parse ( ) Parse and analyze the requested CSS file
_peekToLine ( integer $peek ) : integer Find the line number corresponding with a peek position within the CSS file
_registerBlock ( string &$block, array $breakpoints = null ) Register block data

Method Details

__construct() protected méthode

Constructor
protected __construct ( string $css )
$css string Requested CSS file (relative to document root)

_breakpointIndex() protected méthode

Determine / create and return a breakpoint index entry
protected _breakpointIndex ( integer $type, array $condition ) : integer
$type integer Breakpoint type
$condition array Condition values
Résultat integer Breakpoint index

_breakpoints() protected méthode

Extract the relevant breakpoints out of a @media query
protected _breakpoints ( string $mediaQuery ) : array | null
$mediaQuery string @media query
Résultat array | null Breakpoint alternatives

_compileCacheClassCode() protected méthode

Compile a PHP cache class representing the loaded CSS stylesheet
protected _compileCacheClassCode ( ) : string
Résultat string PHP class code

_consumeDeclarationBlock() protected méthode

Detect and consume a declaration block within the given CSS text
protected _consumeDeclarationBlock ( string $css, integer $peek, integer $offset, integer &$declarationBlockStart ) : string
$css string CSS text
$peek integer Current peek (for line number detection in case of an error)
$offset integer Optional: Offset position
$declarationBlockStart integer Set by reference: Declaration block start position within the CSS text
Résultat string Declaration block (starting at the beginning of the CSS text)

_minify() protected méthode

Minifiy a CSS block (in case a minification provider has been registered)
protected _minify ( string $css ) : string
$css string CSS block
Résultat string Minified CSS block

_parse() protected méthode

Parse and analyze the requested CSS file
protected _parse ( )

_peekToLine() protected méthode

Find the line number corresponding with a peek position within the CSS file
protected _peekToLine ( integer $peek ) : integer
$peek integer Peek position
Résultat integer Line number

_registerBlock() protected méthode

Register block data
protected _registerBlock ( string &$block, array $breakpoints = null )
$block string Block data
$breakpoints array Breakpoints

instance() public static méthode

Instanciate a CSS proxy
public static instance ( string $css ) : Css
$css string CSS file
Résultat Css Instance reference

send() public méthode

Parse, squeeze and send the CSS file to the client
public send ( boolean $cache = true ) : void
$cache boolean Cache a copy of the parsed CSS stylesheet
Résultat void

Property Details

$_absoluteCacheCssDir protected_oe property

Parent directory of cached CSS file (absolute path)
protected string $_absoluteCacheCssDir
Résultat string

$_absoluteCacheCssPath protected_oe property

Cached CSS file (absolute path)
protected string $_absoluteCacheCssPath
Résultat string

$_absoluteCachePathBase protected_oe property

Base path for all cache files
protected string $_absoluteCachePathBase
Résultat string

$_absoluteCachePhpPath protected_oe property

Cached CSS file (absolute path)
protected string $_absoluteCachePhpPath
Résultat string

$_absoluteCssPath protected_oe property

Requested CSS file (absolute path)
protected string $_absoluteCssPath
Résultat string

$_blocks protected_oe property

CSS Blocks
protected array $_blocks
Résultat array

$_breakpointCatalog protected_oe property

Media Query condition catalog
protected array $_breakpointCatalog
Résultat array

$_breakpointIndex protected_oe property

Media Query condition index
protected array $_breakpointIndex
Résultat array

$_breakpointTypes protected_oe static_oe property

Breakpoint types
protected static array $_breakpointTypes
Résultat array

$_importPatterns protected_oe static_oe property

Import at-rule patterns
protected static array $_importPatterns
Résultat array

$_lines protected_oe property

Line lengths
protected array $_lines
Résultat array

$_minifier protected_oe property

Minification provider
protected Minifier,Tollwerk\Squeezr\Css $_minifier
Résultat Tollwerk\Squeezr\Css\Minifier

$_relativeCssPath protected_oe property

Requested CSS file (relative path to document root)
protected string $_relativeCssPath
Résultat string