@@ -187,10 +187,10 @@ ZEND_END_ARG_INFO();
187
187
/* }}} */
188
188
189
189
/*
190
- * class DOMDocument extends DOMNode
190
+ * class DOMDocument extends DOMNode
191
191
*
192
192
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-i-Document
193
- * Since:
193
+ * Since:
194
194
*/
195
195
196
196
const zend_function_entry php_dom_document_class_functions [] = { /* {{{ */
@@ -235,10 +235,10 @@ const zend_function_entry php_dom_document_class_functions[] = { /* {{{ */
235
235
};
236
236
/* }}} */
237
237
238
- /* {{{ docType DOMDocumentType
239
- readonly=yes
238
+ /* {{{ docType DOMDocumentType
239
+ readonly=yes
240
240
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-B63ED1A31
241
- Since:
241
+ Since:
242
242
*/
243
243
int dom_document_doctype_read (dom_object * obj , zval * * retval TSRMLS_DC )
244
244
{
@@ -266,15 +266,15 @@ int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC)
266
266
return FAILURE ;
267
267
}
268
268
return SUCCESS ;
269
-
269
+
270
270
}
271
271
272
272
/* }}} */
273
273
274
- /* {{{ implementation DOMImplementation
275
- readonly=yes
274
+ /* {{{ implementation DOMImplementation
275
+ readonly=yes
276
276
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1B793EBA
277
- Since:
277
+ Since:
278
278
*/
279
279
int dom_document_implementation_read (dom_object * obj , zval * * retval TSRMLS_DC )
280
280
{
@@ -285,10 +285,10 @@ int dom_document_implementation_read(dom_object *obj, zval **retval TSRMLS_DC)
285
285
286
286
/* }}} */
287
287
288
- /* {{{ documentElement DOMElement
289
- readonly=yes
288
+ /* {{{ documentElement DOMElement
289
+ readonly=yes
290
290
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-87CD092
291
- Since:
291
+ Since:
292
292
*/
293
293
int dom_document_document_element_read (dom_object * obj , zval * * retval TSRMLS_DC )
294
294
{
@@ -391,8 +391,8 @@ int dom_document_encoding_write(dom_object *obj, zval *newval TSRMLS_DC)
391
391
392
392
/* }}} */
393
393
394
- /* {{{ standalone boolean
395
- readonly=no
394
+ /* {{{ standalone boolean
395
+ readonly=no
396
396
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-standalone
397
397
Since: DOM Level 3
398
398
*/
@@ -455,7 +455,7 @@ int dom_document_standalone_write(dom_object *obj, zval *newval TSRMLS_DC)
455
455
456
456
/* }}} */
457
457
458
- /* {{{ version string
458
+ /* {{{ version string
459
459
readonly=no
460
460
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-version
461
461
Since: DOM Level 3
@@ -520,8 +520,8 @@ int dom_document_version_write(dom_object *obj, zval *newval TSRMLS_DC)
520
520
521
521
/* }}} */
522
522
523
- /* {{{ strictErrorChecking boolean
524
- readonly=no
523
+ /* {{{ strictErrorChecking boolean
524
+ readonly=no
525
525
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-strictErrorChecking
526
526
Since: DOM Level 3
527
527
*/
@@ -565,7 +565,7 @@ int dom_document_strict_error_checking_write(dom_object *obj, zval *newval TSRML
565
565
566
566
/* }}} */
567
567
568
- /* {{{ formatOutput boolean
568
+ /* {{{ formatOutput boolean
569
569
readonly=no
570
570
*/
571
571
int dom_document_format_output_read (dom_object * obj , zval * * retval TSRMLS_DC )
@@ -607,7 +607,7 @@ int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC)
607
607
}
608
608
/* }}} */
609
609
610
- /* {{{ validateOnParse boolean
610
+ /* {{{ validateOnParse boolean
611
611
readonly=no
612
612
*/
613
613
int dom_document_validate_on_parse_read (dom_object * obj , zval * * retval TSRMLS_DC )
@@ -649,7 +649,7 @@ int dom_document_validate_on_parse_write(dom_object *obj, zval *newval TSRMLS_DC
649
649
}
650
650
/* }}} */
651
651
652
- /* {{{ resolveExternals boolean
652
+ /* {{{ resolveExternals boolean
653
653
readonly=no
654
654
*/
655
655
int dom_document_resolve_externals_read (dom_object * obj , zval * * retval TSRMLS_DC )
@@ -691,7 +691,7 @@ int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC
691
691
}
692
692
/* }}} */
693
693
694
- /* {{{ preserveWhiteSpace boolean
694
+ /* {{{ preserveWhiteSpace boolean
695
695
readonly=no
696
696
*/
697
697
int dom_document_preserve_whitespace_read (dom_object * obj , zval * * retval TSRMLS_DC )
@@ -733,7 +733,7 @@ int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_
733
733
}
734
734
/* }}} */
735
735
736
- /* {{{ recover boolean
736
+ /* {{{ recover boolean
737
737
readonly=no
738
738
*/
739
739
int dom_document_recover_read (dom_object * obj , zval * * retval TSRMLS_DC )
@@ -775,7 +775,7 @@ int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC)
775
775
}
776
776
/* }}} */
777
777
778
- /* {{{ substituteEntities boolean
778
+ /* {{{ substituteEntities boolean
779
779
readonly=no
780
780
*/
781
781
int dom_document_substitue_entities_read (dom_object * obj , zval * * retval TSRMLS_DC )
@@ -817,8 +817,8 @@ int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_D
817
817
}
818
818
/* }}} */
819
819
820
- /* {{{ documentURI string
821
- readonly=no
820
+ /* {{{ documentURI string
821
+ readonly=no
822
822
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-documentURI
823
823
Since: DOM Level 3
824
824
*/
@@ -881,8 +881,8 @@ int dom_document_document_uri_write(dom_object *obj, zval *newval TSRMLS_DC)
881
881
882
882
/* }}} */
883
883
884
- /* {{{ config DOMConfiguration
885
- readonly=yes
884
+ /* {{{ config DOMConfiguration
885
+ readonly=yes
886
886
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-config
887
887
Since: DOM Level 3
888
888
*/
@@ -897,7 +897,7 @@ int dom_document_config_read(dom_object *obj, zval **retval TSRMLS_DC)
897
897
898
898
/* {{{ proto DOMElement dom_document_create_element(string tagName [, string value]);
899
899
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-2141741547
900
- Since:
900
+ Since:
901
901
*/
902
902
PHP_FUNCTION (dom_document_create_element )
903
903
{
@@ -930,7 +930,7 @@ PHP_FUNCTION(dom_document_create_element)
930
930
931
931
/* {{{ proto DOMDocumentFragment dom_document_create_document_fragment();
932
932
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-35CB04B5
933
- Since:
933
+ Since:
934
934
*/
935
935
PHP_FUNCTION (dom_document_create_document_fragment )
936
936
{
@@ -957,7 +957,7 @@ PHP_FUNCTION(dom_document_create_document_fragment)
957
957
958
958
/* {{{ proto DOMText dom_document_create_text_node(string data);
959
959
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1975348127
960
- Since:
960
+ Since:
961
961
*/
962
962
PHP_FUNCTION (dom_document_create_text_node )
963
963
{
@@ -985,7 +985,7 @@ PHP_FUNCTION(dom_document_create_text_node)
985
985
986
986
/* {{{ proto DOMComment dom_document_create_comment(string data);
987
987
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1334481328
988
- Since:
988
+ Since:
989
989
*/
990
990
PHP_FUNCTION (dom_document_create_comment )
991
991
{
@@ -1013,7 +1013,7 @@ PHP_FUNCTION(dom_document_create_comment)
1013
1013
1014
1014
/* {{{ proto DOMCdataSection dom_document_create_cdatasection(string data);
1015
1015
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D26C0AF8
1016
- Since:
1016
+ Since:
1017
1017
*/
1018
1018
PHP_FUNCTION (dom_document_create_cdatasection )
1019
1019
{
@@ -1041,7 +1041,7 @@ PHP_FUNCTION(dom_document_create_cdatasection)
1041
1041
1042
1042
/* {{{ proto DOMProcessingInstruction dom_document_create_processing_instruction(string target, string data);
1043
1043
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-135944439
1044
- Since:
1044
+ Since:
1045
1045
*/
1046
1046
PHP_FUNCTION (dom_document_create_processing_instruction )
1047
1047
{
@@ -1076,7 +1076,7 @@ PHP_FUNCTION(dom_document_create_processing_instruction)
1076
1076
1077
1077
/* {{{ proto DOMAttr dom_document_create_attribute(string name);
1078
1078
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1084891198
1079
- Since:
1079
+ Since:
1080
1080
*/
1081
1081
PHP_FUNCTION (dom_document_create_attribute )
1082
1082
{
@@ -1110,7 +1110,7 @@ PHP_FUNCTION(dom_document_create_attribute)
1110
1110
1111
1111
/* {{{ proto DOMEntityReference dom_document_create_entity_reference(string name);
1112
1112
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-392B75AE
1113
- Since:
1113
+ Since:
1114
1114
*/
1115
1115
PHP_FUNCTION (dom_document_create_entity_reference )
1116
1116
{
@@ -1143,7 +1143,7 @@ PHP_FUNCTION(dom_document_create_entity_reference)
1143
1143
1144
1144
/* {{{ proto DOMNodeList dom_document_get_elements_by_tag_name(string tagname);
1145
1145
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-A6C9094
1146
- Since:
1146
+ Since:
1147
1147
*/
1148
1148
PHP_FUNCTION (dom_document_get_elements_by_tag_name )
1149
1149
{
@@ -1177,7 +1177,7 @@ PHP_FUNCTION(dom_document_import_node)
1177
1177
xmlDocPtr docp ;
1178
1178
xmlNodePtr nodep , retnodep ;
1179
1179
dom_object * intern , * nodeobj ;
1180
- int ret ;
1180
+ int ret ;
1181
1181
long recursive = 0 ;
1182
1182
1183
1183
if (zend_parse_method_parameters (ZEND_NUM_ARGS () TSRMLS_CC , getThis (), "OO|l" , & id , dom_document_class_entry , & node , dom_node_class_entry , & recursive ) == FAILURE ) {
@@ -1188,7 +1188,7 @@ PHP_FUNCTION(dom_document_import_node)
1188
1188
1189
1189
DOM_GET_OBJ (nodep , node , xmlNodePtr , nodeobj );
1190
1190
1191
- if (nodep -> type == XML_HTML_DOCUMENT_NODE || nodep -> type == XML_DOCUMENT_NODE
1191
+ if (nodep -> type == XML_HTML_DOCUMENT_NODE || nodep -> type == XML_DOCUMENT_NODE
1192
1192
|| nodep -> type == XML_DOCUMENT_TYPE_NODE ) {
1193
1193
php_error_docref (NULL TSRMLS_CC , E_WARNING , "Cannot import: Node Type Not Supported" );
1194
1194
RETURN_FALSE ;
@@ -1278,7 +1278,7 @@ PHP_FUNCTION(dom_document_create_element_ns)
1278
1278
RETURN_FALSE ;
1279
1279
}
1280
1280
1281
-
1281
+
1282
1282
nodep -> ns = nsptr ;
1283
1283
1284
1284
DOM_RET_OBJ (nodep , & ret , intern );
@@ -1580,14 +1580,15 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int sourc
1580
1580
xmlInitParser ();
1581
1581
1582
1582
if (mode == DOM_LOAD_FILE ) {
1583
+ char * file_dest ;
1583
1584
if (CHECK_NULL_PATH (source , source_len )) {
1584
1585
return NULL ;
1585
1586
}
1586
- char * file_dest = _dom_get_valid_file_path (source , resolved_path , MAXPATHLEN TSRMLS_CC );
1587
+ file_dest = _dom_get_valid_file_path (source , resolved_path , MAXPATHLEN TSRMLS_CC );
1587
1588
if (file_dest ) {
1588
1589
ctxt = xmlCreateFileParserCtxt (file_dest );
1589
1590
}
1590
-
1591
+
1591
1592
} else {
1592
1593
ctxt = xmlCreateMemoryParserCtxt (source , source_len );
1593
1594
}
@@ -1909,7 +1910,7 @@ PHP_FUNCTION(dom_document_xinclude)
1909
1910
zval * id ;
1910
1911
xmlDoc * docp ;
1911
1912
xmlNodePtr root ;
1912
- long flags = 0 ;
1913
+ long flags = 0 ;
1913
1914
int err ;
1914
1915
dom_object * intern ;
1915
1916
@@ -1922,7 +1923,7 @@ PHP_FUNCTION(dom_document_xinclude)
1922
1923
err = xmlXIncludeProcessFlags (docp , flags );
1923
1924
1924
1925
/* XML_XINCLUDE_START and XML_XINCLUDE_END nodes need to be removed as these
1925
- are added via xmlXIncludeProcess to mark beginning and ending of xincluded document
1926
+ are added via xmlXIncludeProcess to mark beginning and ending of xincluded document
1926
1927
but are not wanted in resulting document - must be done even if err as it could fail after
1927
1928
having processed some xincludes */
1928
1929
root = (xmlNodePtr ) docp -> children ;
@@ -1938,7 +1939,7 @@ PHP_FUNCTION(dom_document_xinclude)
1938
1939
} else {
1939
1940
RETVAL_FALSE ;
1940
1941
}
1941
-
1942
+
1942
1943
}
1943
1944
/* }}} */
1944
1945
@@ -1959,19 +1960,19 @@ PHP_FUNCTION(dom_document_validate)
1959
1960
DOM_GET_OBJ (docp , id , xmlDocPtr , intern );
1960
1961
1961
1962
cvp = xmlNewValidCtxt ();
1962
-
1963
+
1963
1964
cvp -> userData = NULL ;
1964
1965
cvp -> error = (xmlValidityErrorFunc ) php_libxml_error_handler ;
1965
1966
cvp -> warning = (xmlValidityErrorFunc ) php_libxml_error_handler ;
1966
-
1967
+
1967
1968
if (xmlValidateDocument (cvp , docp )) {
1968
1969
RETVAL_TRUE ;
1969
1970
} else {
1970
1971
RETVAL_FALSE ;
1971
1972
}
1972
-
1973
+
1973
1974
xmlFreeValidCtxt (cvp );
1974
-
1975
+
1975
1976
}
1976
1977
/* }}} */
1977
1978
@@ -2011,7 +2012,7 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
2011
2012
break ;
2012
2013
case DOM_LOAD_STRING :
2013
2014
parser = xmlSchemaNewMemParserCtxt (source , source_len );
2014
- /* If loading from memory, we need to set the base directory for the document
2015
+ /* If loading from memory, we need to set the base directory for the document
2015
2016
but it is not apparent how to do that for schema's */
2016
2017
break ;
2017
2018
default :
@@ -2100,7 +2101,7 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
2100
2101
break ;
2101
2102
case DOM_LOAD_STRING :
2102
2103
parser = xmlRelaxNGNewMemParserCtxt (source , source_len );
2103
- /* If loading from memory, we need to set the base directory for the document
2104
+ /* If loading from memory, we need to set the base directory for the document
2104
2105
but it is not apparent how to do that for schema's */
2105
2106
break ;
2106
2107
default :
@@ -2168,7 +2169,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
2168
2169
int source_len , refcount , ret ;
2169
2170
long options = 0 ;
2170
2171
htmlParserCtxtPtr ctxt ;
2171
-
2172
+
2172
2173
id = getThis ();
2173
2174
2174
2175
if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "p|l" , & source , & source_len , & options ) == FAILURE ) {
@@ -2204,7 +2205,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
2204
2205
htmlParseDocument (ctxt );
2205
2206
newdoc = ctxt -> myDoc ;
2206
2207
htmlFreeParserCtxt (ctxt );
2207
-
2208
+
2208
2209
if (!newdoc )
2209
2210
RETURN_FALSE ;
2210
2211
@@ -2326,13 +2327,13 @@ PHP_FUNCTION(dom_document_save_html)
2326
2327
php_dom_throw_error (WRONG_DOCUMENT_ERR , dom_get_strict_error (intern -> document ) TSRMLS_CC );
2327
2328
RETURN_FALSE ;
2328
2329
}
2329
-
2330
+
2330
2331
buf = xmlBufferCreate ();
2331
2332
if (!buf ) {
2332
2333
php_error_docref (NULL TSRMLS_CC , E_WARNING , "Could not fetch buffer" );
2333
2334
RETURN_FALSE ;
2334
2335
}
2335
-
2336
+
2336
2337
if (node -> type == XML_DOCUMENT_FRAG_NODE ) {
2337
2338
int one_size ;
2338
2339
0 commit comments