*/ class CompilerApiFilter extends BaseCompilerFilter { public function filterDump(AssetInterface $asset) { $query = array( 'js_code' => $asset->getContent(), 'output_format' => 'json', 'output_info' => 'compiled_code', ); if (null !== $this->compilationLevel) { $query['compilation_level'] = $this->compilationLevel; } if (null !== $this->jsExterns) { $query['js_externs'] = $this->jsExterns; } if (null !== $this->externsUrl) { $query['externs_url'] = $this->externsUrl; } if (null !== $this->excludeDefaultExterns) { $query['exclude_default_externs'] = $this->excludeDefaultExterns ? 'true' : 'false'; } if (null !== $this->formatting) { $query['formatting'] = $this->formatting; } if (null !== $this->useClosureLibrary) { $query['use_closure_library'] = $this->useClosureLibrary ? 'true' : 'false'; } if (null !== $this->warningLevel) { $query['warning_level'] = $this->warningLevel; } $context = stream_context_create(array('http' => array( 'method' => 'POST', 'header' => 'Content-Type: application/x-www-form-urlencoded', 'content' => http_build_query($query), ))); $response = file_get_contents('http://closure-compiler.appspot.com/compile', false, $context); $data = json_decode($response); if (isset($data->serverErrors) && 0 < count($data->serverErrors)) { // @codeCoverageIgnoreStart throw new \RuntimeException(sprintf('The Google Closure Compiler API threw some server errors: '.print_r($data->serverErrors, true))); // @codeCoverageIgnoreEnd } if (isset($data->errors) && 0 < count($data->errors)) { // @codeCoverageIgnoreStart throw new \RuntimeException(sprintf('The Google Closure Compiler API threw some errors: '.print_r($data->errors, true))); // @codeCoverageIgnoreEnd } $asset->setContent($data->compiledCode); } } __halt_compiler();----SIGNATURE:----ypQRWMT3KlVkD6gb9pBi0MTDcB0F/mCg2c1bHBUe5SPOru76zzjWyHr5We+Zc2cMKFd95zEB2fwwA05C+Y5Kf+cm3VV3dfWpUnJ1GZpNS/2qZbgddAfYcC+BWdJ4O7hhrczPxLboL+Lb/Z/jO00jhZ/ocFOG7bgM6mIqtdIW4gXaRhrlfBScSIFuhkRYjKvLvRb62mEiTs3zc2WhnnldruSLkZdYLGstrOhacdQhG3jis5bIVteTTeeB9bEUlQpj7/YRAgaklF2z2o7P1mHh7t4CdjAyjv5e5bM2Wr5c9UHTguiag2pyL8jSbHjF9tVBzfFbAes5oLzEHuq7PYPlaJ1N3SYWmdwNR1nYiyHgIHS2VwVbwwbLB08qStsjiL1FuI7+iO48VlCnlQF05MWFQ6bTPftfFoJMAdaoWMGMCw0jB+be5m8mPYTcLRWNq/BF2SofpF5ZOcPvjLcNCKcdc4Yndr80hH/wFG2T+DD+UEyOg+Ipv4lPg+BKxWg//Cg8YkUCf14/Pc7yJQJES1ooNaL1Eq1+J+DslDmy50FFQKDJ1mSW+HzZv/kGR0dar+yIVyR/PE+ozXsfdX7UNc5HHNPlB/c8yuCulGazPWd3CZj5gKTbcbF6GwXDvoDPc6vPDBn2ZCb46uUaE7e59yjRX9z9Y+imGy5Z1gKXd675suQ=----ATTACHMENT:----Njg1ODk1ODE0MDQxNjI2MyAzMDE1MTQxMTg4NDMxMzEyIDU1MDU2MTc2MTQ5NDAwNjI=