return 0;
}
- zend_error(E_WARNING, "streams of type %s do not support seeking", stream->ops->label);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "streams of type %s do not support seeking", stream->ops->label);
return -1;
}
}
fclose(fp);
- zend_error(E_WARNING, "%s(): unable to allocate stream", get_active_function_name(TSRMLS_C));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to allocate stream");
return NULL;
}
fp = tmpfile();
if (fp == NULL) {
- zend_error(E_WARNING, "tmpfile(): %s", strerror(errno));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "tmpfile(): %s", strerror(errno));
return NULL;
}
stream = php_stream_fopen_from_file_rel(fp, "r+");
if (stream == NULL) {
- zend_error(E_WARNING, "tmpfile(): %s", strerror(errno));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "tmpfile(): %s", strerror(errno));
fclose(fp);
return NULL;
}
b) no memory
-> lets bail
*/
- zend_error(E_ERROR, "%s(): fopencookie failed", get_active_function_name(TSRMLS_C));
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "fopencookie failed");
return FAILURE;
#endif
"STDIO FILE*", "File Descriptor", "Socket Descriptor"
};
- zend_error(E_WARNING, "%s(): cannot represent a stream of type %s as a %s",
- get_active_function_name(TSRMLS_C),
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot represent a stream of type %s as a %s",
stream->ops->label,
cast_names[castas]
);
/* BC with older php scripts and zlib wrapper */
protocol = "compress.zlib";
n = 13;
- zend_error(E_WARNING, "Use of \"zlib:\" wrapper is deprecated; please use \"compress.zlib://\" instead.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Use of \"zlib:\" wrapper is deprecated; please use \"compress.zlib://\" instead.");
}
if (protocol) {
n = sizeof(wrapper_name) - 1;
PHP_STRLCPY(wrapper_name, protocol, sizeof(wrapper_name), n);
- zend_error(E_NOTICE, "Unable to find the wrapper \"%s\" - did you forget to enable it when you configured PHP?",
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unable to find the wrapper \"%s\" - did you forget to enable it when you configured PHP?",
wrapper_name);
wrapper = NULL;
if (!protocol || !strncasecmp(protocol, "file", n)) {
if (protocol && path[n+1] == '/' && path[n+2] == '/') {
if (options & REPORT_ERRORS)
- zend_error(E_WARNING, "remote host file access not supported, %s", path);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "remote host file access not supported, %s", path);
return NULL;
}
if (protocol && path_for_open)
if (wrapper && wrapper->is_url && !PG(allow_url_fopen)) {
if (options & REPORT_ERRORS)
- zend_error(E_WARNING, "URL file-access is disabled in the server configuration");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration");
return NULL;
}
msg = "no suitable wrapper could be found";
php_strip_url_passwd(tmp);
- zend_error(E_WARNING, "%s(\"%s\") - %s", get_active_function_name(TSRMLS_C), tmp, msg);
+ php_error_docref1(NULL TSRMLS_CC, tmp, E_WARNING, "%s", msg);
efree(tmp);
}
return stream;