rrichards Wed Sep 8 12:54:53 2004 EDT
Modified files: (Branch: PHP_5_0)
/php-src/ext/xslphp_xsl.c php_xsl.h xsltprocessor.c
Log:
MHF: fix issue with multiple xsl objects using registerPHPfunctions
- also fixes threading issue
http://cvs.php.net/diff.php/php-src/ext/xsl/php_xsl.c?r1=1.22.2.3r2=1.22.2.4ty=u
Index: php-src/ext/xsl/php_xsl.c
diff -u php-src/ext/xsl/php_xsl.c:1.22.2.3 php-src/ext/xsl/php_xsl.c:1.22.2.4
--- php-src/ext/xsl/php_xsl.c:1.22.2.3 Mon Aug 30 11:00:07 2004
+++ php-src/ext/xsl/php_xsl.c Wed Sep 8 12:54:53 2004
@@ -16,7 +16,7 @@
+--+
*/
-/* $Id: php_xsl.c,v 1.22.2.3 2004/08/30 15:00:07 rrichards Exp $ */
+/* $Id: php_xsl.c,v 1.22.2.4 2004/09/08 16:54:53 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include config.h
@@ -140,6 +140,13 @@
exsltRegisterAll();
#endif
+ xsltRegisterExtModuleFunction ((const xmlChar *) functionString,
+ (const xmlChar *) http://php.net/xsl;,
+ xsl_ext_function_string_php);
+ xsltRegisterExtModuleFunction ((const xmlChar *) function,
+ (const xmlChar *) http://php.net/xsl;,
+ xsl_ext_function_object_php);
+
REGISTER_LONG_CONSTANT(XSL_CLONE_AUTO, 0, CONST_CS |
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(XSL_CLONE_NEVER,-1, CONST_CS |
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(XSL_CLONE_ALWAYS,1, CONST_CS |
CONST_PERSISTENT);
@@ -226,6 +233,12 @@
/* uncomment this line if you have INI entries
UNREGISTER_INI_ENTRIES();
*/
+
+ xsltUnregisterExtModuleFunction ((const xmlChar *) functionString,
+ (const xmlChar *) http://php.net/xsl;);
+ xsltUnregisterExtModuleFunction ((const xmlChar *) function,
+ (const xmlChar *) http://php.net/xsl;);
+
xsltCleanupGlobals();
return SUCCESS;
http://cvs.php.net/diff.php/php-src/ext/xsl/php_xsl.h?r1=1.10.2.1r2=1.10.2.2ty=u
Index: php-src/ext/xsl/php_xsl.h
diff -u php-src/ext/xsl/php_xsl.h:1.10.2.1 php-src/ext/xsl/php_xsl.h:1.10.2.2
--- php-src/ext/xsl/php_xsl.h:1.10.2.1 Wed Jul 28 08:42:16 2004
+++ php-src/ext/xsl/php_xsl.h Wed Sep 8 12:54:53 2004
@@ -16,7 +16,7 @@
+--+
*/
-/* $Id: php_xsl.h,v 1.10.2.1 2004/07/28 12:42:16 chregu Exp $ */
+/* $Id: php_xsl.h,v 1.10.2.2 2004/09/08 16:54:53 rrichards Exp $ */
#ifndef PHP_XSL_H
#define PHP_XSL_H
@@ -63,6 +63,9 @@
void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC);
void xsl_objects_free_storage(void *object TSRMLS_DC);
zval *php_xsl_create_object(xsltStylesheetPtr obj, int *found, zval *wrapper_in, zval
*return_value TSRMLS_DC);
+
+void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs);
+void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs);
#define REGISTER_XSL_CLASS(ce, name, parent_ce, funcs, entry) \
INIT_CLASS_ENTRY(ce, name, funcs); \
http://cvs.php.net/diff.php/php-src/ext/xsl/xsltprocessor.c?r1=1.29.2.3r2=1.29.2.4ty=u
Index: php-src/ext/xsl/xsltprocessor.c
diff -u php-src/ext/xsl/xsltprocessor.c:1.29.2.3
php-src/ext/xsl/xsltprocessor.c:1.29.2.4
--- php-src/ext/xsl/xsltprocessor.c:1.29.2.3Tue Aug 10 04:02:00 2004
+++ php-src/ext/xsl/xsltprocessor.c Wed Sep 8 12:54:53 2004
@@ -17,7 +17,7 @@
+--+
*/
-/* $Id: xsltprocessor.c,v 1.29.2.3 2004/08/10 08:02:00 chregu Exp $ */
+/* $Id: xsltprocessor.c,v 1.29.2.4 2004/09/08 16:54:53 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include config.h
@@ -27,9 +27,6 @@
#include php_xsl.h
#include ext/libxml/php_libxml.h
-static void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs);
-static void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs);
-
/*
* class xsl_xsltprocessor
*
@@ -76,13 +73,6 @@
return (char *) value;
}
-static void php_xsl_unregister_php_functions() {
- xsltUnregisterExtModuleFunction ((const xmlChar *) functionString,
- (const xmlChar *) http://php.net/xsl;);
- xsltUnregisterExtModuleFunction ((const xmlChar *) function,
- (const xmlChar *) http://php.net/xsl;);
-}
-
/* {{{ php_xsl_xslt_make_params()
Translates a PHP array to a libxslt parameters array */
@@ -139,6 +129,7 @@
zval **args;
zval *retval;
int result, i, ret;
+ int error = 0;
zend_fcall_info fci;
zval handler;
xmlXPathObjectPtr obj;
@@ -148,17 +139,43 @@
TSRMLS_FETCH();
+ if (! zend_is_executing(TSRMLS_C)) {
+ xsltGenericError(xsltGenericErrorContext,
+