class PackerFilter

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>

Hierarchy

Expanded class hierarchy of PackerFilter

1 file declares its use of PackerFilter
PackerFilterTest.php in drupal/core/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PackerFilterTest.php

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackerFilter.php, line 24

Namespace

Assetic\Filter
View source
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());
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PackerFilter::$encoding protected property
PackerFilter::$fastDecode protected property
PackerFilter::$specialChars protected property
PackerFilter::filterDump public function Filters an asset just before it's dumped. Overrides FilterInterface::filterDump
PackerFilter::filterLoad public function Filters an asset after it has been loaded. Overrides FilterInterface::filterLoad
PackerFilter::setEncoding public function
PackerFilter::setFastDecode public function
PackerFilter::setSpecialChars public function