Repository navigation
Support all streaming flush modes for Compressor - #45
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The implementation, documentation, and tests consistently support the intended streaming flush modes.
0 open findings
What changed in this PR
Extends Compressor flush-mode support while preventing premature gzip stream termination.
Changes:
- Adds
ZLIB_PARTIAL_FLUSHand rejectsZLIB_FINISH. - Documents compression-level and flush behavior.
- Updates validation and flush-mode tests.
| File | Description |
|---|---|
src/Compressor.php |
Updates validation and API documentation. |
README.md |
Documents compression and flush options. |
tests/CompressorTest.php |
Tests accepted-mode validation. |
tests/GzipCompressorTest.php |
Covers partial, sync, and full flushing. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This changeset updates the
$flushparameter forCompressorto support all streaming flush modes. This adds support forZLIB_PARTIAL_FLUSHand no longer acceptsZLIB_FINISH, which would end the gzip stream after each write, sogzdecode()and similar consumers would silently discard everything after the first chunk.ZLIB_BLOCKis not supported either, as zlib reserves it for advanced applications where the receiving side may not be able to decompress the data written so far.This also documents both the
$leveland$flushparameters.ZLIB_FINISHwas only added in #41 and has not been released yet, so this does not affect any existing users.Builds on top of #41 and #28