summaryrefslogtreecommitdiff
path: root/ext/libxml/libxml.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2014-04-21 14:14:00 +0800
committerXinchen Hui <laruence@gmail.com>2014-04-21 14:14:00 +0800
commite48b9ad197b4ec6ac72e75538453cc350d0a41f4 (patch)
treef5ded37abc65e64e270b6f1ac264db9bc603f949 /ext/libxml/libxml.c
parentcf7e703813e065fec7a8a5caa7aff4b70d3455b8 (diff)
parent54d9ad53f4797733b41bf2c65bd2c2cb5a1938b6 (diff)
downloadphp-git-e48b9ad197b4ec6ac72e75538453cc350d0a41f4.tar.gz
Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2
Diffstat (limited to 'ext/libxml/libxml.c')
-rw-r--r--ext/libxml/libxml.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index 705045eee4..cfa339fe24 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -86,6 +86,7 @@ ZEND_GET_MODULE(libxml)
/* {{{ function prototypes */
static PHP_MINIT_FUNCTION(libxml);
static PHP_RINIT_FUNCTION(libxml);
+static PHP_RSHUTDOWN_FUNCTION(libxml);
static PHP_MSHUTDOWN_FUNCTION(libxml);
static PHP_MINFO_FUNCTION(libxml);
static int php_libxml_post_deactivate();
@@ -138,7 +139,7 @@ zend_module_entry libxml_module_entry = {
PHP_MINIT(libxml), /* extension-wide startup function */
PHP_MSHUTDOWN(libxml), /* extension-wide shutdown function */
PHP_RINIT(libxml), /* per-request startup function */
- NULL, /* per-request shutdown function */
+ PHP_RSHUTDOWN(libxml), /* per-request shutdown function */
PHP_MINFO(libxml), /* information function */
NO_VERSION_YET,
PHP_MODULE_GLOBALS(libxml), /* globals descriptor */
@@ -588,7 +589,7 @@ static xmlParserInputPtr _php_libxml_external_entity_loader(const char *URL,
if (context->memb == NULL) { \
add_assoc_null_ex(ctxzv, #memb, sizeof(#memb) - 1); \
} else { \
- add_assoc_string_ex(ctxzv, #memb, sizeof(#memb - 1), \
+ add_assoc_string_ex(ctxzv, #memb, sizeof(#memb) - 1, \
(char *)context->memb); \
}
@@ -862,6 +863,12 @@ static PHP_RINIT_FUNCTION(libxml)
return SUCCESS;
}
+static PHP_RSHUTDOWN_FUNCTION(libxml)
+{
+ _php_libxml_destroy_fci(&LIBXML(entity_loader).fci, &LIBXML(entity_loader).object);
+
+ return SUCCESS;
+}
static PHP_MSHUTDOWN_FUNCTION(libxml)
{
@@ -898,8 +905,6 @@ static int php_libxml_post_deactivate()
}
xmlResetLastError();
- _php_libxml_destroy_fci(&LIBXML(entity_loader).fci, &LIBXML(entity_loader).object);
-
return SUCCESS;
}
@@ -1152,7 +1157,7 @@ PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC)
while (ce->parent != NULL) {
ce = ce->parent;
}
- if ((export_hnd = zend_hash_find_ptr(&php_libxml_exports, ce->name)) == SUCCESS) {
+ if ((export_hnd = zend_hash_find_ptr(&php_libxml_exports, ce->name))) {
node = export_hnd->export_func(object TSRMLS_CC);
}
}