zlib: use new stream error API#22741
Draft
Girgias wants to merge 2 commits into
Draft
Conversation
Girgias
commented
Jul 15, 2026
Comment on lines
+208
to
+215
| if (UNEXPECTED(failed)) { | ||
| /* TODO: keep options arg instead of REPORT_ERRORS? Fix _php_stream_open_wrapper_ex() to not clear report errors flag? */ | ||
| php_stream_wrapper_log_warn(wrapper, context, REPORT_ERRORS, InvalidParam, | ||
| "zlib \"level\" context option must be of type int, %s given", zend_zval_type_name(zlevel)); | ||
| } else if (Z_OK != gzsetparams(self->gz_file, level, Z_DEFAULT_STRATEGY)) { | ||
| php_stream_wrapper_log_warn(wrapper, context, REPORT_ERRORS, Generic, | ||
| "failed setting compression level"); | ||
| } |
Member
Author
There was a problem hiding this comment.
The reason those warnings don't appear if we use options is because the REPORT_ERRORS flag is negated when calling the wrapper ops, but also because we do return a string, so the caller just expects no warnings to have occurred.
I'm experimenting with not negating the flag in the first place at the wrapper level.
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.
Converting to draft, as I think we need to fix some other issues regarding stream errors now that E_WARNINGs messages with arguments is something that is controlled by an INI setting, something which the current stream error API doesn't handle well.