22
22
#include "php.h"
23
23
#if HAVE_LIBXML && HAVE_DOM
24
24
#include "php_dom.h"
25
+ #include "dom_arginfo.h"
25
26
#include <libxml/SAX.h>
26
27
#ifdef LIBXML_SCHEMAS_ENABLED
27
28
#include <libxml/relaxng.h>
@@ -37,146 +38,6 @@ struct _idsIterator {
37
38
#define DOM_LOAD_STRING 0
38
39
#define DOM_LOAD_FILE 1
39
40
40
- /* {{{ arginfo */
41
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_create_element , 0 , 0 , 1 )
42
- ZEND_ARG_INFO (0 , tagName )
43
- ZEND_ARG_INFO (0 , value )
44
- ZEND_END_ARG_INFO ();
45
-
46
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_create_document_fragment , 0 , 0 , 0 )
47
- ZEND_END_ARG_INFO ();
48
-
49
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_create_text_node , 0 , 0 , 1 )
50
- ZEND_ARG_INFO (0 , data )
51
- ZEND_END_ARG_INFO ();
52
-
53
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_create_comment , 0 , 0 , 1 )
54
- ZEND_ARG_INFO (0 , data )
55
- ZEND_END_ARG_INFO ();
56
-
57
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_create_cdatasection , 0 , 0 , 1 )
58
- ZEND_ARG_INFO (0 , data )
59
- ZEND_END_ARG_INFO ();
60
-
61
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_create_processing_instruction , 0 , 0 , 1 )
62
- ZEND_ARG_INFO (0 , target )
63
- ZEND_ARG_INFO (0 , data )
64
- ZEND_END_ARG_INFO ();
65
-
66
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_create_attribute , 0 , 0 , 1 )
67
- ZEND_ARG_INFO (0 , name )
68
- ZEND_END_ARG_INFO ();
69
-
70
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_create_entity_reference , 0 , 0 , 1 )
71
- ZEND_ARG_INFO (0 , name )
72
- ZEND_END_ARG_INFO ();
73
-
74
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_get_elements_by_tag_name , 0 , 0 , 1 )
75
- ZEND_ARG_INFO (0 , tagName )
76
- ZEND_END_ARG_INFO ();
77
-
78
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_import_node , 0 , 0 , 1 )
79
- ZEND_ARG_OBJ_INFO (0 , importedNode , DOMNode , 0 )
80
- ZEND_ARG_INFO (0 , deep )
81
- ZEND_END_ARG_INFO ();
82
-
83
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_create_element_ns , 0 , 0 , 2 )
84
- ZEND_ARG_INFO (0 , namespaceURI )
85
- ZEND_ARG_INFO (0 , qualifiedName )
86
- ZEND_ARG_INFO (0 , value )
87
- ZEND_END_ARG_INFO ();
88
-
89
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_create_attribute_ns , 0 , 0 , 2 )
90
- ZEND_ARG_INFO (0 , namespaceURI )
91
- ZEND_ARG_INFO (0 , qualifiedName )
92
- ZEND_END_ARG_INFO ();
93
-
94
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_get_elements_by_tag_name_ns , 0 , 0 , 2 )
95
- ZEND_ARG_INFO (0 , namespaceURI )
96
- ZEND_ARG_INFO (0 , localName )
97
- ZEND_END_ARG_INFO ();
98
-
99
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_get_element_by_id , 0 , 0 , 1 )
100
- ZEND_ARG_INFO (0 , elementId )
101
- ZEND_END_ARG_INFO ();
102
-
103
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_adopt_node , 0 , 0 , 1 )
104
- ZEND_ARG_OBJ_INFO (0 , source , DOMNode , 0 )
105
- ZEND_END_ARG_INFO ();
106
-
107
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_normalize_document , 0 , 0 , 0 )
108
- ZEND_END_ARG_INFO ();
109
-
110
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_load , 0 , 0 , 1 )
111
- ZEND_ARG_INFO (0 , source )
112
- ZEND_ARG_INFO (0 , options )
113
- ZEND_END_ARG_INFO ();
114
-
115
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_save , 0 , 0 , 1 )
116
- ZEND_ARG_INFO (0 , file )
117
- ZEND_END_ARG_INFO ();
118
-
119
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_loadxml , 0 , 0 , 1 )
120
- ZEND_ARG_INFO (0 , source )
121
- ZEND_ARG_INFO (0 , options )
122
- ZEND_END_ARG_INFO ();
123
-
124
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_savexml , 0 , 0 , 0 )
125
- ZEND_ARG_OBJ_INFO (0 , node , DOMNode , 1 )
126
- ZEND_ARG_INFO (0 , options )
127
- ZEND_END_ARG_INFO ();
128
-
129
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_construct , 0 , 0 , 0 )
130
- ZEND_ARG_INFO (0 , version )
131
- ZEND_ARG_INFO (0 , encoding )
132
- ZEND_END_ARG_INFO ();
133
-
134
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_validate , 0 , 0 , 0 )
135
- ZEND_END_ARG_INFO ();
136
-
137
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_xinclude , 0 , 0 , 0 )
138
- ZEND_ARG_INFO (0 , options )
139
- ZEND_END_ARG_INFO ();
140
-
141
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_loadhtml , 0 , 0 , 1 )
142
- ZEND_ARG_INFO (0 , source )
143
- ZEND_ARG_INFO (0 , options )
144
- ZEND_END_ARG_INFO ();
145
-
146
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_loadhtmlfile , 0 , 0 , 1 )
147
- ZEND_ARG_INFO (0 , source )
148
- ZEND_ARG_INFO (0 , options )
149
- ZEND_END_ARG_INFO ();
150
-
151
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_savehtml , 0 , 0 , 0 )
152
- ZEND_END_ARG_INFO ();
153
-
154
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_savehtmlfile , 0 , 0 , 1 )
155
- ZEND_ARG_INFO (0 , file )
156
- ZEND_END_ARG_INFO ();
157
-
158
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_schema_validate_file , 0 , 0 , 1 )
159
- ZEND_ARG_INFO (0 , filename )
160
- ZEND_END_ARG_INFO ();
161
-
162
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_schema_validate_xml , 0 , 0 , 1 )
163
- ZEND_ARG_INFO (0 , source )
164
- ZEND_END_ARG_INFO ();
165
-
166
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_relaxNG_validate_file , 0 , 0 , 1 )
167
- ZEND_ARG_INFO (0 , filename )
168
- ZEND_END_ARG_INFO ();
169
-
170
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_relaxNG_validate_xml , 0 , 0 , 1 )
171
- ZEND_ARG_INFO (0 , source )
172
- ZEND_END_ARG_INFO ();
173
-
174
- ZEND_BEGIN_ARG_INFO_EX (arginfo_dom_document_registernodeclass , 0 , 0 , 2 )
175
- ZEND_ARG_INFO (0 , baseClass )
176
- ZEND_ARG_INFO (0 , extendedClass )
177
- ZEND_END_ARG_INFO ();
178
- /* }}} */
179
-
180
41
/*
181
42
* class DOMDocument extends DOMNode
182
43
*
@@ -185,42 +46,42 @@ ZEND_END_ARG_INFO();
185
46
*/
186
47
187
48
const zend_function_entry php_dom_document_class_functions [] = { /* {{{ */
188
- PHP_FALIAS (createElement , dom_document_create_element , arginfo_dom_document_create_element )
189
- PHP_FALIAS (createDocumentFragment , dom_document_create_document_fragment , arginfo_dom_document_create_document_fragment )
190
- PHP_FALIAS (createTextNode , dom_document_create_text_node , arginfo_dom_document_create_text_node )
191
- PHP_FALIAS (createComment , dom_document_create_comment , arginfo_dom_document_create_comment )
192
- PHP_FALIAS (createCDATASection , dom_document_create_cdatasection , arginfo_dom_document_create_cdatasection )
193
- PHP_FALIAS (createProcessingInstruction , dom_document_create_processing_instruction , arginfo_dom_document_create_processing_instruction )
194
- PHP_FALIAS (createAttribute , dom_document_create_attribute , arginfo_dom_document_create_attribute )
195
- PHP_FALIAS (createEntityReference , dom_document_create_entity_reference , arginfo_dom_document_create_entity_reference )
196
- PHP_FALIAS (getElementsByTagName , dom_document_get_elements_by_tag_name , arginfo_dom_document_get_elements_by_tag_name )
197
- PHP_FALIAS (importNode , dom_document_import_node , arginfo_dom_document_import_node )
198
- PHP_FALIAS (createElementNS , dom_document_create_element_ns , arginfo_dom_document_create_element_ns )
199
- PHP_FALIAS (createAttributeNS , dom_document_create_attribute_ns , arginfo_dom_document_create_attribute_ns )
200
- PHP_FALIAS (getElementsByTagNameNS , dom_document_get_elements_by_tag_name_ns , arginfo_dom_document_get_elements_by_tag_name_ns )
201
- PHP_FALIAS (getElementById , dom_document_get_element_by_id , arginfo_dom_document_get_element_by_id )
202
- PHP_FALIAS (adoptNode , dom_document_adopt_node , arginfo_dom_document_adopt_node )
203
- PHP_FALIAS (normalizeDocument , dom_document_normalize_document , arginfo_dom_document_normalize_document )
204
- PHP_ME (domdocument , load , arginfo_dom_document_load , ZEND_ACC_PUBLIC )
205
- PHP_FALIAS (save , dom_document_save , arginfo_dom_document_save )
206
- PHP_ME (domdocument , loadXML , arginfo_dom_document_loadxml , ZEND_ACC_PUBLIC )
207
- PHP_FALIAS (saveXML , dom_document_savexml , arginfo_dom_document_savexml )
208
- PHP_ME (domdocument , __construct , arginfo_dom_document_construct , ZEND_ACC_PUBLIC )
209
- PHP_FALIAS (validate , dom_document_validate , arginfo_dom_document_validate )
210
- PHP_FALIAS (xinclude , dom_document_xinclude , arginfo_dom_document_xinclude )
49
+ PHP_FALIAS (createElement , dom_document_create_element , arginfo_class_DOMDocument_createElement )
50
+ PHP_FALIAS (createDocumentFragment , dom_document_create_document_fragment , arginfo_class_DOMDocument_createDocumentFragment )
51
+ PHP_FALIAS (createTextNode , dom_document_create_text_node , arginfo_class_DOMDocument_createTextNode )
52
+ PHP_FALIAS (createComment , dom_document_create_comment , arginfo_class_DOMDocument_createComment )
53
+ PHP_FALIAS (createCDATASection , dom_document_create_cdatasection , arginfo_class_DOMDocument_createCDATASection )
54
+ PHP_FALIAS (createProcessingInstruction , dom_document_create_processing_instruction , arginfo_class_DOMDocument_createProcessingInstruction )
55
+ PHP_FALIAS (createAttribute , dom_document_create_attribute , arginfo_class_DOMDocument_createAttribute )
56
+ PHP_FALIAS (createEntityReference , dom_document_create_entity_reference , arginfo_class_DOMDocument_createEntityReference )
57
+ PHP_FALIAS (getElementsByTagName , dom_document_get_elements_by_tag_name , arginfo_class_DOMDocument_getElementsByTagName )
58
+ PHP_FALIAS (importNode , dom_document_import_node , arginfo_class_DOMDocument_importNode )
59
+ PHP_FALIAS (createElementNS , dom_document_create_element_ns , arginfo_class_DOMDocument_createElementNS )
60
+ PHP_FALIAS (createAttributeNS , dom_document_create_attribute_ns , arginfo_class_DOMDocument_createAttributeNS )
61
+ PHP_FALIAS (getElementsByTagNameNS , dom_document_get_elements_by_tag_name_ns , arginfo_class_DOMDocument_getElementsByTagNameNS )
62
+ PHP_FALIAS (getElementById , dom_document_get_element_by_id , arginfo_class_DOMDocument_getElementById )
63
+ PHP_FALIAS (adoptNode , dom_document_adopt_node , arginfo_class_DOMDocument_adoptNode )
64
+ PHP_FALIAS (normalizeDocument , dom_document_normalize_document , arginfo_class_DOMDocument_normalizeDocument )
65
+ PHP_ME (domdocument , load , arginfo_class_DOMDocument_load , ZEND_ACC_PUBLIC )
66
+ PHP_FALIAS (save , dom_document_save , arginfo_class_DOMDocument_save )
67
+ PHP_ME (domdocument , loadXML , arginfo_class_DOMDocument_loadXML , ZEND_ACC_PUBLIC )
68
+ PHP_FALIAS (saveXML , dom_document_savexml , arginfo_class_DOMDocument_saveXML )
69
+ PHP_ME (domdocument , __construct , arginfo_class_DOMDocument___construct , ZEND_ACC_PUBLIC )
70
+ PHP_FALIAS (validate , dom_document_validate , arginfo_class_DOMDocument_validate )
71
+ PHP_FALIAS (xinclude , dom_document_xinclude , arginfo_class_DOMDocument_xinclude )
211
72
#if defined(LIBXML_HTML_ENABLED )
212
- PHP_ME (domdocument , loadHTML , arginfo_dom_document_loadhtml , ZEND_ACC_PUBLIC )
213
- PHP_ME (domdocument , loadHTMLFile , arginfo_dom_document_loadhtmlfile , ZEND_ACC_PUBLIC )
214
- PHP_FALIAS (saveHTML , dom_document_save_html , arginfo_dom_document_savehtml )
215
- PHP_FALIAS (saveHTMLFile , dom_document_save_html_file , arginfo_dom_document_savehtmlfile )
73
+ PHP_ME (domdocument , loadHTML , arginfo_class_DOMDocument_loadHTML , ZEND_ACC_PUBLIC )
74
+ PHP_ME (domdocument , loadHTMLFile , arginfo_class_DOMDocument_loadHTMLFile , ZEND_ACC_PUBLIC )
75
+ PHP_FALIAS (saveHTML , dom_document_save_html , arginfo_class_DOMDocument_saveHTML )
76
+ PHP_FALIAS (saveHTMLFile , dom_document_save_html_file , arginfo_class_DOMDocument_saveHTMLFile )
216
77
#endif /* defined(LIBXML_HTML_ENABLED) */
217
78
#if defined(LIBXML_SCHEMAS_ENABLED )
218
- PHP_FALIAS (schemaValidate , dom_document_schema_validate_file , arginfo_dom_document_schema_validate_file )
219
- PHP_FALIAS (schemaValidateSource , dom_document_schema_validate_xml , arginfo_dom_document_schema_validate_xml )
220
- PHP_FALIAS (relaxNGValidate , dom_document_relaxNG_validate_file , arginfo_dom_document_relaxNG_validate_file )
221
- PHP_FALIAS (relaxNGValidateSource , dom_document_relaxNG_validate_xml , arginfo_dom_document_relaxNG_validate_xml )
79
+ PHP_FALIAS (schemaValidate , dom_document_schema_validate_file , arginfo_class_DOMDocument_schemaValidate )
80
+ PHP_FALIAS (schemaValidateSource , dom_document_schema_validate_xml , arginfo_class_DOMDocument_schemaValidateSource )
81
+ PHP_FALIAS (relaxNGValidate , dom_document_relaxNG_validate_file , arginfo_class_DOMDocument_relaxNGValidate )
82
+ PHP_FALIAS (relaxNGValidateSource , dom_document_relaxNG_validate_xml , arginfo_class_DOMDocument_relaxNGValidateSource )
222
83
#endif
223
- PHP_ME (domdocument , registerNodeClass , arginfo_dom_document_registernodeclass , ZEND_ACC_PUBLIC )
84
+ PHP_ME (domdocument , registerNodeClass , arginfo_class_DOMDocument_registerNodeClass , ZEND_ACC_PUBLIC )
224
85
PHP_FE_END
225
86
};
226
87
/* }}} */
@@ -1228,7 +1089,13 @@ Since: DOM Level 3
1228
1089
*/
1229
1090
PHP_FUNCTION (dom_document_adopt_node )
1230
1091
{
1231
- DOM_NOT_IMPLEMENTED ();
1092
+ zval * nodep = NULL ;
1093
+
1094
+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "O" , & nodep , dom_node_class_entry ) == FAILURE ) {
1095
+ return ;
1096
+ }
1097
+
1098
+ DOM_NOT_IMPLEMENTED ();
1232
1099
}
1233
1100
/* }}} end dom_document_adopt_node */
1234
1101
0 commit comments