Hi,
Thanks for pointing me to README.SUBMITTING_PATCH - it's only included
in the CVS tree, not in the releases. It might be a good idea to put
it in distribution releases too - I did look around for such a guide
before submitting.
Anyway, here is a new patch against the CVS tree.
Basically, I've added a new option, fancy_html_errors, which defaults
to ON. If set, it overrides html_errors, and outputs errors in the
same html format, but also includes the following style information:
position:fixed;left:25%;right:25%;top:25%;bottom:25%;
border-style:dashed;border-size:2;background:white;
the reason I'm suggesting this is that at the moment, it's possible to
'loose' a php error message in amoungst other webpage output. The
style information causes compatible browsers, (Konqueror, for
example), to render a box in the middle of the screen with a dashed
border, containing the php error against a white background.
The only problem I can see is that multiple errors will overlap, but
whether that is a problem or not depends on the user.
John.
Index: main/main.c
===================================================================
RCS file: /repository/php4/main/main.c,v
retrieving revision 1.512
diff -u -r1.512 main.c
--- main/main.c 12 Nov 2002 14:40:00 -0000 1.512
+++ main/main.c 14 Nov 2002 20:57:31 -0000
@@ -246,6 +246,7 @@
STD_PHP_INI_BOOLEAN("expose_php", "1",
PHP_INI_SYSTEM, OnUpdateBool, expose_php,
php_core_globals, core_globals)
STD_PHP_INI_ENTRY("docref_root", "http://www.php.net/", PHP_INI_ALL,
OnUpdateString, docref_root, php_core_globals,
core_globals)
STD_PHP_INI_ENTRY("docref_ext", "",
PHP_INI_ALL, OnUpdateString, docref_ext,
php_core_globals, core_globals)
+ STD_PHP_INI_BOOLEAN("fancy_html_errors", "1", PHP_INI_ALL,
+ OnUpdateBool, fancy_html_errors,
+php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("html_errors", "1",
PHP_INI_ALL, 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,
OnUpdateInt, xmlrpc_error_number, php_core_globals,
core_globals)
@@ -453,7 +454,11 @@
}
}
if (PG(html_errors)) {
- php_error(type, "%s(%s) [<a href='%s%s%s'>%s</a>]:
%s", get_active_function_name(TSRMLS_C), params, docref_root, docref, docref_target,
docref, buffer);
+ if (PG(fancy_html_errors)) {
+ php_error(type, "<div
+style=\"position:fixed;left:25%;right:25%;top:25%;bottom:25%;border-style:dashed;border-size:2;background:white;\">%s(%s)
+ [<a href='%s%s%s'>%s</a>]: %s</div>", get_active_function_name(TSRMLS_C), params,
+docref_root, docref, docref_target, docref, buffer);
+ } else {
+ }
+ php_error(type, "%s(%s) [<a href='%s%s%s'>%s</a>]: %s",
+get_active_function_name(TSRMLS_C), params, docref_root, docref, docref_target,
+docref, buffer);
} else {
php_error(type, "%s(%s) [%s%s%s]: %s",
get_active_function_name(TSRMLS_C), params, docref_root, docref, docref_target,
buffer);
}
@@ -609,6 +614,9 @@
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(fancy_html_errors)) {
+ error_format = "<div
+style=\"position:fixed;left:25%;right:25%;top:25%;bottom:25%;border-style:dashed;border-size:2;background:white;\"><br
+ />\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br /></div>\n";
+ }
if (PG(xmlrpc_errors)) {
error_format = do_alloca(ERROR_BUF_LEN);
snprintf(error_format, ERROR_BUF_LEN-1, "<?xml
version=\"1.0\"?><methodResponse><fault><value><struct><member><name>faultCode</name><value><int>%ld</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));
Index: main/php_globals.h
===================================================================
RCS file: /repository/php4/main/php_globals.h,v
retrieving revision 1.84
diff -u -r1.84 php_globals.h
--- main/php_globals.h 21 Oct 2002 16:41:06 -0000 1.84
+++ main/php_globals.h 14 Nov 2002 20:57:31 -0000
@@ -125,6 +125,7 @@
char *docref_ext;
zend_bool html_errors;
+ zend_bool fancy_html_errors;
zend_bool xmlrpc_errors;
long xmlrpc_error_number;
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php