Source of file PackerFilter.php
Size: 1,351 Bytes - Last Modified: 2013-06-02T00:13:43+02:00
/home/theseer/Downloads/Symfony/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackerFilter.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 | <?php /* * This file is part of the Assetic package, an OpenSky project. * * (c) 2010-2013 OpenSky Project Inc * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Assetic\Filter; use Assetic\Asset\AssetInterface; /** * Runs assets through Packager, a JavaScript Compressor/Obfuscator. * * PHP Version of the Dean Edwards's Packer, ported by Nicolas Martin. * * @link http://joliclic.free.fr/php/javascript-packer/en/ * @author Maximilian Walter <github@max-walter.net> */ class PackerFilter implements FilterInterface { protected $encoding = 'None'; protected $fastDecode = true; protected $specialChars = false; public function setEncoding($encoding) { $this->encoding = $encoding; } public function setFastDecode($fastDecode) { $this->fastDecode = (bool) $fastDecode; } public function setSpecialChars($specialChars) { $this->specialChars = (bool) $specialChars; } public function filterLoad(AssetInterface $asset) { } public function filterDump(AssetInterface $asset) { $packer = new \JavaScriptPacker($asset->getContent(), $this->encoding, $this->fastDecode, $this->specialChars); $asset->setContent($packer->pack()); } } |