Commit f9ac6c13c42 for php.net
commit f9ac6c13c427ead81d26f068e6b00ca891443054
Author: Gina Peter Banyard <girgias@php.net>
Date: Mon Jul 20 22:23:52 2026 +0100
streams: use php_stream_wrapper_warn() in _php_stream_open_wrapper_ex()
Instead of the old way of logging errors and displaying them use the new APIs.
diff --git a/main/streams/streams.c b/main/streams/streams.c
index 3ec92b2a221..506a23b3bf7 100644
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -2137,9 +2137,8 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod
}
if (!wrapper->wops->stream_opener) {
- php_stream_wrapper_warn(wrapper, context, options,
- NoOpener,
- "wrapper does not support stream open");
+ php_stream_wrapper_warn(wrapper, context, options, NoOpener,
+ "Failed to open stream: wrapper does not support stream open");
if (resolved_path) {
zend_string_release_ex(resolved_path, 0);
}
@@ -2172,19 +2171,15 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod
/* if the caller asked for a persistent stream but the wrapper did not
* return one, force an error here */
if (persistent && !stream->is_persistent) {
- php_stream_wrapper_log_warn(wrapper, context, options & ~REPORT_ERRORS,
- PersistentNotSupported,
- "wrapper does not support persistent streams");
+ php_stream_wrapper_warn(wrapper, context, options, PersistentNotSupported,
+ "Failed to open stream: wrapper does not support persistent streams");
php_stream_close(stream);
if (options & REPORT_ERRORS) {
- php_stream_display_wrapper_name_errors(wrapper_name, context, PHP_STREAM_EC(OpenFailed),
- "Failed to open stream");
if (opened_path && *opened_path) {
zend_string_release_ex(*opened_path, 0);
*opened_path = NULL;
}
}
- php_stream_tidy_wrapper_name_error_log(wrapper_name);
pefree(wrapper_name, persistent);
if (resolved_path) {
zend_string_release_ex(resolved_path, 0);
@@ -2242,7 +2237,6 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod
php_stream_wrapper_warn(wrapper, context, options,
SeekNotSupported,
"could not make seekable - %s", path);
- php_stream_tidy_wrapper_name_error_log(wrapper_name);
pefree(wrapper_name, persistent);
if (resolved_path) {
zend_string_release_ex(resolved_path, 0);