Version 5 is a major refactor of this package based on ZipStream 3.1. 🎉
Breaking changes
- The config file has been rearranged a bit. If you published the config file you'll need to do that again.
STS\ZipStream\ZipStream
is nowSTS\ZipStream\Builder
. You may need to update some typehints in your code.STS\ZipStream\ZipStreamFacade
is nowSTS\ZipStream\Facades\Zip
. The globalZip
alias is still registered.- ENV
ZIPSTREAM_FILE_METHOD
is nowZIPSTREAM_COMPRESSION_METHOD
- ENV
ZIPSTREAM_FILE_SANITIZE
is nowZIPSTREAM_ASCII_FILENAMES
Other changes
- All zips are
Zip64
now as they are widely supported. - We flush zip output right away. This reduces buffering and memory usage, and gets zip output to the user started as quickly as possible.
- Header
X-Accel-Buffering: no
is added for nginx. See here.
New features
$zip->has($path)
to check if a file already was added$zip->addFromDisk($diskName, $source, $zipPath)
to add files using a Laravel storage disk$zip->saveToDisk($diskName, $folder)
to save output to a Laravel storage disk$zip->then(function() { // do something after zip is finished sending });
to handle any cleanup or other post-zipping tasks$zip->setComment(...)
for adding comments to the main zip file$file->setComment(...)
for individual file comments (you have to useFile::make
yourself to have access to the file instance and use this)