cvs: /php4 main.c php.h php4dll.dsp /php4/ext/standard info.c

From: Date: Thu, 27 Apr 2000 18:37:32 +0000
Subject: cvs: /php4 main.c php.h php4dll.dsp /php4/ext/standard info.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-14118@lists.php.net to get a copy of this message
zeev Thu Apr 27 11:37:32 2000 EDT Modified files: /php4 main.c php.h php4dll.dsp /php4/ext/standard info.c Log: More error handling work (still completely disabled) Index: php4/main.c diff -u php4/main.c:1.237 php4/main.c:1.238 --- php4/main.c:1.237 Wed Apr 19 16:17:56 2000 +++ php4/main.c Thu Apr 27 11:37:01 2000 @@ -19,7 +19,7 @@ */ -/* $Id: main.c,v 1.237 2000/04/19 23:17:56 cmv Exp $ */ +/* $Id: main.c,v 1.238 2000/04/27 18:37:01 zeev Exp $ */ #include <stdio.h> @@ -298,17 +298,24 @@ /* extended error handling function */ -PHPAPI void php_error(int type, const char *format, ...) +#if ZEND_NEW_ERROR_HANDLING +static void php_error_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list orig_args) +#else +PHPAPI void php_error_cb(int type, const char *format, ...) +#endif { - va_list args; +#if !ZEND_NEW_ERROR_HANDLING char *error_filename = NULL; uint error_lineno; +#endif char buffer[1024]; int size = 0; + va_list args; CLS_FETCH(); ELS_FETCH(); PLS_FETCH(); +#if !ZEND_NEW_ERROR_HANDLING switch (type) { case E_CORE_ERROR: case E_CORE_WARNING: @@ -344,6 +351,7 @@ if (!error_filename) { error_filename = "Unknown"; } +#endif if (EG(error_reporting) & type || (type & E_CORE)) { char *error_type_str; @@ -377,7 +385,11 @@ /* get include file name */ if (PG(log_errors) || PG(display_errors) || (!module_initialized)) { +#if ZEND_NEW_ERROR_HANDLING + args = orig_args; +#else va_start(args, format); +#endif size = vsnprintf(buffer, sizeof(buffer) - 1, format, args); va_end(args); buffer[sizeof(buffer) - 1] = 0; @@ -419,9 +431,14 @@ if (PG(track_errors)) { pval *tmp; +#if ZEND_NEW_ERROR_HANDLING + args = orig_args; +#else va_start(args, format); +#endif size = vsnprintf(buffer, sizeof(buffer) - 1, format, args); va_end(args); + buffer[sizeof(buffer) - 1] = 0; ALLOC_ZVAL(tmp); @@ -812,7 +829,7 @@ php_output_startup(); - zuf.error_function = php_error; + zuf.error_function = php_error_cb; zuf.printf_function = php_printf; zuf.write_function = php_body_write_wrapper; zuf.fopen_function = php_fopen_wrapper_for_zend; Index: php4/php.h diff -u php4/php.h:1.86 php4/php.h:1.87 --- php4/php.h:1.86 Thu Apr 20 10:58:25 2000 +++ php4/php.h Thu Apr 27 11:37:02 2000 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php.h,v 1.86 2000/04/20 17:58:25 andi Exp $ */ +/* $Id: php.h,v 1.87 2000/04/27 18:37:02 zeev Exp $ */ #ifndef _PHP_H #define _PHP_H @@ -242,12 +242,19 @@ #endif extern void phperror(char *error); -extern PHPAPI void php_error(int type, const char *format, ...); extern PHPAPI int php_write(void *buf, int size); extern PHPAPI int php_printf(const char *format, ...); extern void php_log_err(char *log_message); extern int Debug(char *format, ...); extern int cfgparse(void); + +#if ZEND_NEW_ERROR_HANDLING +#define php_error zend_error +#else +extern PHPAPI void php_error_cb(int type, const char *format, ...); +#define php_error php_error_cb +#endif + extern void html_putc(char c); Index: php4/php4dll.dsp diff -u php4/php4dll.dsp:1.41 php4/php4dll.dsp:1.42 --- php4/php4dll.dsp:1.41 Thu Apr 13 09:08:49 2000 +++ php4/php4dll.dsp Thu Apr 27 11:37:02 2000 @@ -191,6 +191,10 @@ # End Source File # Begin Source File +SOURCE=.\php_virtual_cwd.c +# End Source File +# Begin Source File + SOURCE=.\ext\standard\quot_print.c # End Source File # Begin Source File @@ -288,6 +292,10 @@ # Begin Source File SOURCE=.\php_variables.h +# End Source File +# Begin Source File + +SOURCE=.\php_virtual_cwd.h # End Source File # Begin Source File Index: php4/ext/standard/info.c diff -u php4/ext/standard/info.c:1.87 php4/ext/standard/info.c:1.88 --- php4/ext/standard/info.c:1.87 Fri Apr 21 09:20:11 2000 +++ php4/ext/standard/info.c Thu Apr 27 11:37:02 2000 @@ -208,7 +208,7 @@ } PUTS("?=PHPE9568F35-D428-11d2-A769-00AA001ACF42\" border=\"0\" align=\"right\"></a>\n"); } - php_printf("This program makes use of the Zend scripting language engine:<BR>%s<BR>\n", get_zend_version()); + php_printf("This program makes use of the Zend scripting language engine:<pre>%s</pre>\n", get_zend_version()); php_info_print_box_end(); }

« previous php.version4 (#14118) next »