stream_is_local(): unwrap zlib and bzip2 wrappers if needed - #23714
Open
DanielEScherzer wants to merge 4 commits into
Open
DanielEScherzer wants to merge 4 commits into
DanielEScherzer wants to merge 4 commits into
Conversation
ndossche
reviewed
Sep 19, 2026
bukka
requested changes
Sep 19, 2026
bukka
left a comment
Member
There was a problem hiding this comment.
As Nora said, this is a hack. It needs to get info from the wrapper and not doing checks by name.
Add tests to demonstrate that the `zlib:`, `compress.zlib://`, and `compress.bzip2://` wrappers also result in `stream_is_local()` returning `true`. This behavior will be changed in a subsequent commit.
Switch `php_stream_wrapper.is_url` from a binary flag (stored as an `int`) to an instance of the new enum `php_stream_wrapper_is_url`, which has the cases `STREAM_IS_URL_NEVER`, `STREAM_IS_URL_ALWAYS`, and `STREAM_IS_URL_SOMETIMES`. Add a new optional stream wrapper operation, `php_stream_wrapper_ops.stream_is_url`, that checks if the given path should be considered a URL or not. This callback is required when a stream wrapper is marked as `STREAM_IS_URL_SOMETIMES`. Update existing stream wrappers: - most of those are marked as not being URLs (`is_url` was 0) just updated that field to be `STREAM_IS_URL_NEVER` and added a new NULL field to their operations. - all of those marked as being URLs (`is_url` was 1) just updated that field to be `STREAM_IS_URL_ALWAYS` and added a new NULL field to their operations. - for the zlib and bz2 wrappers, which were previously marked as never being URLs (`is_url` was 0), set the field to `STREAM_IS_URL_SOMETIMES` and implement the new operation to strip the `compress.zlib://` and `compress.bzip2://` prefixes respectively and then check the underlying wrapped stream.
DanielEScherzer
force-pushed
the
stream_is_local
branch
from
September 19, 2026 20:10
7087c15 to
4b31d57
Compare
Member
Author
Yeah, I was trying to avoid doing large cross-cutting changes so close to the 8.6 branch, but that makes sense - done |
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.
When a stream is wrapped with
compress.zlib://, orcompress.bzip2://, consult the appropriate stream wrapper operations to determine if a stream is local or not.