*/ class CssEmbedFilter implements FilterInterface { private $jarPath; private $javaPath; private $charset; private $mhtml; private $mhtmlRoot; private $root; private $skipMissing; private $maxUriLength; private $maxImageSize; public function __construct($jarPath, $javaPath = '/usr/bin/java') { $this->jarPath = $jarPath; $this->javaPath = $javaPath; } public function setCharset($charset) { $this->charset = $charset; } public function setMhtml($mhtml) { $this->mhtml = $mhtml; } public function setMhtmlRoot($mhtmlRoot) { $this->mhtmlRoot = $mhtmlRoot; } public function setRoot($root) { $this->root = $root; } public function setSkipMissing($skipMissing) { $this->skipMissing = $skipMissing; } public function setMaxUriLength($maxUriLength) { $this->maxUriLength = $maxUriLength; } public function setMaxImageSize($maxImageSize) { $this->maxImageSize = $maxImageSize; } public function filterLoad(AssetInterface $asset) { } public function filterDump(AssetInterface $asset) { $pb = new ProcessBuilder(array( $this->javaPath, '-jar', $this->jarPath, )); if (null !== $this->charset) { $pb->add('--charset')->add($this->charset); } if ($this->mhtml) { $pb->add('--mhtml'); } if (null !== $this->mhtmlRoot) { $pb->add('--mhtmlroot')->add($this->mhtmlRoot); } // automatically define root if not already defined if (null === $this->root) { $root = $asset->getSourceRoot(); $path = $asset->getSourcePath(); if ($root && $path) { $pb->add('--root')->add(dirname($root.'/'.$path)); } } else { $pb->add('--root')->add($this->root); } if ($this->skipMissing) { $pb->add('--skip-missing'); } if (null !== $this->maxUriLength) { $pb->add('--max-uri-length')->add($this->maxUriLength); } if (null !== $this->maxImageSize) { $pb->add('--max-image-size')->add($this->maxImageSize); } // input $pb->add($input = tempnam(sys_get_temp_dir(), 'assetic_cssembed')); 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()); } } __halt_compiler();----SIGNATURE:----ITyjjICCN28Ewh0X2QLE8craq7IKfXTU+GrmEh49KHzbpJNixgvHgOJPTwUDSWrmPqxNCvhG4m1caFE/E9XJlJ6lLm/16PnUsF5I4wyccuUsx9jkGPr68YV6+xnZlo5N0EIAMfY2re2WF9blLRnvtEZnjy39PMFE8nM/y+PN78CgsgBYshPUGYnL3OWHoVJMMprYYFZmdiVtIWGg0MtFfdDi56MxM7f6tAviu0bX46E6aV5P2u4geOShlFsZ+n4pVXotf2kl9Hi8qt/zXZLD6SCSVUhhtVHq6Ct8VEvCYMDUwfoFZkDUS8n1eBNa+S8ZXjCcxLaJJLDaW85DZSyZNSj3gULFTPCCVRZirD0wSqd+E9gFzqzUUwKZ7UaVups25qX0e/Jylql00XW/xkEztA7tFinCVOFDYJBzfayAa78SX0JRwctSF/3M5HLeVOf1U6wT6NsHSs9cW3EoleLRGX4sYIk/Dic+uMOGS1WiO8YMU45WGmDBUHIFNZOLZ04KaepKG3kMrRAO6WdCXRzP8VHGyIiGafvEOrVvd26Jz64owVo+FBVn2C90DznUvxOy0pQSq/ysLA6mTTVx/p7Ir2EArR4V+BsgKyBhmOGDTYAZU1vll7maEftisypEnAeZSXBVDiZjVevXJSN3oKkRDDsSdYyUeejheIvLGXUy2Us=----ATTACHMENT:----ODg1NDI0NjY1NjEyODc5IDMyNTM2NzA5MDUwNTgyMDkgNjQ2NjkzNTQyMTA0MjAzOQ==