Skip to content

Version 5.0

Latest
Compare
Choose a tag to compare
@jszobody jszobody released this 09 Jul 15:18
· 4 commits to master since this release

Version 5 is a major refactor of this package based on ZipStream 3.1. 🎉

Breaking changes

  1. The config file has been rearranged a bit. If you published the config file you'll need to do that again.
  2. STS\ZipStream\ZipStream is now STS\ZipStream\Builder. You may need to update some typehints in your code.
  3. STS\ZipStream\ZipStreamFacade is now STS\ZipStream\Facades\Zip. The global Zip alias is still registered.
  4. ENV ZIPSTREAM_FILE_METHOD is now ZIPSTREAM_COMPRESSION_METHOD
  5. ENV ZIPSTREAM_FILE_SANITIZE is now ZIPSTREAM_ASCII_FILENAMES

Other changes

  1. All zips are Zip64 now as they are widely supported.
  2. We flush zip output right away. This reduces buffering and memory usage, and gets zip output to the user started as quickly as possible.
  3. Header X-Accel-Buffering: no is added for nginx. See here.

New features

  1. $zip->has($path) to check if a file already was added
  2. $zip->addFromDisk($diskName, $source, $zipPath) to add files using a Laravel storage disk
  3. $zip->saveToDisk($diskName, $folder) to save output to a Laravel storage disk
  4. $zip->then(function() { // do something after zip is finished sending }); to handle any cleanup or other post-zipping tasks
  5. $zip->setComment(...) for adding comments to the main zip file
  6. $file->setComment(...) for individual file comments (you have to use File::make yourself to have access to the file instance and use this)