diff options
author | Zeev Suraski <zeev@php.net> | 2000-06-02 12:35:53 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2000-06-02 12:35:53 +0000 |
commit | 06388f5181b6b5389a1aaab1fedb90b0b267e064 (patch) | |
tree | 521c33d2e7917aeaf069dd70152451b6d73120a4 /main/main.c | |
parent | ab36e22aebb8c87cf38d4f1dd78ea7d0682284a1 (diff) | |
download | php-git-06388f5181b6b5389a1aaab1fedb90b0b267e064.tar.gz |
Use the new error code
@- Added set_error_handler() to allow custom error handling functions,
@ instead of the built-in error handling code (Zeev, Zend Engine)
@- Renamed user_error() to trigger_error(); user_error() remains
@ defined for compatibility (Zeev, Zend Engine)
Diffstat (limited to 'main/main.c')
-rw-r--r-- | main/main.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/main/main.c b/main/main.c index 3b82c488bb..2aee2042d0 100644 --- a/main/main.c +++ b/main/main.c @@ -319,16 +319,8 @@ PHPAPI int php_printf(const char *format, ...) /* extended error handling function */ -#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 { -#if !ZEND_NEW_ERROR_HANDLING - char *error_filename = NULL; - uint error_lineno; -#endif char buffer[1024]; int size = 0; va_list args; @@ -336,43 +328,6 @@ PHPAPI void php_error_cb(int type, const char *format, ...) ELS_FETCH(); PLS_FETCH(); -#if !ZEND_NEW_ERROR_HANDLING - switch (type) { - case E_CORE_ERROR: - case E_CORE_WARNING: - error_filename = NULL; - error_lineno = 0; - break; - case E_PARSE: - case E_COMPILE_ERROR: - case E_COMPILE_WARNING: - case E_ERROR: - case E_NOTICE: - case E_WARNING: - case E_USER_ERROR: - case E_USER_WARNING: - case E_USER_NOTICE: - if (zend_is_compiling()) { - error_filename = zend_get_compiled_filename(CLS_C); - error_lineno = zend_get_compiled_lineno(CLS_C); - } else if (zend_is_executing()) { - error_filename = zend_get_executed_filename(ELS_C); - error_lineno = zend_get_executed_lineno(ELS_C); - } else { - error_filename = NULL; - error_lineno = 0; - } - break; - default: - error_filename = NULL; - error_lineno = 0; - break; - } - - if (!error_filename) { - error_filename = "Unknown"; - } -#endif if (EG(error_reporting) & type || (type & E_CORE)) { char *error_type_str; @@ -406,11 +361,7 @@ PHPAPI void php_error_cb(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; @@ -452,11 +403,7 @@ PHPAPI void php_error_cb(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); |