Releases: stechstudio/laravel-zipstream
Releases · stechstudio/laravel-zipstream
5.7
5.6
5.5
What's Changed
- S3File: use dedicated temp stream to get size by @bayprogrammer in #126
New Contributors
- @bayprogrammer made their first contribution in #126
Full Changelog: 5.4...5.5
5.4
5.3
Conflict handling
Conflict handling
If two or more files are added to the zip with the same zip path, you can use ZIPSTREAM_CONFLICT_STRATEGY to configure how the conflict is handled:
ZIPSTREAM_CONFLICT_STRATEGY=skip: Keep the initial file, skip adding the conflicting file (default)ZIPSTREAM_CONFLICT_STRATEGY=replace: Keep the latest file, overwrite previous files at the same pathZIPSTREAM_CONFLICT_STRATEGY=rename: Append a number to the conflicting file name, e.g.file.txtbecomesfile_1.txt
Note: filenames are compared case-insensitive. FILE.txt and file.TXT are considered conflicting. If you are working only on a case-sensitive filesystem you can set ZIPSTREAM_CASE_INSENSITIVE_CONFLICTS=false. Don't do this if you have Windows users opening your zips!
Version 5.0
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\ZipStreamis nowSTS\ZipStream\Builder. You may need to update some typehints in your code.STS\ZipStream\ZipStreamFacadeis nowSTS\ZipStream\Facades\Zip. The globalZipalias is still registered.- ENV
ZIPSTREAM_FILE_METHODis nowZIPSTREAM_COMPRESSION_METHOD - ENV
ZIPSTREAM_FILE_SANITIZEis nowZIPSTREAM_ASCII_FILENAMES
Other changes
- All zips are
Zip64now 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: nois 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::makeyourself to have access to the file instance and use this)
5.0-beta.1
Added:
$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 });- Uses
$flushOutputto minimize zip buffering and RAM usage and get zip output faster to user
5.0-beta
This is a major refactor based on ZipStream 3.1.
A few backwards compatible breaks:
STS\ZipStream\ZipStreamis nowSTS\ZipStream\Builder. You may need to update some typehints in your code.STS\ZipStream\ZipStreamFacadeis nowSTS\ZipStream\Facades\Zip. The globalZipalias is still registered.- The config file has been rearranged a bit. If you published the config file you'll need to do that again.
A few ENVs have been renamed:
ZIPSTREAM_FILE_METHOD=>ZIPSTREAM_COMPRESSION_METHODZIPSTREAM_FILE_SANITIZE=>ZIPSTREAM_ASCII_FILENAMES
Laravel 11 support
4.14 L11