public function process()
    {
        $this->_cleanFilesStack();
        $this->init();

        if (empty($this->destination_file) && false===$this->direct_output) {
            $this->guessDestinationFilename();
        }

        if (!method_exists($this->__adapter, $this->__adapter_action)) {
            throw new \RuntimeException(
                sprintf('[Compressor] Action "%s" doesn\'t exist in "%s" adapter!', $this->__adapter_action, get_class($this->__adapter))
            );
        }

        if (false===$this->direct_output) {
            if (!$this->mustRefresh()) {
                $this->output = file_get_contents($this->getDestinationRealPath());
                return $this;
            }
        }

        $this->prepare();
        $stack = $this->getContents();
        $contents = array();
        foreach ($stack as $_name=>$_content) {
            $contents[] = '';
            $contents[] = $this->__adapter->buildComment($_name);
            $contents[] = $this->__adapter->{$this->__adapter_action}($_content);
        }
        if (!empty($this->raw_header)) {
            $this->output = $this->raw_header."\n";
        }
        $this->output .= implode("\n", $contents);

        if (!empty($this->output) && false===$this->direct_output) {
            $this->_writeDestinationFile();
        }
        return strlen($this->output);
    }
public function process()
    {
        $this->_cleanFilesStack();
        $this->init();

        if (empty($this->destination_file) && false===$this->direct_output) {
            $this->guessDestinationFilename();
        }

        if (!method_exists($this->__adapter, $this->__adapter_action)) {
            throw new \RuntimeException(
                sprintf('[Compressor] Action "%s" doesn\'t exist in "%s" adapter!', $this->__adapter_action, get_class($this->__adapter))
            );
        }

        if (false===$this->direct_output) {
            if (!$this->mustRefresh()) {
                $this->output = file_get_contents($this->getDestinationRealPath());
                return $this;
            }
        }

        $this->prepare();
        $stack = $this->getContents();
        $contents = array();
        foreach ($stack as $_name=>$_content) {
            $contents[] = '';
            $contents[] = $this->__adapter->buildComment($_name);
            $contents[] = $this->__adapter->{$this->__adapter_action}($_content);
        }
        if (!empty($this->raw_header)) {
            $this->output = $this->raw_header."\n";
        }
        $this->output .= implode("\n", $contents);

        if (!empty($this->output) && false===$this->direct_output) {
            $this->_writeDestinationFile();
        }
        return strlen($this->output);
    }
public function process ( ) { $ this -> _cleanFilesStack ( ) ; $ this -> init ( ) ; if ( empty ( $ this -> destination_file ) && false === $ this -> direct_output ) { $ this -> guessDestinationFilename ( ) ; } if ( ! method_exists ( $ this -> __adapter , $ this -> __adapter_action ) ) { throw new \ RuntimeException ( sprintf ( '[Compressor] Action "%s" doesn\'t exist in "%s" adapter!' , $ this -> __adapter_action , get_class ( $ this -> __adapter ) ) ) ; } if ( false === $ this -> direct_output ) { if ( ! $ this -> mustRefresh ( ) ) { $ this -> output = file_get_contents ( $ this -> getDestinationRealPath ( ) ) ; return $ this ; } } $ this -> prepare ( ) ; $ stack = $ this -> getContents ( ) ; $ contents = array ( ) ; foreach ( $ stack as $ _name => $ _content ) { $ contents [ ] = '' ; $ contents [ ] = $ this -> __adapter -> buildComment ( $ _name ) ; $ contents [ ] = $ this -> __adapter -> { $ this -> __adapter_action } ( $ _content ) ; } if ( ! empty ( $ this -> raw_header ) ) { $ this -> output = $ this -> raw_header . "\n" ; } $ this -> output .= implode ( "\n" , $ contents ) ; if ( ! empty ( $ this -> output ) && false === $ this -> direct_output ) { $ this -> _writeDestinationFile ( ) ; } return strlen ( $ this -> output ) ; }
Process the current files stack

@return self
@throws \RuntimeException
Process the current files stack