1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #ifndef PHP_XSL_H
22 #define PHP_XSL_H
23
24 extern zend_module_entry xsl_module_entry;
25 #define phpext_xsl_ptr &xsl_module_entry
26
27 #ifdef ZTS
28 #include "TSRM.h"
29 #endif
30
31 #include <libxslt/xsltconfig.h>
32 #include <libxslt/xsltInternals.h>
33 #include <libxslt/xsltutils.h>
34 #include <libxslt/transform.h>
35 #include <libxslt/security.h>
36 #if HAVE_XSL_EXSLT
37 #include <libexslt/exslt.h>
38 #include <libexslt/exsltconfig.h>
39 #endif
40
41 #include "../dom/xml_common.h"
42 #include "xsl_fe.h"
43
44 #include <libxslt/extensions.h>
45 #include <libxml/xpathInternals.h>
46
47 #define XSL_SECPREF_NONE 0
48 #define XSL_SECPREF_READ_FILE 2
49 #define XSL_SECPREF_WRITE_FILE 4
50 #define XSL_SECPREF_CREATE_DIRECTORY 8
51 #define XSL_SECPREF_READ_NETWORK 16
52 #define XSL_SECPREF_WRITE_NETWORK 32
53
54 #define XSL_SECPREF_DEFAULT 44
55
56 typedef struct _xsl_object {
57 zend_object std;
58 void *ptr;
59 HashTable *prop_handler;
60 zend_object_handle handle;
61 HashTable *parameter;
62 int hasKeys;
63 int registerPhpFunctions;
64 HashTable *registered_phpfunctions;
65 HashTable *node_list;
66 php_libxml_node_object *doc;
67 char *profiling;
68 long securityPrefs;
69 int securityPrefsSet;
70 } xsl_object;
71
72 void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC);
73 void xsl_objects_free_storage(void *object TSRMLS_DC);
74 zval *php_xsl_create_object(xsltStylesheetPtr obj, int *found, zval *wrapper_in, zval *return_value TSRMLS_DC);
75
76 void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs);
77 void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs);
78
79 #define REGISTER_XSL_CLASS(ce, name, parent_ce, funcs, entry) \
80 INIT_CLASS_ENTRY(ce, name, funcs); \
81 ce.create_object = xsl_objects_new; \
82 entry = zend_register_internal_class_ex(&ce, parent_ce, NULL TSRMLS_CC);
83
84 #define XSL_DOMOBJ_NEW(zval, obj, ret) \
85 if (NULL == (zval = php_xsl_create_object(obj, ret, zval, return_value TSRMLS_CC))) { \
86 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); \
87 RETURN_FALSE; \
88 }
89
90
91
92 PHP_MINIT_FUNCTION(xsl);
93 PHP_MSHUTDOWN_FUNCTION(xsl);
94 PHP_RINIT_FUNCTION(xsl);
95 PHP_RSHUTDOWN_FUNCTION(xsl);
96 PHP_MINFO_FUNCTION(xsl);
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119 #ifdef ZTS
120 #define XSL_G(v) TSRMG(xsl_globals_id, zend_xsl_globals *, v)
121 #else
122 #define XSL_G(v) (xsl_globals.v)
123 #endif
124
125 #endif
126
127
128
129
130
131
132
133
134
135