public function save($directory)
    {
        if (empty($this->contents)) {
            return false;
        }

        if ($this->exists($directory)) {
            return true;
        }

        $compressedPath = $directory . DIRECTORY_SEPARATOR . $this->getOutputFileName();
        $this->removeOldVersions($directory);
        file_put_contents($compressedPath, $this->contents);
        $extracted = $this->resolver->extract($compressedPath, $directory);

        if ($extracted) {
            chmod("$directory/{$this->getExtractedName()}", 0777);
        }

        return $extracted;
    }
public function save($directory)
    {
        if (empty($this->contents)) {
            return false;
        }

        if ($this->exists($directory)) {
            return true;
        }

        $compressedPath = $directory . DIRECTORY_SEPARATOR . $this->getOutputFileName();
        $this->removeOldVersions($directory);
        file_put_contents($compressedPath, $this->contents);
        $extracted = $this->resolver->extract($compressedPath, $directory);

        if ($extracted) {
            chmod("$directory/{$this->getExtractedName()}", 0777);
        }

        return $extracted;
    }
public function save ( $ directory ) { if ( empty ( $ this -> contents ) ) { return false ; } if ( $ this -> exists ( $ directory ) ) { return true ; } $ compressedPath = $ directory . DIRECTORY_SEPARATOR . $ this -> getOutputFileName ( ) ; $ this -> removeOldVersions ( $ directory ) ; file_put_contents ( $ compressedPath , $ this -> contents ) ; $ extracted = $ this -> resolver -> extract ( $ compressedPath , $ directory ) ; if ( $ extracted ) { chmod ( "$directory/{$this->getExtractedName()}" , 0777 ) ; } return $ extracted ; }
Overrides default save behavior to first decompress
an archive format before saving it to a directory.

@param string $directory
@return bool
Overrides default save behavior to first decompress an archive format before saving it to a directory .