From b7cf6f4539fa315b5758cac319472bda11c79094 Mon Sep 17 00:00:00 2001 From: Rob Richards Date: Sun, 20 Feb 2005 21:49:45 +0000 Subject: [PATCH] add function to allow extensions to use new error handling if set by user --- ext/libxml/libxml.c | 9 +++++++++ ext/libxml/php_libxml.h | 1 + 2 files changed, 10 insertions(+) diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 0099759fb3..1e2d1c3c52 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -388,6 +388,15 @@ static void php_libxml_ctx_error_level(int level, void *ctx, const char *msg TSR } } +void php_libxml_issue_error(int level, const char *msg TSRMLS_DC) +{ + if (LIBXML(error_list)) { + _php_list_set_error_structure(NULL, msg); + } else { + php_error_docref(NULL TSRMLS_CC, level, "%s", msg); + } +} + static void php_libxml_internal_error_handler(int error_type, void *ctx, const char **msg, va_list ap) { char *buf; diff --git a/ext/libxml/php_libxml.h b/ext/libxml/php_libxml.h index 8c719402c9..429b6498d7 100644 --- a/ext/libxml/php_libxml.h +++ b/ext/libxml/php_libxml.h @@ -88,6 +88,7 @@ void php_libxml_ctx_warning(void *ctx, const char *msg, ...); void php_libxml_ctx_error(void *ctx, const char *msg, ...); PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s); PHP_LIBXML_API zval *php_libxml_switch_context(zval *context TSRMLS_DC); +PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg TSRMLS_DC); #endif /* HAVE_LIBXML */ -- 2.40.0