1 | <?php |
||
14 | class Module extends ExternalModule |
||
15 | { |
||
16 | /** LESS variable declaration pattern */ |
||
17 | const P_VARIABLE_DECLARATION = '/^(\s|\n)?\@(?<name>[^\s:]+)\:(?<value>[^;]+);/'; |
||
18 | /** LESS mixin declaration pattern */ |
||
19 | const P_MIXIN_DECLARATION = '/^\s*\.(?<name>[^\s(]+)\s*(?<params>\([^)]+\))?\s*(?<code>\{[^}]+\})/'; |
||
20 | 2 | ||
21 | /** @var \lessc LESS compiler */ |
||
22 | 2 | protected $less; |
|
23 | |||
24 | 2 | /** @var array Collection of LESS variables */ |
|
25 | protected $variables = []; |
||
26 | 2 | ||
27 | /** @var array Collection of LESS mixins */ |
||
28 | protected $mixins = []; |
||
29 | |||
30 | /** SamsonFramework load preparation stage handler */ |
||
31 | public function prepare() |
||
40 | |||
41 | 2 | /** |
|
42 | * LESS resource analyzer. |
||
43 | * |
||
44 | 2 | * @param string $resource Resource full path |
|
45 | 2 | * @param string $extension Resource extension |
|
46 | */ |
||
47 | public function analyzer($resource, $extension) |
||
72 | |||
73 | /** |
||
74 | * LESS resource compiler. |
||
75 | * |
||
76 | * @param string $resource Resource full path |
||
77 | * @param string $extension Resource extension |
||
78 | * @param string $output Compiled output resource content |
||
79 | * |
||
80 | * @throws \Exception |
||
81 | */ |
||
82 | public function compiler($resource, &$extension, &$output) |
||
102 | } |
||
103 |