cvs: php4 /main main.c php_globals.h

From: Date: Tue, 04 Jul 2000 09:15:06 +0000
Subject: cvs: php4 /main main.c php_globals.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-615@lists.php.net to get a copy of this message
ssb Tue Jul 4 02:15:06 2000 EDT Modified files: /php4/main main.c php_globals.h Log: Added "html_errors" directive to optionally disable HTML formatting of error messages. The default is on. (Stig) Index: php4/main/main.c diff -u php4/main/main.c:1.278 php4/main/main.c:1.279 --- php4/main/main.c:1.278 Sun Jul 2 09:36:31 2000 +++ php4/main/main.c Tue Jul 4 02:15:06 2000 @@ -19,7 +19,7 @@ */ -/* $Id: main.c,v 1.278 2000/07/02 16:36:31 stas Exp $ */ +/* $Id: main.c,v 1.279 2000/07/04 09:15:06 ssb Exp $ */ #include <stdio.h> @@ -212,6 +212,7 @@ STD_PHP_INI_BOOLEAN("error_append_string", NULL, PHP_INI_ALL, OnUpdateString, error_append_string, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("error_prepend_string", NULL, PHP_INI_ALL, OnUpdateString, error_prepend_string, 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("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) @@ -334,7 +335,6 @@ ELS_FETCH(); PLS_FETCH(); - if (EG(error_reporting) & type || (type & E_CORE)) { char *error_type_str; @@ -386,11 +386,17 @@ if (module_initialized && PG(display_errors)) { char *prepend_string = INI_STR("error_prepend_string"); char *append_string = INI_STR("error_append_string"); + char *error_format; + 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 (prepend_string) { PUTS(prepend_string); } - php_printf("<br>\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br>\n", error_type_str, buffer, error_filename, error_lineno); + php_printf(error_format, error_type_str, buffer, + error_filename, error_lineno); if (append_string) { PUTS(append_string); } Index: php4/main/php_globals.h diff -u php4/main/php_globals.h:1.52 php4/main/php_globals.h:1.53 --- php4/main/php_globals.h:1.52 Sun Jul 2 16:46:50 2000 +++ php4/main/php_globals.h Tue Jul 4 02:15:06 2000 @@ -111,6 +111,8 @@ zend_bool y2k_compliance; + zend_bool html_errors; + zend_bool modules_activated; };

« previous php.cvs (#615) next »