diff options
author | Marcus Boerger <helly@php.net> | 2003-06-15 23:57:48 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-06-15 23:57:48 +0000 |
commit | e208b0e77edbb74065ba7079884127af7c90fd9b (patch) | |
tree | 305b212b3c18ae6a145622f877d700a8c498593b /ext/dom/php_dom.c | |
parent | c61492823ecb8c08b37507b2f87ccec7d7b1ab80 (diff) | |
download | php-git-e208b0e77edbb74065ba7079884127af7c90fd9b.tar.gz |
Add an error handler (thx to timm for the idea)
Diffstat (limited to 'ext/dom/php_dom.c')
-rw-r--r-- | ext/dom/php_dom.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index e205e36728..67b528e2d1 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -284,6 +284,20 @@ zend_module_entry dom_module_entry = { ZEND_GET_MODULE(dom) #endif +/* {{{ _phpXmlParserErrorCb */ +static void _phpXmlParserErrorCb(void *ctx, const char *msg, ...) { + va_list ap; + char *buf; + TSRMLS_FETCH(); + + va_start(ap, msg); + vspprintf(&buf, 0, msg, ap); + va_end(ap); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", buf); + efree(buf); +} +/* }}} */ + /* {{{ PHP_MINIT_FUNCTION(dom) */ PHP_MINIT_FUNCTION(dom) { @@ -520,6 +534,7 @@ PHP_MINIT_FUNCTION(dom) REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NOTATION", XML_ATTRIBUTE_NOTATION, CONST_CS | CONST_PERSISTENT); xmlInitParser(); + xmlSetGenericErrorFunc((void*) NULL, _phpXmlParserErrorCb); return SUCCESS; } |