*/ class SassFilter implements FilterInterface { const STYLE_NESTED = 'nested'; const STYLE_EXPANDED = 'expanded'; const STYLE_COMPACT = 'compact'; const STYLE_COMPRESSED = 'compressed'; private $sassPath; private $unixNewlines; private $scss; private $style; private $quiet; private $debugInfo; private $lineNumbers; private $loadPaths = array(); private $cacheLocation; private $noCache; private $compass; public function __construct($sassPath = '/usr/bin/sass') { $this->sassPath = $sassPath; $this->cacheLocation = realpath(sys_get_temp_dir()); } public function setUnixNewlines($unixNewlines) { $this->unixNewlines = $unixNewlines; } public function setScss($scss) { $this->scss = $scss; } public function setStyle($style) { $this->style = $style; } public function setQuiet($quiet) { $this->quiet = $quiet; } public function setDebugInfo($debugInfo) { $this->debugInfo = $debugInfo; } public function setLineNumbers($lineNumbers) { $this->lineNumbers = $lineNumbers; } public function addLoadPath($loadPath) { $this->loadPaths[] = $loadPath; } public function setCacheLocation($cacheLocation) { $this->cacheLocation = $cacheLocation; } public function setNoCache($noCache) { $this->noCache = $noCache; } public function setCompass($compass) { $this->compass = $compass; } public function filterLoad(AssetInterface $asset) { $pb = new ProcessBuilder(array($this->sassPath)); $root = $asset->getSourceRoot(); $path = $asset->getSourcePath(); if ($root && $path) { $pb->add('--load-path')->add(dirname($root.'/'.$path)); } if ($this->unixNewlines) { $pb->add('--unix-newlines'); } if (true === $this->scss || (null === $this->scss && 'scss' == pathinfo($path, PATHINFO_EXTENSION))) { $pb->add('--scss'); } if ($this->style) { $pb->add('--style')->add($this->style); } if ($this->quiet) { $pb->add('--quiet'); } if ($this->debugInfo) { $pb->add('--debug-info'); } if ($this->lineNumbers) { $pb->add('--line-numbers'); } foreach ($this->loadPaths as $loadPath) { $pb->add('--load-path')->add($loadPath); } if ($this->cacheLocation) { $pb->add('--cache-location')->add($this->cacheLocation); } if ($this->noCache) { $pb->add('--no-cache'); } if ($this->compass) { $pb->add('--compass'); } // input $pb->add($input = tempnam(sys_get_temp_dir(), 'assetic_sass')); file_put_contents($input, $asset->getContent()); $proc = $pb->getProcess(); $code = $proc->run(); unlink($input); if (0 < $code) { throw new \RuntimeException($proc->getErrorOutput()); } $asset->setContent($proc->getOutput()); } public function filterDump(AssetInterface $asset) { } } __halt_compiler();----SIGNATURE:----e8Qsry5aPETxgnX50/BuMfyT82WHUaFOMgiFxhpoJ64IdvrcbNHgu5FSWgNM5wVsVOSTytyp29NrBQ+na8SNMCibsvazMFokjTgVZ1jGTWkov8aB/BYdg0JQTeREyIqTPlcnjPtSB7evnV0qEJ7zSWS0E9NE/awaLQSZ9OgXTOm3Wf/JdKvs1HmSdLkjLwczcwo0ZR9MAKYu9ljeZD/75y3tAsaQMzIgs3f72y9b+oIdAkLUNCGIykosbD9ZPJagSl9DRxJoeISKNO6+FpSFfv6sVEl53lZ0NBNnuuSExQRJXTudYfldWBNvwfSeWXyIEPwpMy26EanzH6fL1zbbYu+LD5F8JttAug2uPICpreklmSU7kVFDqIsEymTImG3UkB7qVhNwTYQPNS7849So7Z14GFYaXzlxX3GrPVplfA1pm8oDqGMy5iZMITZ28XkzxQyg6B/rAzsLsHaZtADW6xZYqcelccYQMUN0lL+ZblBQqZRZ8DjNBlUfF1sXS0IVxzAoqiR4iWi8w4jU6HhbrTYDhdehtKrsOvdMJGP4I3C6HJtQfo8YPhdQYlpUofIFvcrlXYSbv3XgSnxogC0BOImFTji3NaWZ2lICES+niYetSltWkMbaPlh8OLnA5ztjeoE+jwuhJmDocbxtv7K0Jkq8oRhNB9ewpx3w2Lb/Nrw=----ATTACHMENT:----MTU0MTQxMzE2Njg5NDIxMyAyMTQ4NDUwODgwNTkzNzk3IDUxNjM0NjkxNzg1MTE5NTA=