Skip to content

Releases: stechstudio/laravel-zipstream

Conflict handling

04 Nov 17:46
82a5c81
Compare
Choose a tag to compare

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 path
  • ZIPSTREAM_CONFLICT_STRATEGY=rename: Append a number to the conflicting file name, e.g. file.txt becomes file_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

09 Jul 15:18
Compare
Choose a tag to compare

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)

5.0-beta.1

09 Jul 13:28
Compare
Choose a tag to compare
5.0-beta.1 Pre-release
Pre-release

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 $flushOutput to minimize zip buffering and RAM usage and get zip output faster to user

5.0-beta

05 Jul 13:06
Compare
Choose a tag to compare
5.0-beta Pre-release
Pre-release

This is a major refactor based on ZipStream 3.1.

A few backwards compatible breaks:

  1. STS\ZipStream\ZipStream is now STS\ZipStream\Builder. You may need to update some typehints in your code.
  2. STS\ZipStream\ZipStreamFacade is now STS\ZipStream\Facades\Zip. The global Zip alias is still registered.
  3. 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:

  1. ZIPSTREAM_FILE_METHOD => ZIPSTREAM_COMPRESSION_METHOD
  2. ZIPSTREAM_FILE_SANITIZE => ZIPSTREAM_ASCII_FILENAMES

Laravel 11 support

12 Mar 23:22
Compare
Choose a tag to compare

Laravel 10 support

15 Feb 14:08
Compare
Choose a tag to compare
4.12

this is pretty large as well

Laravel 9 support

07 Feb 16:23
Compare
Choose a tag to compare
4.6

update badge

Config file changes

25 Jan 17:05
Compare
Choose a tag to compare

This version changes the way S3 clients are created, just a bit. It is only a breaking change if you were previously relying on an empty set of AWS credentials to prompt credentials = false in the S3 client. For everyone else this major version is backwards compatible.

For S3 client creation now:

  1. If you have credentials specified in your .env file they are used, as always.

  2. If you have no credentials specified, no credentials are handed to the S3Client. This means the AWS SDK will attempt to find credentials using the default chain.

  3. If you set AWS_ANONYMOUS=true in your .env file, this library will set credentials = false when creating the client, which explicitly creates an anonymous client.

php8 support

13 Jan 17:09
Compare
Choose a tag to compare
3.1

add php8 to travis

2.4: Merge pull request #18 from it-can/master

12 Mar 15:05
8731041
Compare
Choose a tag to compare
update maennchen/zipstream-php to v2