src/Tar.php
public function setCompression($level = 9, $type = Archive::COMPRESS_AUTO)
    {
        $this->compressioncheck($type);
        if ($level < -1 || $level > 9) {
            throw new ArchiveIllegalCompressionException('Compression level should be between -1 and 9');
        }
        $this->comptype  = $type;
        $this->complevel = $level;
        if($level == 0) $this->comptype = Archive::COMPRESS_NONE;
        if($type == Archive::COMPRESS_NONE) $this->complevel = 0;
    }
public function setCompression($level = 9, $type = Archive::COMPRESS_AUTO)
    {
        $this->compressioncheck($type);
        if ($level < -1 || $level > 9) {
            throw new ArchiveIllegalCompressionException('Compression level should be between -1 and 9');
        }
        $this->comptype  = $type;
        $this->complevel = $level;
        if($level == 0) $this->comptype = Archive::COMPRESS_NONE;
        if($type == Archive::COMPRESS_NONE) $this->complevel = 0;
    }
public function setCompression ( $ level = 9 , $ type = Archive :: COMPRESS_AUTO ) { $ this -> compressioncheck ( $ type ) ; if ( $ level < - 1 || $ level > 9 ) { throw new ArchiveIllegalCompressionException ( 'Compression level should be between -1 and 9' ) ; } $ this -> comptype = $ type ; $ this -> complevel = $ level ; if ( $ level == 0 ) $ this -> comptype = Archive :: COMPRESS_NONE ; if ( $ type == Archive :: COMPRESS_NONE ) $ this -> complevel = 0 ; }
Sets the compression to use

@param int $level Compression level (0 to 9)
@param int $type Type of compression to use (use COMPRESS_* constants)
@throws ArchiveIllegalCompressionException
Sets the compression to use