diff options
author | Rob Richards <rrichards@php.net> | 2003-06-09 20:24:16 +0000 |
---|---|---|
committer | Rob Richards <rrichards@php.net> | 2003-06-09 20:24:16 +0000 |
commit | f2957721af2795a2d72116e736647796cdc9bceb (patch) | |
tree | 4ed4703647dddaf08532c1d1d4a3e39cf9e83f05 /ext | |
parent | 6d72c89408234b954e7440e132b50474b9872d72 (diff) | |
download | php-git-f2957721af2795a2d72116e736647796cdc9bceb.tar.gz |
changes for /ext/dom document ref count
changes for /ext/dom internal object handling
Diffstat (limited to 'ext')
-rw-r--r-- | ext/xsl/php_xsl.c | 3 | ||||
-rw-r--r-- | ext/xsl/php_xsl.h | 3 | ||||
-rw-r--r-- | ext/xsl/xsltprocessor.c | 27 |
3 files changed, 21 insertions, 12 deletions
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c index c6ab3bf9d3..690e391221 100644 --- a/ext/xsl/php_xsl.c +++ b/ext/xsl/php_xsl.c @@ -127,9 +127,9 @@ zend_object_value xsl_objects_new(zend_class_entry *class_type TSRMLS_DC) intern->std.in_get = 0; intern->std.in_set = 0; intern->ptr = NULL; - intern->node_list = NULL; intern->prop_handler = NULL; intern->parameter = NULL; + intern->document = NULL; base_class = class_type; while(base_class->type != ZEND_INTERNAL_CLASS && base_class->parent != NULL) { @@ -144,6 +144,7 @@ zend_object_value xsl_objects_new(zend_class_entry *class_type TSRMLS_DC) ALLOC_HASHTABLE(intern->parameter); zend_hash_init(intern->parameter, 0, NULL, ZVAL_PTR_DTOR, 0); retval.handle = zend_objects_store_put(intern, xsl_objects_dtor, dom_objects_clone TSRMLS_CC); + intern->handle = retval.handle; retval.handlers = &dom_object_handlers; return retval; } diff --git a/ext/xsl/php_xsl.h b/ext/xsl/php_xsl.h index 2362fb3052..a754f3993d 100644 --- a/ext/xsl/php_xsl.h +++ b/ext/xsl/php_xsl.h @@ -45,8 +45,9 @@ extern zend_module_entry xsl_module_entry; typedef struct _xsl_object { zend_object std; void *ptr; + dom_ref_obj *document; HashTable *prop_handler; - node_list_pointer *node_list; + zend_object_handle handle; HashTable *parameter; } xsl_object; diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index cd59756a3b..dc74d6e735 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -128,13 +128,14 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet) xsltStylesheetPtr sheetp, oldsheetp; xmlDocPtr newdocp; xsl_object *intern; + dom_object *docobj; DOM_GET_THIS(id); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &docp) == FAILURE) { RETURN_FALSE; } - DOM_GET_OBJ(doc, docp, xmlDocPtr); + DOM_GET_OBJ(doc, docp, xmlDocPtr, docobj); /* copy the doc, so that it's not accessable from outside FIXME: and doubling memory consumption... */ @@ -175,14 +176,17 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc) int ret; char **params = NULL; xsl_object *intern; + dom_object *docobj; - DOM_GET_THIS_OBJ(sheetp, id, xsltStylesheetPtr); - + id = getThis(); + intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); + sheetp = (xsltStylesheetPtr) intern->ptr; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &docp) == FAILURE) { RETURN_FALSE; } - DOM_GET_OBJ(doc, docp, xmlDocPtr); - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); + DOM_GET_OBJ(doc, docp, xmlDocPtr, docobj); + if (intern->parameter) { params = php_xsl_xslt_make_params(intern->parameter, 0 TSRMLS_CC); } @@ -193,7 +197,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc) } if (newdocp) { - DOM_RET_OBJ(rv, (xmlNodePtr) newdocp, &ret); + DOM_RET_OBJ(rv, (xmlNodePtr) newdocp, &ret, NULL); } else { RETURN_FALSE; } @@ -224,14 +228,17 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml) int doc_txt_len; char **params = NULL; xsl_object *intern; + dom_object *docobj; - DOM_GET_THIS_OBJ(sheetp, id, xsltStylesheetPtr); - + id = getThis(); + intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); + sheetp = (xsltStylesheetPtr) intern->ptr; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &docp) == FAILURE) { RETURN_FALSE; } - DOM_GET_OBJ(doc, docp, xmlDocPtr); - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); + DOM_GET_OBJ(doc, docp, xmlDocPtr, docobj); + if (intern->parameter) { params = php_xsl_xslt_make_params(intern->parameter, 0 TSRMLS_CC); } |