summaryrefslogtreecommitdiff
path: root/ext/dom
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dom')
-rw-r--r--ext/dom/attr.c3
-rw-r--r--ext/dom/cdatasection.c4
-rw-r--r--ext/dom/characterdata.c5
-rw-r--r--ext/dom/comment.c4
-rw-r--r--ext/dom/document.c36
-rw-r--r--ext/dom/documentfragment.c5
-rw-r--r--ext/dom/domconfiguration.c7
-rw-r--r--ext/dom/domerrorhandler.c1
-rw-r--r--ext/dom/domimplementation.c8
-rw-r--r--ext/dom/domimplementationlist.c1
-rw-r--r--ext/dom/domimplementationsource.c2
-rw-r--r--ext/dom/domstringlist.c1
-rw-r--r--ext/dom/element.c20
-rw-r--r--ext/dom/entityreference.c2
-rw-r--r--ext/dom/namednodemap.c7
-rw-r--r--ext/dom/namelist.c2
-rw-r--r--ext/dom/node.c49
-rw-r--r--ext/dom/nodelist.c1
-rw-r--r--ext/dom/php_dom.c9
-rw-r--r--ext/dom/processinginstruction.c4
-rw-r--r--ext/dom/string_extend.c2
-rw-r--r--ext/dom/tests/DOMCharacterData_appendData_basic.phpt4
-rw-r--r--ext/dom/tests/DOMComment_appendData_basic_Sullivan.phpt4
-rw-r--r--ext/dom/tests/DOMComment_replaceData_basic.phpt2
-rw-r--r--ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt2
-rw-r--r--ext/dom/tests/DOMDocument_createAttribute_basic.phpt2
-rw-r--r--ext/dom/tests/DOMDocument_createAttribute_error.phpt2
-rw-r--r--ext/dom/tests/DOMDocument_createAttribute_error1.phpt2
-rw-r--r--ext/dom/tests/DOMDocument_createAttribute_variation.phpt2
-rw-r--r--ext/dom/tests/DOMDocument_createProcessingInstruction_basic.phpt2
-rw-r--r--ext/dom/tests/DOMDocument_createProcessingInstruction_error.phpt2
-rw-r--r--ext/dom/tests/DOMElement_hasAttributes_basic.phpt2
-rw-r--r--ext/dom/tests/DOMNode_issamenode_basic.phpt2
-rw-r--r--ext/dom/tests/DOMNode_normalize_basic.phpt6
-rw-r--r--ext/dom/tests/DOMText_appendData_basic.phpt4
-rw-r--r--ext/dom/tests/bug42082.phpt4
-rw-r--r--ext/dom/text.c15
-rw-r--r--ext/dom/xpath.c8
38 files changed, 179 insertions, 59 deletions
diff --git a/ext/dom/attr.c b/ext/dom/attr.c
index 6707c9be1b..73d3814a04 100644
--- a/ext/dom/attr.c
+++ b/ext/dom/attr.c
@@ -30,9 +30,11 @@
#include "php_dom.h"
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_attr_is_id, 0, 0, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_attr_construct, 0, 0, 1)
ZEND_ARG_INFO(0, name)
ZEND_ARG_INFO(0, value)
@@ -66,7 +68,6 @@ PHP_METHOD(domattr, __construct)
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_attr_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
return;
}
diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c
index 7ba228d39f..8ed7e17e67 100644
--- a/ext/dom/cdatasection.c
+++ b/ext/dom/cdatasection.c
@@ -29,6 +29,7 @@
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_cdatasection_construct, 0, 0, 1)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO();
@@ -59,7 +60,6 @@ PHP_METHOD(domcdatasection, __construct)
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_cdatasection_class_entry, &value, &value_len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
return;
}
@@ -73,7 +73,7 @@ PHP_METHOD(domcdatasection, __construct)
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
- oldnode = dom_object_get_node(intern);
+ oldnode = (xmlNodePtr)intern->ptr;
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode TSRMLS_CC);
}
diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c
index 1b0c1373be..8dbef5d6f1 100644
--- a/ext/dom/characterdata.c
+++ b/ext/dom/characterdata.c
@@ -29,25 +29,30 @@
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_characterdata_substring_data, 0, 0, 2)
ZEND_ARG_INFO(0, offset)
ZEND_ARG_INFO(0, count)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_characterdata_append_data, 0, 0, 1)
ZEND_ARG_INFO(0, arg)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_characterdata_insert_data, 0, 0, 2)
ZEND_ARG_INFO(0, offset)
ZEND_ARG_INFO(0, arg)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_characterdata_delete_data, 0, 0, 2)
ZEND_ARG_INFO(0, offset)
ZEND_ARG_INFO(0, count)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_characterdata_replace_data, 0, 0, 3)
ZEND_ARG_INFO(0, offset)
ZEND_ARG_INFO(0, count)
diff --git a/ext/dom/comment.c b/ext/dom/comment.c
index 03ac1ab0cf..55b5ed93f6 100644
--- a/ext/dom/comment.c
+++ b/ext/dom/comment.c
@@ -29,6 +29,7 @@
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_comment_construct, 0, 0, 0)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO();
@@ -59,7 +60,6 @@ PHP_METHOD(domcomment, __construct)
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_comment_class_entry, &value, &value_len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
return;
}
@@ -73,7 +73,7 @@ PHP_METHOD(domcomment, __construct)
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
- oldnode = dom_object_get_node(intern);
+ oldnode = (xmlNodePtr)intern->ptr;
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode TSRMLS_CC);
}
diff --git a/ext/dom/document.c b/ext/dom/document.c
index d16f1177fd..25f2b91317 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -42,142 +42,175 @@ struct _idsIterator {
#define DOM_LOAD_FILE 1
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_element, 0, 0, 1)
ZEND_ARG_INFO(0, tagName)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_document_fragment, 0, 0, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_text_node, 0, 0, 1)
ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_comment, 0, 0, 1)
ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_cdatasection, 0, 0, 1)
ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_processing_instruction, 0, 0, 2)
ZEND_ARG_INFO(0, target)
ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_attribute, 0, 0, 1)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_entity_reference, 0, 0, 1)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_get_elements_by_tag_name, 0, 0, 1)
ZEND_ARG_INFO(0, tagName)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_import_node, 0, 0, 2)
ZEND_ARG_OBJ_INFO(0, importedNode, DOMNode, 0)
ZEND_ARG_INFO(0, deep)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_element_ns, 0, 0, 2)
ZEND_ARG_INFO(0, namespaceURI)
ZEND_ARG_INFO(0, qualifiedName)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_attribute_ns, 0, 0, 2)
ZEND_ARG_INFO(0, namespaceURI)
ZEND_ARG_INFO(0, qualifiedName)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_get_elements_by_tag_name_ns, 0, 0, 2)
ZEND_ARG_INFO(0, namespaceURI)
ZEND_ARG_INFO(0, localName)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_get_element_by_id, 0, 0, 1)
ZEND_ARG_INFO(0, elementId)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_adopt_node, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, source, DOMNode, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_normalize_document, 0, 0, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_rename_node, 0, 0, 3)
ZEND_ARG_OBJ_INFO(0, node, DOMNode, 0)
ZEND_ARG_INFO(0, namespaceURI)
ZEND_ARG_INFO(0, qualifiedName)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_load, 0, 0, 1)
ZEND_ARG_INFO(0, source)
ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_save, 0, 0, 1)
ZEND_ARG_INFO(0, file)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_loadxml, 0, 0, 1)
ZEND_ARG_INFO(0, source)
ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_savexml, 0, 0, 0)
- ZEND_ARG_OBJ_INFO(0, node, DOMNode, 1)
+ ZEND_ARG_OBJ_INFO(0, node, DOMNode, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_construct, 0, 0, 0)
ZEND_ARG_INFO(0, version)
ZEND_ARG_INFO(0, encoding)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_validate, 0, 0, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_xinclude, 0, 0, 0)
ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_loadhtml, 0, 0, 1)
ZEND_ARG_INFO(0, source)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_loadhtmlfile, 0, 0, 1)
ZEND_ARG_INFO(0, source)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_savehtml, 0, 0, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_savehtmlfile, 0, 0, 1)
ZEND_ARG_INFO(0, file)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_schema_validate_file, 0, 0, 1)
ZEND_ARG_INFO(0, filename)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_schema_validate_xml, 0, 0, 1)
ZEND_ARG_INFO(0, source)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_relaxNG_validate_file, 0, 0, 1)
ZEND_ARG_INFO(0, filename)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_relaxNG_validate_xml, 0, 0, 1)
ZEND_ARG_INFO(0, source)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_registernodeclass, 0, 0, 2)
ZEND_ARG_INFO(0, baseClass)
ZEND_ARG_INFO(0, extendedClass)
@@ -1441,7 +1474,6 @@ PHP_METHOD(domdocument, __construct)
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ss", &id, dom_document_class_entry, &version, &version_len, &encoding, &encoding_len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
return;
}
diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c
index cd2adabf74..8be9ed1fcf 100644
--- a/ext/dom/documentfragment.c
+++ b/ext/dom/documentfragment.c
@@ -28,9 +28,11 @@
#include "php_dom.h"
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_documentfragement_construct, 0, 0, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_documentfragement_appendXML, 0, 0, 1)
ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO();
@@ -60,7 +62,6 @@ PHP_METHOD(domdocumentfragment, __construct)
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_documentfragment_class_entry) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
return;
}
@@ -74,7 +75,7 @@ PHP_METHOD(domdocumentfragment, __construct)
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
- oldnode = dom_object_get_node(intern);
+ oldnode = (xmlNodePtr)intern->ptr;
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode TSRMLS_CC);
}
diff --git a/ext/dom/domconfiguration.c b/ext/dom/domconfiguration.c
index 054a84edc6..507727e909 100644
--- a/ext/dom/domconfiguration.c
+++ b/ext/dom/domconfiguration.c
@@ -28,18 +28,21 @@
#include "php_dom.h"
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_configuration_set_parameter, 0, 0, 2)
ZEND_ARG_INFO(0, name)
- ZEND_ARG_INFO(0, value)
+ ZEND_ARG_OBJ_INFO(0, value, DOMUserData, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_configuration_get_parameter, 0, 0, 0)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_configuration_can_set_parameter, 0, 0, 0)
ZEND_ARG_INFO(0, name)
- ZEND_ARG_INFO(0, value)
+ ZEND_ARG_OBJ_INFO(0, value, DOMUserData, 0)
ZEND_END_ARG_INFO();
/* }}} */
diff --git a/ext/dom/domerrorhandler.c b/ext/dom/domerrorhandler.c
index 0dd070ac70..b0f84c589f 100644
--- a/ext/dom/domerrorhandler.c
+++ b/ext/dom/domerrorhandler.c
@@ -28,6 +28,7 @@
#include "php_dom.h"
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_domerrorhandler_handle_error, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, error, DOMError, 0)
ZEND_END_ARG_INFO();
diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c
index e80faf40cb..8fe748ce9d 100644
--- a/ext/dom/domimplementation.c
+++ b/ext/dom/domimplementation.c
@@ -28,20 +28,24 @@
#include "php_dom.h"
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementation_get_feature, 0, 0, 2)
ZEND_ARG_INFO(0, feature)
ZEND_ARG_INFO(0, version)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementation_has_feature, 0, 0, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementation_create_documenttype, 0, 0, 3)
ZEND_ARG_INFO(0, qualifiedName)
ZEND_ARG_INFO(0, publicId)
ZEND_ARG_INFO(0, systemId)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementation_create_document, 0, 0, 3)
ZEND_ARG_INFO(0, namespaceURI)
ZEND_ARG_INFO(0, qualifiedName)
@@ -94,7 +98,7 @@ PHP_METHOD(domimplementation, createDocumentType)
zval *rv = NULL;
xmlDtd *doctype;
int ret, name_len = 0, publicid_len = 0, systemid_len = 0;
- char *name = NULL, *publicid = NULL, *systemid = NULL;
+ char *name, *publicid, *systemid;
xmlChar *pch1 = NULL, *pch2 = NULL, *localname = NULL;
xmlURIPtr uri;
@@ -157,7 +161,7 @@ PHP_METHOD(domimplementation, createDocument)
xmlDtdPtr doctype = NULL;
xmlNsPtr nsptr = NULL;
int ret, uri_len = 0, name_len = 0, errorcode = 0;
- char *uri = NULL, *name = NULL;
+ char *uri, *name;
char *prefix = NULL, *localname = NULL;
dom_object *doctobj;
diff --git a/ext/dom/domimplementationlist.c b/ext/dom/domimplementationlist.c
index 68518b619d..8101c067d5 100644
--- a/ext/dom/domimplementationlist.c
+++ b/ext/dom/domimplementationlist.c
@@ -28,6 +28,7 @@
#include "php_dom.h"
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementationlist_item, 0, 0, 1)
ZEND_ARG_INFO(0, index)
ZEND_END_ARG_INFO();
diff --git a/ext/dom/domimplementationsource.c b/ext/dom/domimplementationsource.c
index 17c615c12b..587e3d1275 100644
--- a/ext/dom/domimplementationsource.c
+++ b/ext/dom/domimplementationsource.c
@@ -29,10 +29,12 @@
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementationsource_getdomimplementation, 0, 0, 1)
ZEND_ARG_INFO(0, features)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementationsource_getdomimplementations, 0, 0, 1)
ZEND_ARG_INFO(0, features)
ZEND_END_ARG_INFO();
diff --git a/ext/dom/domstringlist.c b/ext/dom/domstringlist.c
index e1b49b8926..246b868913 100644
--- a/ext/dom/domstringlist.c
+++ b/ext/dom/domstringlist.c
@@ -28,6 +28,7 @@
#include "php_dom.h"
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_stringlist_item, 0, 0, 1)
ZEND_ARG_INFO(0, index)
ZEND_END_ARG_INFO();
diff --git a/ext/dom/element.c b/ext/dom/element.c
index 80522e9cb2..b8eb8413b8 100644
--- a/ext/dom/element.c
+++ b/ext/dom/element.c
@@ -28,90 +28,109 @@
#include "php_dom.h"
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_get_attribute, 0, 0, 1)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_set_attribute, 0, 0, 2)
ZEND_ARG_INFO(0, name)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_remove_attribute, 0, 0, 1)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_get_attribute_node, 0, 0, 1)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_set_attribute_node, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, newAttr, DOMAttr, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_remove_attribute_node, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, oldAttr, DOMAttr, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_get_elements_by_tag_name, 0, 0, 1)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_get_attribute_ns, 0, 0, 2)
ZEND_ARG_INFO(0, namespaceURI)
ZEND_ARG_INFO(0, localName)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_set_attribute_ns, 0, 0, 3)
ZEND_ARG_INFO(0, namespaceURI)
ZEND_ARG_INFO(0, qualifiedName)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_remove_attribute_ns, 0, 0, 2)
ZEND_ARG_INFO(0, namespaceURI)
ZEND_ARG_INFO(0, localName)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_get_attribute_node_ns, 0, 0, 2)
ZEND_ARG_INFO(0, namespaceURI)
ZEND_ARG_INFO(0, localName)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_set_attribute_node_ns, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, newAttr, DOMAttr, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_get_elements_by_tag_name_ns, 0, 0, 2)
ZEND_ARG_INFO(0, namespaceURI)
ZEND_ARG_INFO(0, localName)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_has_attribute, 0, 0, 1)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_has_attribute_ns, 0, 0, 2)
ZEND_ARG_INFO(0, namespaceURI)
ZEND_ARG_INFO(0, localName)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_set_id_attribute, 0, 0, 2)
ZEND_ARG_INFO(0, name)
ZEND_ARG_INFO(0, isId)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_set_id_attribute_ns, 0, 0, 3)
ZEND_ARG_INFO(0, namespaceURI)
ZEND_ARG_INFO(0, localName)
ZEND_ARG_INFO(0, isId)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_set_id_attribute_node, 0, 0, 2)
ZEND_ARG_OBJ_INFO(0, attr, DOMAttr, 0)
ZEND_ARG_INFO(0, isId)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_construct, 0, 0, 1)
ZEND_ARG_INFO(0, name)
ZEND_ARG_INFO(0, value)
@@ -166,7 +185,6 @@ PHP_METHOD(domelement, __construct)
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s!s", &id, dom_element_class_entry, &name, &name_len, &value, &value_len, &uri, &uri_len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
return;
}
zend_restore_error_handling(&error_handling TSRMLS_CC);
diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c
index 592a2a2ddb..9d2249155a 100644
--- a/ext/dom/entityreference.c
+++ b/ext/dom/entityreference.c
@@ -28,6 +28,7 @@
#include "php_dom.h"
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_entityreference_construct, 0, 0, 1)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO();
@@ -58,7 +59,6 @@ PHP_METHOD(domentityreference, __construct)
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_entityreference_class_entry, &name, &name_len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
return;
}
diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c
index a485b1b779..95cef06ad5 100644
--- a/ext/dom/namednodemap.c
+++ b/ext/dom/namednodemap.c
@@ -28,31 +28,38 @@
#include "php_dom.h"
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_get_named_item, 0, 0, 1)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_set_named_item, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, arg, DOMNode, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_remove_named_item, 0, 0, 0)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_item, 0, 0, 0)
ZEND_ARG_INFO(0, index)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_get_named_item_ns, 0, 0, 0)
ZEND_ARG_INFO(0, namespaceURI)
ZEND_ARG_INFO(0, localName)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_set_named_item_ns, 0, 0, 0)
ZEND_ARG_OBJ_INFO(0, arg, DOMNode, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_remove_named_item_ns, 0, 0, 0)
ZEND_ARG_INFO(0, namespaceURI)
ZEND_ARG_INFO(0, localName)
diff --git a/ext/dom/namelist.c b/ext/dom/namelist.c
index 31f59e8602..49b00d8d11 100644
--- a/ext/dom/namelist.c
+++ b/ext/dom/namelist.c
@@ -28,10 +28,12 @@
#include "php_dom.h"
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namelist_get_name, 0, 0, 1)
ZEND_ARG_INFO(0, index)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namelist_get_namespace_uri, 0, 0, 1)
ZEND_ARG_INFO(0, index)
ZEND_END_ARG_INFO();
diff --git a/ext/dom/node.c b/ext/dom/node.c
index b212fc70c2..6de8c585f6 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -28,84 +28,104 @@
#include "php_dom.h"
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_insert_before, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, newChild, DOMNode, 0)
ZEND_ARG_OBJ_INFO(0, refChild, DOMNode, 1)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_replace_child, 0, 0, 2)
ZEND_ARG_OBJ_INFO(0, newChild, DOMNode, 0)
ZEND_ARG_OBJ_INFO(0, oldChild, DOMNode, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_remove_child, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, oldChild, DOMNode, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_append_child, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, newChild, DOMNode, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_has_child_nodes, 0, 0, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_clone_node, 0, 0, 1)
ZEND_ARG_INFO(0, deep)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_normalize, 0, 0, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_is_supported, 0, 0, 2)
ZEND_ARG_INFO(0, feature)
ZEND_ARG_INFO(0, version)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_has_attributes, 0, 0, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_compare_document_position, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, other, DOMNode, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_is_same_node, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, other, DOMNode, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_lookup_prefix, 0, 0, 1)
ZEND_ARG_INFO(0, namespaceURI)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_is_default_namespace, 0, 0, 1)
ZEND_ARG_INFO(0, namespaceURI)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_lookup_namespace_uri, 0, 0, 1)
ZEND_ARG_INFO(0, prefix)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_is_equal_node, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, arg, DOMNode, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_get_feature, 0, 0, 2)
ZEND_ARG_INFO(0, feature)
ZEND_ARG_INFO(0, version)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_set_user_data, 0, 0, 3)
ZEND_ARG_INFO(0, key)
- ZEND_ARG_INFO(0, data)
+ ZEND_ARG_OBJ_INFO(0, data, DOMUserData, 0)
ZEND_ARG_INFO(0, handler)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_get_user_data, 0, 0, 1)
ZEND_ARG_INFO(0, key)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_getNodePath, 0, 0, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_C14N, 0, 0, 0)
ZEND_ARG_INFO(0, exclusive)
ZEND_ARG_INFO(0, with_comments)
@@ -113,6 +133,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_C14N, 0, 0, 0)
ZEND_ARG_ARRAY_INFO(0, ns_prefixes, 1)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_C14NFile, 0, 0, 1)
ZEND_ARG_INFO(0, uri)
ZEND_ARG_INFO(0, exclusive)
@@ -157,29 +178,15 @@ const zend_function_entry php_dom_node_class_functions[] = { /* {{{ */
static void dom_reconcile_ns(xmlDocPtr doc, xmlNodePtr nodep) /* {{{ */
{
- xmlNsPtr nsptr, nsdftptr, curns, prevns = NULL;
+ xmlNsPtr nsptr;
if (nodep->type == XML_ELEMENT_NODE) {
/* Following if block primarily used for inserting nodes created via createElementNS */
- if (nodep->nsDef != NULL) {
- curns = nodep->nsDef;
- while (curns) {
- nsdftptr = curns->next;
- if (curns->href != NULL) {
- if((nsptr = xmlSearchNsByHref(doc, nodep->parent, curns->href)) &&
- (curns->prefix == NULL || xmlStrEqual(nsptr->prefix, curns->prefix))) {
- curns->next = NULL;
- if (prevns == NULL) {
- nodep->nsDef = nsdftptr;
- } else {
- prevns->next = nsdftptr;
- }
- dom_set_old_ns(doc, curns);
- curns = prevns;
- }
- }
- prevns = curns;
- curns = nsdftptr;
+ if (nodep->nsDef != NULL && nodep->nsDef->href != NULL) {
+ if((nsptr = xmlSearchNsByHref(doc, nodep->parent, nodep->nsDef->href)) &&
+ (nodep->nsDef->prefix == NULL || xmlStrEqual(nsptr->prefix, nodep->nsDef->prefix))) {
+ dom_set_old_ns(doc, nodep->nsDef);
+ nodep->nsDef = NULL;
}
}
xmlReconciliateNs(doc, nodep);
diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c
index 05cd1dd81b..90f1eee41b 100644
--- a/ext/dom/nodelist.c
+++ b/ext/dom/nodelist.c
@@ -29,6 +29,7 @@
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_nodelist_item, 0, 0, 1)
ZEND_ARG_INFO(0, index)
ZEND_END_ARG_INFO();
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index 3e9ebdd0f8..38c8dfacab 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -188,7 +188,7 @@ int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece,
if (ce) {
return zend_hash_update(doc_props->classmap, basece->name, basece->name_length + 1, &ce, sizeof(ce), NULL);
} else {
- zend_hash_del(doc_props->classmap, basece->name, basece->name_length + 1);
+ return zend_hash_del(doc_props->classmap, basece->name, basece->name_length + 1);
}
}
return SUCCESS;
@@ -510,6 +510,7 @@ zend_object_value dom_objects_store_clone_obj(zval *zobject TSRMLS_DC) /* {{{ */
/* }}} */
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_import_simplexml, 0, 0, 1)
ZEND_ARG_INFO(0, node)
ZEND_END_ARG_INFO()
@@ -964,10 +965,8 @@ void dom_xpath_objects_free_storage(void *object TSRMLS_DC)
intern->ptr = NULL;
}
- if (intern->registered_phpfunctions) {
- zend_hash_destroy(intern->registered_phpfunctions);
- FREE_HASHTABLE(intern->registered_phpfunctions);
- }
+ zend_hash_destroy(intern->registered_phpfunctions);
+ FREE_HASHTABLE(intern->registered_phpfunctions);
if (intern->node_list) {
zend_hash_destroy(intern->node_list);
diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c
index 59d989aa49..153bac94d4 100644
--- a/ext/dom/processinginstruction.c
+++ b/ext/dom/processinginstruction.c
@@ -29,6 +29,7 @@
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_processinginstruction_construct, 0, 0, 1)
ZEND_ARG_INFO(0, name)
ZEND_ARG_INFO(0, value)
@@ -60,7 +61,6 @@ PHP_METHOD(domprocessinginstruction, __construct)
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_processinginstruction_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
return;
}
@@ -81,7 +81,7 @@ PHP_METHOD(domprocessinginstruction, __construct)
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
- oldnode = dom_object_get_node(intern);
+ oldnode = (xmlNodePtr)intern->ptr;
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode TSRMLS_CC);
}
diff --git a/ext/dom/string_extend.c b/ext/dom/string_extend.c
index 909bfeb8c9..d3eead48a4 100644
--- a/ext/dom/string_extend.c
+++ b/ext/dom/string_extend.c
@@ -28,10 +28,12 @@
#include "php_dom.h"
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_string_extend_find_offset16, 0, 0, 1)
ZEND_ARG_INFO(0, offset32)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_string_extend_find_offset32, 0, 0, 1)
ZEND_ARG_INFO(0, offset16)
ZEND_END_ARG_INFO();
diff --git a/ext/dom/tests/DOMCharacterData_appendData_basic.phpt b/ext/dom/tests/DOMCharacterData_appendData_basic.phpt
index ee590de80c..9b37b4443a 100644
--- a/ext/dom/tests/DOMCharacterData_appendData_basic.phpt
+++ b/ext/dom/tests/DOMCharacterData_appendData_basic.phpt
@@ -3,6 +3,8 @@ DOMCharacterData::appendData basic functionality test
--CREDITS--
Mike Sullivan <mike@regexia.com>
#TestFest 2008 (London)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
@@ -32,4 +34,4 @@ CDATA Length (two appends): 8
CDATA Content: data><&"
<?xml version="1.0"?>
-<root><cdata><![CDATA[data><&"]]></cdata></root> \ No newline at end of file
+<root><cdata><![CDATA[data><&"]]></cdata></root>
diff --git a/ext/dom/tests/DOMComment_appendData_basic_Sullivan.phpt b/ext/dom/tests/DOMComment_appendData_basic_Sullivan.phpt
index b7d90a1194..4d39ea4695 100644
--- a/ext/dom/tests/DOMComment_appendData_basic_Sullivan.phpt
+++ b/ext/dom/tests/DOMComment_appendData_basic_Sullivan.phpt
@@ -3,6 +3,8 @@ DOMComment::appendData basic functionality test
--CREDITS--
Mike Sullivan <mike@regexia.com>
#TestFest 2008 (London)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
@@ -32,4 +34,4 @@ Comment Length (two appends): 8
Comment Content: data><&"
<?xml version="1.0"?>
-<root><comment><!--data><&"--></comment></root> \ No newline at end of file
+<root><comment><!--data><&"--></comment></root>
diff --git a/ext/dom/tests/DOMComment_replaceData_basic.phpt b/ext/dom/tests/DOMComment_replaceData_basic.phpt
index 10bf677ff3..2963cb1e06 100644
--- a/ext/dom/tests/DOMComment_replaceData_basic.phpt
+++ b/ext/dom/tests/DOMComment_replaceData_basic.phpt
@@ -4,7 +4,7 @@ Test replacing data into a DOMComment basic test
Andrew Larssen <al@larssen.org>
London TestFest 2008
--SKIPIF--
-<?php // require_once('skipif.inc'); ?>
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
diff --git a/ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt b/ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt
index d6fb632132..c82a73b526 100644
--- a/ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt
+++ b/ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt
@@ -1,5 +1,7 @@
--TEST--
Testing DOMDocumentFragment::appendXML and DOMDocumentFragment::hasChildNodes
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$doc = new DOMDocument();
diff --git a/ext/dom/tests/DOMDocument_createAttribute_basic.phpt b/ext/dom/tests/DOMDocument_createAttribute_basic.phpt
index 5205a3e30f..4dd181b3f8 100644
--- a/ext/dom/tests/DOMDocument_createAttribute_basic.phpt
+++ b/ext/dom/tests/DOMDocument_createAttribute_basic.phpt
@@ -3,6 +3,8 @@ DomDocument::createAttribute() - basic test for DomDocument::createAttribute()
--CREDITS--
Muhammad Khalid Adnan
# TestFest 2008
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
diff --git a/ext/dom/tests/DOMDocument_createAttribute_error.phpt b/ext/dom/tests/DOMDocument_createAttribute_error.phpt
index 3b318d40d2..bf71d554aa 100644
--- a/ext/dom/tests/DOMDocument_createAttribute_error.phpt
+++ b/ext/dom/tests/DOMDocument_createAttribute_error.phpt
@@ -1,5 +1,7 @@
--TEST--
Test DOMDocument::createAttribute() for expected expection thrown when wrong parameter passed
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$dom = new DOMDocument();
diff --git a/ext/dom/tests/DOMDocument_createAttribute_error1.phpt b/ext/dom/tests/DOMDocument_createAttribute_error1.phpt
index 153b18b5a2..745873aca9 100644
--- a/ext/dom/tests/DOMDocument_createAttribute_error1.phpt
+++ b/ext/dom/tests/DOMDocument_createAttribute_error1.phpt
@@ -3,6 +3,8 @@ DomDocument::createAttribute() - error test for DomDocument::createAttribute()
--CREDITS--
Muhammad Khalid Adnan
# TestFest 2008
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
diff --git a/ext/dom/tests/DOMDocument_createAttribute_variation.phpt b/ext/dom/tests/DOMDocument_createAttribute_variation.phpt
index f00493455c..ff81343cc9 100644
--- a/ext/dom/tests/DOMDocument_createAttribute_variation.phpt
+++ b/ext/dom/tests/DOMDocument_createAttribute_variation.phpt
@@ -1,5 +1,7 @@
--TEST--
Test DOMDocument::createAttribute() for expected return value
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$dom = new DOMDocument();
diff --git a/ext/dom/tests/DOMDocument_createProcessingInstruction_basic.phpt b/ext/dom/tests/DOMDocument_createProcessingInstruction_basic.phpt
index ea0910417c..9f45f125d5 100644
--- a/ext/dom/tests/DOMDocument_createProcessingInstruction_basic.phpt
+++ b/ext/dom/tests/DOMDocument_createProcessingInstruction_basic.phpt
@@ -3,6 +3,8 @@ DomDocument::createProcessingInstruction() - basic test for DomDocument::createP
--CREDITS--
Muhammad Khalid Adnan
# TestFest 2008
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
diff --git a/ext/dom/tests/DOMDocument_createProcessingInstruction_error.phpt b/ext/dom/tests/DOMDocument_createProcessingInstruction_error.phpt
index d050b17714..a0c12b1fe7 100644
--- a/ext/dom/tests/DOMDocument_createProcessingInstruction_error.phpt
+++ b/ext/dom/tests/DOMDocument_createProcessingInstruction_error.phpt
@@ -3,6 +3,8 @@ DomDocument::createProcessingInstruction() - error test for DomDocument::createP
--CREDITS--
Muhammad Khalid Adnan
# TestFest 2008
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
diff --git a/ext/dom/tests/DOMElement_hasAttributes_basic.phpt b/ext/dom/tests/DOMElement_hasAttributes_basic.phpt
index f0d0c355b8..8e38d935e7 100644
--- a/ext/dom/tests/DOMElement_hasAttributes_basic.phpt
+++ b/ext/dom/tests/DOMElement_hasAttributes_basic.phpt
@@ -3,6 +3,8 @@ DOMNode: hasAttributes()
--CREDITS--
James Lewis <james@s-1.com>
#TestFest 2008
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
require_once("dom_test.inc");
diff --git a/ext/dom/tests/DOMNode_issamenode_basic.phpt b/ext/dom/tests/DOMNode_issamenode_basic.phpt
index beccb8fb62..e008340ead 100644
--- a/ext/dom/tests/DOMNode_issamenode_basic.phpt
+++ b/ext/dom/tests/DOMNode_issamenode_basic.phpt
@@ -3,6 +3,8 @@ DOMNode: isSameNode()
--CREDITS--
James Lewis <james@s-1.com>
#TestFest 2008
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
require_once("dom_test.inc");
diff --git a/ext/dom/tests/DOMNode_normalize_basic.phpt b/ext/dom/tests/DOMNode_normalize_basic.phpt
index 79f5294d63..8ab9080f69 100644
--- a/ext/dom/tests/DOMNode_normalize_basic.phpt
+++ b/ext/dom/tests/DOMNode_normalize_basic.phpt
@@ -1,15 +1,15 @@
--TEST--
-normalize()
+DomNode::normalize()
--SKIPIF--
<?php
include('skipif.inc');
?>
--FILE--
-<?php
+<?php
/* Create an XML document
* with structure
- * <book>
+ * <book>
* <author></author>
* <title>This is the title</title>
* </book>
diff --git a/ext/dom/tests/DOMText_appendData_basic.phpt b/ext/dom/tests/DOMText_appendData_basic.phpt
index 6a28a9ae45..72d0d6ca94 100644
--- a/ext/dom/tests/DOMText_appendData_basic.phpt
+++ b/ext/dom/tests/DOMText_appendData_basic.phpt
@@ -3,6 +3,8 @@ DOMText::appendData basic functionality test
--CREDITS--
Mike Sullivan <mike@regexia.com>
#TestFest 2008 (London)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
@@ -32,4 +34,4 @@ Text Length (two appends): 8
Text Content: data><&"
<?xml version="1.0"?>
-<root><text>data&gt;&lt;&amp;"</text></root> \ No newline at end of file
+<root><text>data&gt;&lt;&amp;"</text></root>
diff --git a/ext/dom/tests/bug42082.phpt b/ext/dom/tests/bug42082.phpt
index 86f32dd8d9..c57d312e1b 100644
--- a/ext/dom/tests/bug42082.phpt
+++ b/ext/dom/tests/bug42082.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #42082 (NodeList length zero should be empty)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$doc = new DOMDocument();
@@ -24,4 +26,4 @@ string(0) ""
bool(true)
bool(true)
bool(false)
-bool(false) \ No newline at end of file
+bool(false)
diff --git a/ext/dom/text.c b/ext/dom/text.c
index 70d3539967..4193f71467 100644
--- a/ext/dom/text.c
+++ b/ext/dom/text.c
@@ -29,17 +29,21 @@
#include "dom_ce.h"
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_text_split_text, 0, 0, 1)
ZEND_ARG_INFO(0, offset)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_text_is_whitespace_in_element_content, 0, 0, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_text_replace_whole_text, 0, 0, 1)
ZEND_ARG_INFO(0, content)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_text_construct, 0, 0, 0)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO();
@@ -74,7 +78,6 @@ PHP_METHOD(domtext, __construct)
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_text_class_entry, &value, &value_len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
return;
}
@@ -88,7 +91,7 @@ PHP_METHOD(domtext, __construct)
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
- oldnode = dom_object_get_node(intern);
+ oldnode = (xmlNodePtr)intern->ptr;
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode TSRMLS_CC);
}
@@ -168,19 +171,19 @@ PHP_FUNCTION(dom_text_split_text)
if (cur == NULL) {
RETURN_FALSE;
}
- length = xmlUTF8Strlen(cur);
+ length = xmlStrlen(cur);
if (offset > length || offset < 0) {
xmlFree(cur);
RETURN_FALSE;
}
- first = xmlUTF8Strndup(cur, offset);
- second = xmlUTF8Strsub(cur, offset, length - offset);
+ first = xmlStrndup(cur, offset);
+ second = xmlStrdup(cur + offset);
xmlFree(cur);
- xmlNodeSetContent(node, first);
+ xmlNodeSetContentLen(node, first, offset);
nnode = xmlNewDocText(node->doc, second);
xmlFree(first);
diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c
index 8f27782ff1..fb218783ad 100644
--- a/ext/dom/xpath.c
+++ b/ext/dom/xpath.c
@@ -37,25 +37,30 @@
#if defined(LIBXML_XPATH_ENABLED)
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_xpath_construct, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, doc, DOMDocument, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_xpath_register_ns, 0, 0, 2)
ZEND_ARG_INFO(0, prefix)
ZEND_ARG_INFO(0, uri)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_xpath_query, 0, 0, 1)
ZEND_ARG_INFO(0, expr)
ZEND_ARG_OBJ_INFO(0, context, DOMNode, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_xpath_evaluate, 0, 0, 1)
ZEND_ARG_INFO(0, expr)
ZEND_ARG_OBJ_INFO(0, context, DOMNode, 0)
ZEND_END_ARG_INFO();
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_xpath_register_php_functions, 0, 0, 0)
ZEND_END_ARG_INFO();
/* }}} */
@@ -197,7 +202,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
fci.function_name = &handler;
fci.symbol_table = NULL;
- fci.object_ptr = NULL;
+ fci.object_pp = NULL;
fci.retval_ptr_ptr = &retval;
fci.no_separation = 0;
@@ -277,7 +282,6 @@ PHP_METHOD(domxpath, __construct)
zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_xpath_class_entry, &doc, dom_document_class_entry) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
return;
}