*/ class CoffeeScriptFilter implements FilterInterface { private $coffeePath; private $nodePath; public function __construct($coffeePath = '/usr/bin/coffee', $nodePath = '/usr/bin/node') { $this->coffeePath = $coffeePath; $this->nodePath = $nodePath; } public function filterLoad(AssetInterface $asset) { $options = array($this->nodePath, $this->coffeePath, '-sc'); $proc = new Process(implode(' ', array_map('escapeshellarg', $options)), null, array(), $asset->getContent()); $code = $proc->run(); if (0 < $code) { throw new \RuntimeException($proc->getErrorOutput()); } $asset->setContent($proc->getOutput()); } public function filterDump(AssetInterface $asset) { } }