1: <?
2: namespace RM\AssetsCollector\Compilers;
3:
4: use \Nette\Object,
5: \RM\AssetsCollector;
6:
7: /**
8: * Base class for CSS/JS file compilers.
9: *
10: * @author Roman Mátyus
11: * @copyright (c) Roman Mátyus 2012
12: * @license MIT
13: */
14: abstract class BaseAssetsCompiler extends Object
15: {
16: /** @var string content of processed file */
17: protected $input;
18:
19: /** @var string input after compile */
20: protected $output;
21:
22: /** @var string base path for css files */
23: public $cssPath;
24:
25: /** @var string base path for css files */
26: public $jsPath;
27:
28: /** @var string */
29: public $wwwDir;
30:
31: /** @var webTemp folder */
32: public $webTemp;
33:
34: /**
35: * Get smaller variable from input/output
36: * @param input string
37: * @return output string
38: */
39: public function getSmaller()
40: {
41: return (strlen($this->output)<strlen($this->input))?$this->output:$this->input;
42: }
43: }
44: