summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-04-27 18:37:02 +0000
committerZeev Suraski <zeev@php.net>2000-04-27 18:37:02 +0000
commit39aa59bdecad946203481dfd13fd8808d3f09425 (patch)
treee8717f4282e7a01c70861a31b2f1976420c5410e
parent095f1d91b178ade6bdf629f020369df9cee19ceb (diff)
downloadphp-git-39aa59bdecad946203481dfd13fd8808d3f09425.tar.gz
More error handling work (still completely disabled)
-rw-r--r--ext/standard/info.c2
-rw-r--r--main/main.c23
-rw-r--r--main/php.h9
-rw-r--r--php4dll.dsp8
4 files changed, 37 insertions, 5 deletions
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 9a266c0238..bc6c633433 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -208,7 +208,7 @@ PHPAPI void php_print_info(int flag)
}
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();
}
diff --git a/main/main.c b/main/main.c
index 185f189004..1c61350c62 100644
--- a/main/main.c
+++ b/main/main.c
@@ -298,17 +298,24 @@ PHPAPI int php_printf(const char *format, ...)
/* 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 @@ PHPAPI void php_error(int type, const char *format, ...)
if (!error_filename) {
error_filename = "Unknown";
}
+#endif
if (EG(error_reporting) & type || (type & E_CORE)) {
char *error_type_str;
@@ -377,7 +385,11 @@ PHPAPI void php_error(int type, const char *format, ...)
/* 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 @@ PHPAPI void php_error(int type, const char *format, ...)
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 @@ int php_module_startup(sapi_module_struct *sf)
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;
diff --git a/main/php.h b/main/php.h
index b7867bfcbf..326bbfc7e8 100644
--- a/main/php.h
+++ b/main/php.h
@@ -242,13 +242,20 @@ extern char **environ;
#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);
#define zenderror phperror
diff --git a/php4dll.dsp b/php4dll.dsp
index 9632871a8c..9e9386b14d 100644
--- a/php4dll.dsp
+++ b/php4dll.dsp
@@ -191,6 +191,10 @@ SOURCE=.\php_variables.c
# 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
@@ -291,6 +295,10 @@ SOURCE=.\php_variables.h
# End Source File
# Begin Source File
+SOURCE=.\php_virtual_cwd.h
+# End Source File
+# Begin Source File
+
SOURCE=.\ext\standard\quot_print.h
# End Source File
# Begin Source File