Allow errors to be returned as XMLRPC fault packets.

Submitted by: Matt Allen <matt@investigationmarketplace.com>
This commit is contained in:
Sascha Schumann 2001-07-10 15:59:33 +00:00
parent 043ec51eb0
commit a2ce3c7068
3 changed files with 16 additions and 1 deletions

3
NEWS
View File

@ -1,7 +1,8 @@
PHP 4.0 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 200?, Version 4.0.7-dev
- Improve range() function to support range('a','z') and range(9,0) types
- Added option for returning XMLRPC fault packets (Matt Allen, Sascha Schumann)
- Improved range() function to support range('a','z') and range(9,0) types
of ranges. (Rasmus)
- Add getmygid() and safe_mode_gid ini directive to allow safe mode to do
a gid check instead of a uid check. (James E. Flemer, Rasmus)

View File

@ -202,6 +202,8 @@ PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("enable_dl", "1", PHP_INI_SYSTEM, OnUpdateBool, enable_dl, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("expose_php", "1", PHP_INI_SYSTEM, OnUpdateBool, expose_php, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("html_errors", "1", PHP_INI_SYSTEM, OnUpdateBool, html_errors, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("xmlrpc_errors", "0", PHP_INI_SYSTEM, OnUpdateBool, xmlrpc_errors, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("xmlrpc_error_number", "0", PHP_INI_ALL, OnUpdateString, xmlrpc_error_number, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("ignore_user_abort", "0", PHP_INI_ALL, OnUpdateBool, ignore_user_abort, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("implicit_flush", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM,OnUpdateBool, implicit_flush, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("log_errors", "0", PHP_INI_ALL, OnUpdateBool, log_errors, php_core_globals, core_globals)
@ -400,12 +402,20 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
error_format = PG(html_errors) ?
"<br>\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br>\n"
: "\n%s: %s in %s on line %d\n";
if (PG(xmlrpc_errors)) {
error_format = do_alloca(1024);
snprintf(error_format, 1023 , "<?xml version=\"1.0\"?><methodResponse><fault><value><struct><member><name>faultCode</name><value><int>%d</int></value></member><member><name>faultString</name><value><string>%%s:%%s in %%s on line %%d</string></value></member></struct></value></fault></methodResponse>", PG(xmlrpc_error_number));
}
if (prepend_string) {
PUTS(prepend_string);
}
php_printf(error_format, error_type_str, buffer,
error_filename, error_lineno);
if (PG(xmlrpc_errors)) {
free_alloca(error_format);
}
if (append_string) {
PUTS(append_string);
}

View File

@ -123,6 +123,10 @@ struct _php_core_globals {
zend_bool y2k_compliance;
zend_bool html_errors;
zend_bool xmlrpc_errors;
short xmlrpc_error_number;
zend_bool modules_activated;