summaryrefslogtreecommitdiff
path: root/ext/libxml
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2004-04-23 17:31:44 +0000
committerRob Richards <rrichards@php.net>2004-04-23 17:31:44 +0000
commit838d30a5cdad56b973c6e220d4d1599e4e0fa2c5 (patch)
tree42633d40cc13c8ef1911dd2cf24d6ee7a6e4c038 /ext/libxml
parent7a11fe48b675f334ab294ef659466746846f756d (diff)
downloadphp-git-838d30a5cdad56b973c6e220d4d1599e4e0fa2c5.tar.gz
move libxml error handler ro rinit/rshutdown to keep it local to php
Diffstat (limited to 'ext/libxml')
-rw-r--r--ext/libxml/libxml.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index 77a3df64a3..a6e68a21df 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -400,9 +400,6 @@ PHP_LIBXML_API void php_libxml_initialize() {
php_libxml_streams_IO_write,
php_libxml_streams_IO_close);
- /* report errors via handler rather than stderr */
- xmlSetGenericErrorFunc(NULL, php_libxml_error_handler);
-
zend_hash_init(&php_libxml_exports, 0, NULL, NULL, 1);
_php_libxml_initialized = 1;
@@ -411,8 +408,6 @@ PHP_LIBXML_API void php_libxml_initialize() {
PHP_LIBXML_API void php_libxml_shutdown() {
if (_php_libxml_initialized) {
- /* reset libxml generic error handling */
- xmlSetGenericErrorFunc(NULL, NULL);
xmlCleanupParser();
zend_hash_destroy(&php_libxml_exports);
_php_libxml_initialized = 0;
@@ -436,6 +431,9 @@ PHP_MINIT_FUNCTION(libxml)
PHP_RINIT_FUNCTION(libxml)
{
+ /* report errors via handler rather than stderr */
+ xmlSetGenericErrorFunc(NULL, php_libxml_error_handler);
+
return SUCCESS;
}
@@ -450,6 +448,9 @@ PHP_MSHUTDOWN_FUNCTION(libxml)
PHP_RSHUTDOWN_FUNCTION(libxml)
{
+ /* reset libxml generic error handling */
+ xmlSetGenericErrorFunc(NULL, NULL);
+
smart_str_free(&LIBXML(error_buffer));
return SUCCESS;
}