diff options
author | Christian Stocker <chregu@php.net> | 2002-05-10 14:59:14 +0000 |
---|---|---|
committer | Christian Stocker <chregu@php.net> | 2002-05-10 14:59:14 +0000 |
commit | 827a769c281c6fc678460bea5ecca6d4699043ea (patch) | |
tree | 1a63393abd73278ff190bbb8eaf9d58484645c85 /ext/domxml/php_domxml.c | |
parent | dc0bc97969a0fc47f0fef0dcbce9a5876c20d33d (diff) | |
download | php-git-827a769c281c6fc678460bea5ecca6d4699043ea.tar.gz |
@- added fifth optional parameter to domxml_xslt_process. If set,
it will output profiling information to the file stated (chregu)
- introduced version numbering for this extension
Diffstat (limited to 'ext/domxml/php_domxml.c')
-rw-r--r-- | ext/domxml/php_domxml.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index bdbfdf223c..69ccca0358 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -455,7 +455,7 @@ zend_module_entry domxml_module_entry = { PHP_RINIT(domxml), NULL, PHP_MINFO(domxml), - NO_VERSION_YET, + "20020510", //Extension versionnumber STANDARD_MODULE_PROPERTIES }; @@ -4257,7 +4257,7 @@ static char **php_domxslt_make_params(zval *idvars, int xpath_params TSRMLS_DC) return params; } -/* {{{ proto object domxml_xslt_process(object xslstylesheet, object xmldoc [, array xslt_parameters [, bool xpath_parameters]]) +/* {{{ proto object domxml_xslt_process(object xslstylesheet, object xmldoc [, array xslt_parameters [, bool xpath_parameters [, string profileFilename]]]) Perform an XSLT transformation */ PHP_FUNCTION(domxml_xslt_process) { @@ -4273,6 +4273,8 @@ PHP_FUNCTION(domxml_xslt_process) xmlDocPtr docp; char **params = NULL; int ret; + char *filename; + int filename_len = 0; DOMXML_GET_THIS(idxsl); @@ -4283,7 +4285,7 @@ PHP_FUNCTION(domxml_xslt_process) RETURN_FALSE; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|ab", &idxml, &idparams, &xpath_params) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|abs", &idxml, &idparams, &xpath_params, &filename, &filename_len) == FAILURE) { RETURN_FALSE; } @@ -4293,7 +4295,14 @@ PHP_FUNCTION(domxml_xslt_process) params = php_domxslt_make_params(idparams, xpath_params TSRMLS_CC); } - docp = xsltApplyStylesheet(xsltstp, xmldocp, (const char**)params); + if (filename_len) { + FILE *f; + f = fopen (filename,"w"); + docp = xsltProfileStylesheet(xsltstp, xmldocp, (const char**)params, f); + fclose(f); + } else { + docp = xsltApplyStylesheet(xsltstp, xmldocp, (const char**)params); + } if (params) { efree(params); |