Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not sure if this is considered a bug fix or a new feature.
Checklist:
Why this change is needed?
Currently, it's impossible to stream the file to s3. The following is the error when someone attempts to do so:
ZipArchive::close()
/var/www/application/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php:409
The solution provided in this PR is very naive, and not elegant at all, but it works.
Another option would be to extract
strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout'
to a protected method, which could be overriden by the consumers.There are more complex options as well, fe creating different adapters, but unfortunately I don't really have time to work on them.
But the main goal of this PR is to open a discussion around this. I am curious to know if you are willing to add S3 streaming support at all.