*/ abstract class BaseCompressorFilter implements FilterInterface { private $jarPath; private $javaPath; private $charset; private $lineBreak; public function __construct($jarPath, $javaPath = '/usr/bin/java') { $this->jarPath = $jarPath; $this->javaPath = $javaPath; } public function setCharset($charset) { $this->charset = $charset; } public function setLineBreak($lineBreak) { $this->lineBreak = $lineBreak; } public function filterLoad(AssetInterface $asset) { } /** * Compresses a string. * * @param string $content The content to compress * @param string $type The type of content, either "js" or "css" * @param array $options An indexed array of additional options * * @return string The compressed content */ protected function compress($content, $type, $options = array()) { $pb = new ProcessBuilder(array( $this->javaPath, '-jar', $this->jarPath, )); foreach ($options as $option) { $pb->add($option); } if (null !== $this->charset) { $pb->add('--charset')->add($this->charset); } if (null !== $this->lineBreak) { $pb->add('--line-break')->add($this->lineBreak); } // input and output files $tempDir = realpath(sys_get_temp_dir()); $hash = substr(sha1(time().rand(11111, 99999)), 0, 7); $input = $tempDir.DIRECTORY_SEPARATOR.$hash.'.'.$type; $output = $tempDir.DIRECTORY_SEPARATOR.$hash.'-min.'.$type; file_put_contents($input, $content); $pb->add('-o')->add($output)->add($input); $proc = $pb->getProcess(); $code = $proc->run(); unlink($input); if (0 < $code) { if (file_exists($output)) { unlink($output); } throw new \RuntimeException($proc->getErrorOutput()); } elseif (!file_exists($output)) { throw new \RuntimeException('Error creating output file.'); } $retval = file_get_contents($output); unlink($output); return $retval; } } __halt_compiler();----SIGNATURE:----F9awTFUbEqAYPAtpDfDEPuGR0fpJTFFOau84ZlpFfm3/y38aio8HHpNuuB9EjtapA5ldaIMaCfAtylTH7byPu1Wkn/EBfe7Gxrh4aSI1cupeOEW1AzKMll+1n1jn7abnan1tu29uV4E+EN7QW8ZSQqAe/QT6aYCbFA62j0rwkxUNJLf8d1LL3lbABR9OZ9A+sDnjYHvfBG86YJvG8iMkhRV29xVfLCe8dNV39PENVGzLvkDdceizK7A2oSW/P8mDKDKy3ceGbsAnfn6eE3c8CAOBjTZGrSJD14HPvWL61v63tP/NF/ODEYkHpAnGuMsgRqeH8wF8neyedwVvAVhXopvUL5dY/qT9m3ur5QJOH1/ZaTxK8MIC6TgfQVUtkfQnyLP2dyabJpxh0WLsZCz+9Fm1Q7MYuFZ7M0KUSw3Y682Hb0A+F5daHXubwasq/hNaS4HL9dD+jcysRyAcQ0MIlMWsszpcXeuQxynhKaY0DRNrEf58bwzOaeSVq7EWfEXS5Ns6TTwOOleU3gXpR8ve8u1LKueW4LUVexo5nZTEm7Lof1wvEpjmF1Wg1PzZ4wX6DU8ms99Km0VgeeEFVTEATDR9wTqgj8GYBtoTKeM/xpJgeRKNlntqsUnJgbu4q4dtnUyMr2Q45m4cZTTaYl5TyS6j6bAQv/UwCmWUcJWx8KM=----ATTACHMENT:----MTMxNDUzNjE5Mjk0NjIyOSA4MzcyMTk5NDgzMjg0MjMxIDk0OTkxNzQwNjYzODcxNTM=