diff options
Diffstat (limited to 'ext/xsl/xsltprocessor.c')
-rw-r--r-- | ext/xsl/xsltprocessor.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index 46b9d720ac..3def1c65a9 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -28,46 +28,56 @@ #include "ext/libxml/php_libxml.h" /* {{{ arginfo */ +static ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_import_stylesheet, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, doc, DOMDocument, 0) ZEND_END_ARG_INFO(); +static ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_transform_to_doc, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, doc, DOMNode, 0) ZEND_END_ARG_INFO(); +static ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_transform_to_uri, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, doc, DOMDocument, 0) ZEND_ARG_INFO(0, uri) ZEND_END_ARG_INFO(); +static ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_transform_to_xml, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, doc, DOMDocument, 0) ZEND_END_ARG_INFO(); +static ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_set_parameter, 0, 0, 2) ZEND_ARG_INFO(0, namespace) ZEND_ARG_INFO(0, name) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO(); +static ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_get_parameter, 0, 0, 2) ZEND_ARG_INFO(0, namespace) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO(); +static ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_remove_parameter, 0, 0, 2) ZEND_ARG_INFO(0, namespace) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO(); +static ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_has_exslt_support, 0, 0, 0) ZEND_END_ARG_INFO(); +static ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_register_php_functions, 0, 0, 0) ZEND_ARG_INFO(0, restrict) ZEND_END_ARG_INFO(); +static ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_set_profiling, 0, 0, 1) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO(); @@ -306,7 +316,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t fci.function_name = &handler; fci.symbol_table = NULL; - fci.object_ptr = NULL; + fci.object_pp = NULL; fci.retval_ptr_ptr = &retval; fci.no_separation = 0; /*fci.function_handler_cache = &function_ptr;*/ @@ -544,6 +554,10 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl php_libxml_decrement_doc_ref(intern->doc TSRMLS_CC); efree(intern->doc); intern->doc = NULL; + + if (intern->profiling) { + efree(intern->profiling); + } if (params) { clone = 0; @@ -835,20 +849,13 @@ PHP_FUNCTION(xsl_xsltprocessor_set_profiling) { zval *id; xsl_object *intern; - char *filename = NULL; + char *filename; int filename_len; DOM_GET_THIS(id); - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s!", &filename, &filename_len) == SUCCESS) { + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == SUCCESS) { intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern->profiling) { - efree(intern->profiling); - } - if (filename != NULL) { - intern->profiling = estrndup(filename,filename_len); - } else { - intern->profiling = NULL; - } + intern->profiling = estrndup(filename,filename_len); RETURN_TRUE; } else { WRONG_PARAM_COUNT; |