PHP Класс Tollwerk\Squeezr\Css

С версии: 1.0b
Автор: Joschi Kuphal ([email protected])
Наследование: extends Tollwerk\Squeezr
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_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)

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

Метод Описание
instance ( string $css ) : Css Instanciate a CSS proxy
send ( boolean $cache = true ) : void Parse, squeeze and send the CSS file to the client

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

Метод Описание
__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

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

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

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

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

Determine / create and return a breakpoint index entry
protected _breakpointIndex ( integer $type, array $condition ) : integer
$type integer Breakpoint type
$condition array Condition values
Результат integer Breakpoint index

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

Extract the relevant breakpoints out of a @media query
protected _breakpoints ( string $mediaQuery ) : array | null
$mediaQuery string @media query
Результат array | null Breakpoint alternatives

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

Compile a PHP cache class representing the loaded CSS stylesheet
protected _compileCacheClassCode ( ) : string
Результат string PHP class code

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

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
Результат string Declaration block (starting at the beginning of the CSS text)

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

Minifiy a CSS block (in case a minification provider has been registered)
protected _minify ( string $css ) : string
$css string CSS block
Результат string Minified CSS block

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

Parse and analyze the requested CSS file
protected _parse ( )

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

Find the line number corresponding with a peek position within the CSS file
protected _peekToLine ( integer $peek ) : integer
$peek integer Peek position
Результат integer Line number

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

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

instance() публичный статический Метод

Instanciate a CSS proxy
public static instance ( string $css ) : Css
$css string CSS file
Результат Css Instance reference

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

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
Результат void

Описание свойств

$_absoluteCacheCssDir защищенное свойство

Parent directory of cached CSS file (absolute path)
protected string $_absoluteCacheCssDir
Результат string

$_absoluteCacheCssPath защищенное свойство

Cached CSS file (absolute path)
protected string $_absoluteCacheCssPath
Результат string

$_absoluteCachePathBase защищенное свойство

Base path for all cache files
protected string $_absoluteCachePathBase
Результат string

$_absoluteCachePhpPath защищенное свойство

Cached CSS file (absolute path)
protected string $_absoluteCachePhpPath
Результат string

$_absoluteCssPath защищенное свойство

Requested CSS file (absolute path)
protected string $_absoluteCssPath
Результат string

$_blocks защищенное свойство

CSS Blocks
protected array $_blocks
Результат array

$_breakpointCatalog защищенное свойство

Media Query condition catalog
protected array $_breakpointCatalog
Результат array

$_breakpointIndex защищенное свойство

Media Query condition index
protected array $_breakpointIndex
Результат array

$_breakpointTypes защищенное статическое свойство

Breakpoint types
protected static array $_breakpointTypes
Результат array

$_importPatterns защищенное статическое свойство

Import at-rule patterns
protected static array $_importPatterns
Результат array

$_lines защищенное свойство

Line lengths
protected array $_lines
Результат array

$_minifier защищенное свойство

Minification provider
protected Minifier,Tollwerk\Squeezr\Css $_minifier
Результат Tollwerk\Squeezr\Css\Minifier

$_relativeCssPath защищенное свойство

Requested CSS file (relative path to document root)
protected string $_relativeCssPath
Результат string