Search code examples
phpphp-ziparchive

PHP ZipArchive Compression


I am using the PHP ZipArchive class to create a ZIP archive. The archive will contain already compressed ZIP files. As such, there is no use compressing already compressed ZIP files and this will only add unnecessary overhead. Is it possible to create a ZIP archive with ZipArchive but not compress the files?


Solution

  • Setting the compression level with ZipArchive is not currently possible. You can set the compression level with the Zlib library as long as you don't mind creating .gz files instead of .zip

    http://php.net/manual/en/ref.zlib.php