Assetic\Util\ProcessBuilder::add PHP Method

add() public method

public add ( $part )
    public function add($part)
    {
        $this->parts[] = $part;

        return $this;
    }

Usage Example

コード例 #1
0
 public function filterDump(AssetInterface $asset)
 {
     $pb = new ProcessBuilder();
     $pb->inheritEnvironmentVariables()->add($this->jpegtranBin);
     if ($this->optimize) {
         $pb->add('-optimize');
     }
     if ($this->copy) {
         $pb->add('-copy')->add($this->copy);
     }
     if ($this->progressive) {
         $pb->add('-progressive');
     }
     if (null !== $this->restart) {
         $pb->add('-restart')->add($this->restart);
     }
     $pb->add($input = tempnam(sys_get_temp_dir(), 'assetic_jpegtran'));
     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());
 }
All Usage Examples Of Assetic\Util\ProcessBuilder::add