diff options
Diffstat (limited to 'ext/dom')
44 files changed, 147 insertions, 1334 deletions
diff --git a/ext/dom/attr.c b/ext/dom/attr.c index 9326e145bf..73ce75b366 100644 --- a/ext/dom/attr.c +++ b/ext/dom/attr.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c index 4d34e58a61..6af743e4e3 100644 --- a/ext/dom/cdatasection.c +++ b/ext/dom/cdatasection.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c index b0ac50f44e..2363cc6003 100644 --- a/ext/dom/characterdata.c +++ b/ext/dom/characterdata.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | diff --git a/ext/dom/comment.c b/ext/dom/comment.c index 9cbec9f173..c4b488888d 100644 --- a/ext/dom/comment.c +++ b/ext/dom/comment.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | diff --git a/ext/dom/config.m4 b/ext/dom/config.m4 index 1a7f81ef8d..de3b54da4c 100644 --- a/ext/dom/config.m4 +++ b/ext/dom/config.m4 @@ -12,16 +12,16 @@ if test "$PHP_DOM" != "no"; then PHP_SETUP_LIBXML(DOM_SHARED_LIBADD, [ AC_DEFINE(HAVE_DOM,1,[ ]) - PHP_NEW_EXTENSION(dom, [php_dom.c attr.c document.c domerrorhandler.c \ - domstringlist.c domexception.c namelist.c \ + PHP_NEW_EXTENSION(dom, [php_dom.c attr.c document.c \ + domexception.c \ processinginstruction.c cdatasection.c \ documentfragment.c domimplementation.c \ - element.c node.c string_extend.c characterdata.c \ - documenttype.c domimplementationlist.c entity.c \ - nodelist.c text.c comment.c domconfiguration.c \ - domimplementationsource.c entityreference.c \ + element.c node.c characterdata.c \ + documenttype.c entity.c \ + nodelist.c text.c comment.c \ + entityreference.c \ notation.c xpath.c dom_iterators.c \ - typeinfo.c domerror.c domlocator.c namednodemap.c userdatahandler.c], + namednodemap.c], $ext_shared) PHP_SUBST(DOM_SHARED_LIBADD) PHP_INSTALL_HEADERS([ext/dom/xml_common.h]) diff --git a/ext/dom/config.w32 b/ext/dom/config.w32 index 1ac3c614a5..cd5f5a6cb8 100644 --- a/ext/dom/config.w32 +++ b/ext/dom/config.w32 @@ -7,14 +7,14 @@ if (PHP_DOM == "yes") { ADD_EXTENSION_DEP('dom', 'libxml') && CHECK_HEADER_ADD_INCLUDE("libxml/parser.h", "CFLAGS_DOM", PHP_PHP_BUILD + "\\include\\libxml2") ) { - EXTENSION("dom", "php_dom.c attr.c document.c domerrorhandler.c \ - domstringlist.c domexception.c namelist.c processinginstruction.c \ + EXTENSION("dom", "php_dom.c attr.c document.c \ + domexception.c processinginstruction.c \ cdatasection.c documentfragment.c domimplementation.c element.c \ - node.c string_extend.c characterdata.c documenttype.c \ - domimplementationlist.c entity.c nodelist.c text.c comment.c \ - domconfiguration.c domimplementationsource.c entityreference.c \ - notation.c xpath.c dom_iterators.c typeinfo.c domerror.c \ - domlocator.c namednodemap.c userdatahandler.c"); + node.c characterdata.c documenttype.c \ + entity.c nodelist.c text.c comment.c \ + entityreference.c \ + notation.c xpath.c dom_iterators.c \ + namednodemap.c"); AC_DEFINE("HAVE_DOM", 1, "DOM support"); diff --git a/ext/dom/document.c b/ext/dom/document.c index df1e7a8dfb..ede0311b5d 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | @@ -109,12 +107,6 @@ ZEND_END_ARG_INFO(); ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_normalize_document, 0, 0, 0) ZEND_END_ARG_INFO(); -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(); - ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_load, 0, 0, 1) ZEND_ARG_INFO(0, source) ZEND_ARG_INFO(0, options) @@ -209,17 +201,16 @@ const zend_function_entry php_dom_document_class_functions[] = { /* {{{ */ PHP_FALIAS(getElementById, dom_document_get_element_by_id, arginfo_dom_document_get_element_by_id) PHP_FALIAS(adoptNode, dom_document_adopt_node, arginfo_dom_document_adopt_node) PHP_FALIAS(normalizeDocument, dom_document_normalize_document, arginfo_dom_document_normalize_document) - PHP_FALIAS(renameNode, dom_document_rename_node, arginfo_dom_document_rename_node) - PHP_ME(domdocument, load, arginfo_dom_document_load, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) + PHP_ME(domdocument, load, arginfo_dom_document_load, ZEND_ACC_PUBLIC) PHP_FALIAS(save, dom_document_save, arginfo_dom_document_save) - PHP_ME(domdocument, loadXML, arginfo_dom_document_loadxml, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) + PHP_ME(domdocument, loadXML, arginfo_dom_document_loadxml, ZEND_ACC_PUBLIC) PHP_FALIAS(saveXML, dom_document_savexml, arginfo_dom_document_savexml) PHP_ME(domdocument, __construct, arginfo_dom_document_construct, ZEND_ACC_PUBLIC) PHP_FALIAS(validate, dom_document_validate, arginfo_dom_document_validate) PHP_FALIAS(xinclude, dom_document_xinclude, arginfo_dom_document_xinclude) #if defined(LIBXML_HTML_ENABLED) - PHP_ME(domdocument, loadHTML, arginfo_dom_document_loadhtml, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_ME(domdocument, loadHTMLFile, arginfo_dom_document_loadhtmlfile, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) + PHP_ME(domdocument, loadHTML, arginfo_dom_document_loadhtml, ZEND_ACC_PUBLIC) + PHP_ME(domdocument, loadHTMLFile, arginfo_dom_document_loadhtmlfile, ZEND_ACC_PUBLIC) PHP_FALIAS(saveHTML, dom_document_save_html, arginfo_dom_document_savehtml) PHP_FALIAS(saveHTMLFile, dom_document_save_html_file, arginfo_dom_document_savehtmlfile) #endif /* defined(LIBXML_HTML_ENABLED) */ @@ -1262,16 +1253,6 @@ PHP_FUNCTION(dom_document_normalize_document) } /* }}} end dom_document_normalize_document */ -/* {{{ proto DOMNode dom_document_rename_node(node n, string namespaceURI, string qualifiedName) -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-renameNode -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_document_rename_node) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_document_rename_node */ - /* {{{ proto DOMDocument::__construct([string version], [string encoding]); */ PHP_METHOD(domdocument, __construct) { diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c index 9b222586ac..e84553db4d 100644 --- a/ext/dom/documentfragment.c +++ b/ext/dom/documentfragment.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c index dd8a647167..ea9e7eba05 100644 --- a/ext/dom/documenttype.c +++ b/ext/dom/documenttype.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | diff --git a/ext/dom/dom_ce.h b/ext/dom/dom_ce.h index a8b9c9227c..4fea77b8e2 100644 --- a/ext/dom/dom_ce.h +++ b/ext/dom/dom_ce.h @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | @@ -22,10 +20,6 @@ extern PHP_DOM_EXPORT zend_class_entry *dom_node_class_entry; extern PHP_DOM_EXPORT zend_class_entry *dom_domexception_class_entry; -extern PHP_DOM_EXPORT zend_class_entry *dom_domstringlist_class_entry; -extern PHP_DOM_EXPORT zend_class_entry *dom_namelist_class_entry; -extern PHP_DOM_EXPORT zend_class_entry *dom_domimplementationlist_class_entry; -extern PHP_DOM_EXPORT zend_class_entry *dom_domimplementationsource_class_entry; extern PHP_DOM_EXPORT zend_class_entry *dom_domimplementation_class_entry; extern PHP_DOM_EXPORT zend_class_entry *dom_documentfragment_class_entry; extern PHP_DOM_EXPORT zend_class_entry *dom_document_class_entry; @@ -36,19 +30,12 @@ extern PHP_DOM_EXPORT zend_class_entry *dom_attr_class_entry; extern PHP_DOM_EXPORT zend_class_entry *dom_element_class_entry; extern PHP_DOM_EXPORT zend_class_entry *dom_text_class_entry; extern PHP_DOM_EXPORT zend_class_entry *dom_comment_class_entry; -extern PHP_DOM_EXPORT zend_class_entry *dom_typeinfo_class_entry; -extern PHP_DOM_EXPORT zend_class_entry *dom_userdatahandler_class_entry; -extern PHP_DOM_EXPORT zend_class_entry *dom_domerror_class_entry; -extern PHP_DOM_EXPORT zend_class_entry *dom_domerrorhandler_class_entry; -extern PHP_DOM_EXPORT zend_class_entry *dom_domlocator_class_entry; -extern PHP_DOM_EXPORT zend_class_entry *dom_domconfiguration_class_entry; extern PHP_DOM_EXPORT zend_class_entry *dom_cdatasection_class_entry; extern PHP_DOM_EXPORT zend_class_entry *dom_documenttype_class_entry; extern PHP_DOM_EXPORT zend_class_entry *dom_notation_class_entry; extern PHP_DOM_EXPORT zend_class_entry *dom_entity_class_entry; extern PHP_DOM_EXPORT zend_class_entry *dom_entityreference_class_entry; extern PHP_DOM_EXPORT zend_class_entry *dom_processinginstruction_class_entry; -extern PHP_DOM_EXPORT zend_class_entry *dom_string_extend_class_entry; #if defined(LIBXML_XPATH_ENABLED) extern PHP_DOM_EXPORT zend_class_entry *dom_xpath_class_entry; #endif diff --git a/ext/dom/dom_fe.h b/ext/dom/dom_fe.h index b8c1ff2266..c4826edf42 100644 --- a/ext/dom/dom_fe.h +++ b/ext/dom/dom_fe.h @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | @@ -21,10 +19,6 @@ #define DOM_FE_H extern const zend_function_entry php_dom_domexception_class_functions[]; -extern const zend_function_entry php_dom_domstringlist_class_functions[]; -extern const zend_function_entry php_dom_namelist_class_functions[]; -extern const zend_function_entry php_dom_domimplementationlist_class_functions[]; -extern const zend_function_entry php_dom_domimplementationsource_class_functions[]; extern const zend_function_entry php_dom_domimplementation_class_functions[]; extern const zend_function_entry php_dom_documentfragment_class_functions[]; extern const zend_function_entry php_dom_document_class_functions[]; @@ -36,19 +30,12 @@ extern const zend_function_entry php_dom_attr_class_functions[]; extern const zend_function_entry php_dom_element_class_functions[]; extern const zend_function_entry php_dom_text_class_functions[]; extern const zend_function_entry php_dom_comment_class_functions[]; -extern const zend_function_entry php_dom_typeinfo_class_functions[]; -extern const zend_function_entry php_dom_userdatahandler_class_functions[]; -extern const zend_function_entry php_dom_domerror_class_functions[]; -extern const zend_function_entry php_dom_domerrorhandler_class_functions[]; -extern const zend_function_entry php_dom_domlocator_class_functions[]; -extern const zend_function_entry php_dom_domconfiguration_class_functions[]; extern const zend_function_entry php_dom_cdatasection_class_functions[]; extern const zend_function_entry php_dom_documenttype_class_functions[]; extern const zend_function_entry php_dom_notation_class_functions[]; extern const zend_function_entry php_dom_entity_class_functions[]; extern const zend_function_entry php_dom_entityreference_class_functions[]; extern const zend_function_entry php_dom_processinginstruction_class_functions[]; -extern const zend_function_entry php_dom_string_extend_class_functions[]; extern const zend_function_entry php_dom_xpath_class_functions[]; /* domexception errors */ @@ -79,20 +66,6 @@ typedef enum { VALIDATION_ERR = 16 } dom_exception_code; -/* domstringlist methods */ -PHP_FUNCTION(dom_domstringlist_item); - -/* domnamelist methods */ -PHP_FUNCTION(dom_namelist_get_name); -PHP_FUNCTION(dom_namelist_get_namespace_uri); - -/* domimplementationlist methods */ -PHP_FUNCTION(dom_domimplementationlist_item); - -/* domimplementationsource methods */ -PHP_FUNCTION(dom_domimplementationsource_get_domimplementation); -PHP_FUNCTION(dom_domimplementationsource_get_domimplementations); - /* domimplementation methods */ PHP_METHOD(domimplementation, hasFeature); PHP_METHOD(domimplementation, createDocumentType); @@ -224,23 +197,6 @@ PHP_METHOD(domtext, __construct); /* domcomment methods */ PHP_METHOD(domcomment, __construct); -/* domtypeinfo methods */ - -/* domuserdatahandler methods */ -PHP_FUNCTION(dom_userdatahandler_handle); - -/* domdomerror methods */ - -/* domerrorhandler methods */ -PHP_FUNCTION(dom_domerrorhandler_handle_error); - -/* domlocator methods */ - -/* domconfiguration methods */ -PHP_FUNCTION(dom_domconfiguration_set_parameter); -PHP_FUNCTION(dom_domconfiguration_get_parameter); -PHP_FUNCTION(dom_domconfiguration_can_set_parameter); - /* domcdatasection methods */ PHP_METHOD(domcdatasection, __construct); @@ -256,10 +212,6 @@ PHP_METHOD(domentityreference, __construct); /* domprocessinginstruction methods */ PHP_METHOD(domprocessinginstruction, __construct); -/* string_extend methods */ -PHP_FUNCTION(dom_string_extend_find_offset16); -PHP_FUNCTION(dom_string_extend_find_offset32); - #if defined(LIBXML_XPATH_ENABLED) /* xpath methods */ PHP_METHOD(domxpath, __construct); diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c index 7483235c0f..6a89861107 100644 --- a/ext/dom/dom_iterators.c +++ b/ext/dom/dom_iterators.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | diff --git a/ext/dom/dom_properties.h b/ext/dom/dom_properties.h index 73d404429e..793e18c363 100644 --- a/ext/dom/dom_properties.h +++ b/ext/dom/dom_properties.h @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | @@ -71,27 +69,6 @@ int dom_documenttype_public_id_read(dom_object *obj, zval *retval); int dom_documenttype_system_id_read(dom_object *obj, zval *retval); int dom_documenttype_internal_subset_read(dom_object *obj, zval *retval); -/* domerror properties */ -int dom_domerror_severity_read(dom_object *obj, zval *retval); -int dom_domerror_message_read(dom_object *obj, zval *retval); -int dom_domerror_type_read(dom_object *obj, zval *retval); -int dom_domerror_related_exception_read(dom_object *obj, zval *retval); -int dom_domerror_related_data_read(dom_object *obj, zval *retval); -int dom_domerror_location_read(dom_object *obj, zval *retval); - -/* domimplementationlist properties */ -int dom_domimplementationlist_length_read(dom_object *obj, zval *retval); - -/* domlocator properties */ -int dom_domlocator_line_number_read(dom_object *obj, zval *retval); -int dom_domlocator_column_number_read(dom_object *obj, zval *retval); -int dom_domlocator_offset_read(dom_object *obj, zval *retval); -int dom_domlocator_related_node_read(dom_object *obj, zval *retval); -int dom_domlocator_uri_read(dom_object *obj, zval *retval); - -/* domstringlist properties */ -int dom_domstringlist_length_read(dom_object *obj, zval *retval); - /* element properties */ int dom_element_tag_name_read(dom_object *obj, zval *retval); int dom_element_schema_type_info_read(dom_object *obj, zval *retval); @@ -110,9 +87,6 @@ int dom_entity_version_write(dom_object *obj, zval *newval); /* namednodemap properties */ int dom_namednodemap_length_read(dom_object *obj, zval *retval); -/* namelist properties */ -int dom_namelist_length_read(dom_object *obj, zval *retval); - /* node properties */ int dom_node_node_name_read(dom_object *obj, zval *retval); int dom_node_node_value_read(dom_object *obj, zval *retval); @@ -151,13 +125,11 @@ int dom_processinginstruction_data_write(dom_object *obj, zval *newval); /* text properties */ int dom_text_whole_text_read(dom_object *obj, zval *retval); -/* typeinfo properties */ -int dom_typeinfo_type_name_read(dom_object *obj, zval *retval); -int dom_typeinfo_type_namespace_read(dom_object *obj, zval *retval); - #if defined(LIBXML_XPATH_ENABLED) /* xpath properties */ int dom_xpath_document_read(dom_object *obj, zval *retval); +int dom_xpath_register_node_ns_read(dom_object *obj, zval *retval); +int dom_xpath_register_node_ns_write(dom_object *obj, zval *newval); #endif #endif /* DOM_PROPERTIERS_H */ diff --git a/ext/dom/domconfiguration.c b/ext/dom/domconfiguration.c deleted file mode 100644 index b1d8ef452a..0000000000 --- a/ext/dom/domconfiguration.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Christian Stocker <chregu@php.net> | - | Rob Richards <rrichards@php.net> | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - -/* {{{ arginfo */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_configuration_set_parameter, 0, 0, 2) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_configuration_get_parameter, 0, 0, 0) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO(); - -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_END_ARG_INFO(); -/* }}} */ - -/* -* class domdomconfiguration -* -* URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration -* Since: DOM Level 3 -*/ - -const zend_function_entry php_dom_domconfiguration_class_functions[] = { - PHP_FALIAS(setParameter, dom_domconfiguration_set_parameter, arginfo_dom_configuration_set_parameter) - PHP_FALIAS(getParameter, dom_domconfiguration_get_parameter, arginfo_dom_configuration_get_parameter) - PHP_FALIAS(canSetParameter, dom_domconfiguration_can_set_parameter, arginfo_dom_configuration_can_set_parameter) - PHP_FE_END -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ proto dom_void dom_domconfiguration_set_parameter(string name, domuserdata value); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration-property -Since: -*/ -PHP_FUNCTION(dom_domconfiguration_set_parameter) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domconfiguration_set_parameter */ - -/* {{{ proto domdomuserdata dom_domconfiguration_get_parameter(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration-getParameter -Since: -*/ -PHP_FUNCTION(dom_domconfiguration_get_parameter) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domconfiguration_get_parameter */ - -/* {{{ proto bool dom_domconfiguration_can_set_parameter(string name, domuserdata value); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration-canSetParameter -Since: -*/ -PHP_FUNCTION(dom_domconfiguration_can_set_parameter) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domconfiguration_can_set_parameter */ - -/* }}} */ - -#endif diff --git a/ext/dom/domerror.c b/ext/dom/domerror.c deleted file mode 100644 index 1932d51408..0000000000 --- a/ext/dom/domerror.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Christian Stocker <chregu@php.net> | - | Rob Richards <rrichards@php.net> | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domerror -* -* URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-Interfaces-DOMError -* Since: DOM Level 3 -*/ - -const zend_function_entry php_dom_domerror_class_functions[] = { - PHP_FE_END -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ severity unsigned short -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-severity -Since: -*/ -int dom_domerror_severity_read(dom_object *obj, zval *retval) -{ - ZVAL_STRING(retval, "TEST"); - return SUCCESS; -} - -/* }}} */ - -/* {{{ message string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-message -Since: -*/ -int dom_domerror_message_read(dom_object *obj, zval *retval) -{ - ZVAL_STRING(retval, "TEST"); - return SUCCESS; -} - -/* }}} */ - -/* {{{ type string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-type -Since: -*/ -int dom_domerror_type_read(dom_object *obj, zval *retval) -{ - ZVAL_STRING(retval, "TEST"); - return SUCCESS; -} - -/* }}} */ - -/* {{{ relatedException object -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-relatedException -Since: -*/ -int dom_domerror_related_exception_read(dom_object *obj, zval *retval) -{ - ZVAL_STRING(retval, "TEST"); - return SUCCESS; -} - -/* }}} */ - -/* {{{ relatedData domobject -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-relatedData -Since: -*/ -int dom_domerror_related_data_read(dom_object *obj, zval *retval) -{ - ZVAL_STRING(retval, "TEST"); - return SUCCESS; -} - -/* }}} */ - -/* {{{ location domlocator -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-location -Since: -*/ -int dom_domerror_location_read(dom_object *obj, zval *retval) -{ - ZVAL_STRING(retval, "TEST"); - return SUCCESS; -} - -/* }}} */ - -/* }}} */ - -#endif diff --git a/ext/dom/domerrorhandler.c b/ext/dom/domerrorhandler.c deleted file mode 100644 index 344cb77c4f..0000000000 --- a/ext/dom/domerrorhandler.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Christian Stocker <chregu@php.net> | - | Rob Richards <rrichards@php.net> | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - -/* {{{ arginfo */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_domerrorhandler_handle_error, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, error, DOMDomError, 0) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class domerrorhandler -* -* URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-Interfaces-DOMErrorHandler -* Since: DOM Level 3 -*/ - -const zend_function_entry php_dom_domerrorhandler_class_functions[] = { - PHP_FALIAS(handleError, dom_domerrorhandler_handle_error, arginfo_dom_domerrorhandler_handle_error) - PHP_FE_END -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ proto dom_boolean dom_domerrorhandler_handle_error(domerror error); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-ERRORS-DOMErrorHandler-handleError -Since: -*/ -PHP_FUNCTION(dom_domerrorhandler_handle_error) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domerrorhandler_handle_error */ - -/* }}} */ - -#endif diff --git a/ext/dom/domexception.c b/ext/dom/domexception.c index 922d01c95e..e398a8003b 100644 --- a/ext/dom/domexception.c +++ b/ext/dom/domexception.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c index 05e99af39b..abbda2699e 100644 --- a/ext/dom/domimplementation.c +++ b/ext/dom/domimplementation.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | @@ -55,10 +53,10 @@ ZEND_END_ARG_INFO(); */ const zend_function_entry php_dom_domimplementation_class_functions[] = { - PHP_ME(domimplementation, getFeature, arginfo_dom_implementation_get_feature, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_ME(domimplementation, hasFeature, arginfo_dom_implementation_has_feature, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_ME(domimplementation, createDocumentType, arginfo_dom_implementation_create_documenttype, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_ME(domimplementation, createDocument, arginfo_dom_implementation_create_document, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) + PHP_ME(domimplementation, getFeature, arginfo_dom_implementation_get_feature, ZEND_ACC_PUBLIC) + PHP_ME(domimplementation, hasFeature, arginfo_dom_implementation_has_feature, ZEND_ACC_PUBLIC) + PHP_ME(domimplementation, createDocumentType, arginfo_dom_implementation_create_documenttype, ZEND_ACC_PUBLIC) + PHP_ME(domimplementation, createDocument, arginfo_dom_implementation_create_document, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/dom/domimplementationlist.c b/ext/dom/domimplementationlist.c deleted file mode 100644 index 9b248d4a02..0000000000 --- a/ext/dom/domimplementationlist.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Christian Stocker <chregu@php.net> | - | Rob Richards <rrichards@php.net> | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - -/* {{{ arginfo */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementationlist_item, 0, 0, 1) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class domimplementationlist -* -* URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationList -* Since: DOM Level 3 -*/ - -const zend_function_entry php_dom_domimplementationlist_class_functions[] = { - PHP_FALIAS(item, dom_domimplementationlist_item, arginfo_dom_implementationlist_item) - PHP_FE_END -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ length unsigned long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationList-length -Since: -*/ -int dom_domimplementationlist_length_read(dom_object *obj, zval *retval) -{ - ZVAL_STRING(retval, "TEST"); - return SUCCESS; -} - -/* }}} */ - -/* {{{ proto domdomimplementation dom_domimplementationlist_item(int index); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationList-item -Since: -*/ -PHP_FUNCTION(dom_domimplementationlist_item) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domimplementationlist_item */ - -/* }}} */ - -#endif diff --git a/ext/dom/domimplementationsource.c b/ext/dom/domimplementationsource.c deleted file mode 100644 index 7f3f8b9dfc..0000000000 --- a/ext/dom/domimplementationsource.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Christian Stocker <chregu@php.net> | - | Rob Richards <rrichards@php.net> | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementationsource_getdomimplementation, 0, 0, 1) - ZEND_ARG_INFO(0, features) -ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementationsource_getdomimplementations, 0, 0, 1) - ZEND_ARG_INFO(0, features) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class domimplementationsource -* -* URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationSource -* Since: DOM Level 3 -*/ - -const zend_function_entry php_dom_domimplementationsource_class_functions[] = { - PHP_FALIAS(getDomimplementation, dom_domimplementationsource_get_domimplementation, arginfo_dom_implementationsource_getdomimplementation) - PHP_FALIAS(getDomimplementations, dom_domimplementationsource_get_domimplementations, arginfo_dom_implementationsource_getdomimplementations) - PHP_FE_END -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ proto domdomimplementation dom_domimplementationsource_get_domimplementation(string features); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-getDOMImpl -Since: -*/ -PHP_FUNCTION(dom_domimplementationsource_get_domimplementation) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domimplementationsource_get_domimplementation */ - -/* {{{ proto domimplementationlist dom_domimplementationsource_get_domimplementations(string features); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-getDOMImpls -Since: -*/ -PHP_FUNCTION(dom_domimplementationsource_get_domimplementations) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domimplementationsource_get_domimplementations */ - -/* }}} */ - -#endif diff --git a/ext/dom/domlocator.c b/ext/dom/domlocator.c deleted file mode 100644 index 7ad0ff8866..0000000000 --- a/ext/dom/domlocator.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Christian Stocker <chregu@php.net> | - | Rob Richards <rrichards@php.net> | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domlocator -* -* URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Interfaces-DOMLocator -* Since: DOM Level 3 -*/ - -const zend_function_entry php_dom_domlocator_class_functions[] = { - PHP_FE_END -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ line_number long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-line-number -Since: -*/ -int dom_domlocator_line_number_read(dom_object *obj, zval *retval) -{ - ZVAL_STRING(retval, "TEST"); - return SUCCESS; -} - -/* }}} */ - -/* {{{ column_number long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-column-number -Since: -*/ -int dom_domlocator_column_number_read(dom_object *obj, zval *retval) -{ - ZVAL_STRING(retval, "TEST"); - return SUCCESS; -} - -/* }}} */ - -/* {{{ offset long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-offset -Since: -*/ -int dom_domlocator_offset_read(dom_object *obj, zval *retval) -{ - ZVAL_STRING(retval, "TEST"); - return SUCCESS; -} - -/* }}} */ - -/* {{{ related_node node -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-node -Since: -*/ -int dom_domlocator_related_node_read(dom_object *obj, zval *retval) -{ - ZVAL_STRING(retval, "TEST"); - return SUCCESS; -} - -/* }}} */ - -/* {{{ uri string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-uri -Since: -*/ -int dom_domlocator_uri_read(dom_object *obj, zval *retval) -{ - ZVAL_STRING(retval, "TEST"); - return SUCCESS; -} - -/* }}} */ - -/* }}} */ - -#endif diff --git a/ext/dom/domstringlist.c b/ext/dom/domstringlist.c deleted file mode 100644 index 224b924c1a..0000000000 --- a/ext/dom/domstringlist.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Christian Stocker <chregu@php.net> | - | Rob Richards <rrichards@php.net> | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - -/* {{{ arginfo */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_stringlist_item, 0, 0, 1) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class domstringlist -* -* URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMStringList -* Since: DOM Level 3 -*/ - -const zend_function_entry php_dom_domstringlist_class_functions[] = { - PHP_FALIAS(item, dom_domstringlist_item, arginfo_dom_stringlist_item) - PHP_FE_END -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ length unsigned long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMStringList-length -Since: -*/ -int dom_domstringlist_length_read(dom_object *obj, zval *retval) -{ - ZVAL_STRING(retval, "TEST"); - return SUCCESS; -} - -/* }}} */ - -/* {{{ proto domstring dom_domstringlist_item(int index); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMStringList-item -Since: -*/ -PHP_FUNCTION(dom_domstringlist_item) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domstringlist_item */ - -/* }}} */ - -#endif diff --git a/ext/dom/element.c b/ext/dom/element.c index 51aba0e155..b0b070e18a 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | diff --git a/ext/dom/entity.c b/ext/dom/entity.c index b41255066a..6b01cb3fb2 100644 --- a/ext/dom/entity.c +++ b/ext/dom/entity.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c index f7c0c2a711..d4b0c14e39 100644 --- a/ext/dom/entityreference.c +++ b/ext/dom/entityreference.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c index 4b8df2734f..613cea3360 100644 --- a/ext/dom/namednodemap.c +++ b/ext/dom/namednodemap.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | @@ -30,14 +28,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_get_named_item, 0, 0, 1) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO(); -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(); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_remove_named_item, 0, 0, 0) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO(); - ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_item, 0, 0, 0) ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO(); @@ -47,15 +37,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_get_named_item_ns, 0, 0, 0) ZEND_ARG_INFO(0, localName) ZEND_END_ARG_INFO(); -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(); - -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) -ZEND_END_ARG_INFO(); - ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_count, 0, 0, 0) ZEND_END_ARG_INFO(); /* }}} */ @@ -69,12 +50,8 @@ ZEND_END_ARG_INFO(); const zend_function_entry php_dom_namednodemap_class_functions[] = { /* {{{ */ PHP_FALIAS(getNamedItem, dom_namednodemap_get_named_item, arginfo_dom_namednodemap_get_named_item) - PHP_FALIAS(setNamedItem, dom_namednodemap_set_named_item, arginfo_dom_namednodemap_set_named_item) - PHP_FALIAS(removeNamedItem, dom_namednodemap_remove_named_item, arginfo_dom_namednodemap_remove_named_item) PHP_FALIAS(item, dom_namednodemap_item, arginfo_dom_namednodemap_item) PHP_FALIAS(getNamedItemNS, dom_namednodemap_get_named_item_ns, arginfo_dom_namednodemap_get_named_item_ns) - PHP_FALIAS(setNamedItemNS, dom_namednodemap_set_named_item_ns, arginfo_dom_namednodemap_set_named_item_ns) - PHP_FALIAS(removeNamedItemNS, dom_namednodemap_remove_named_item_ns, arginfo_dom_namednodemap_remove_named_item_ns) PHP_FALIAS(count, dom_namednodemap_count, arginfo_dom_namednodemap_count) PHP_FE_END }; @@ -177,26 +154,6 @@ PHP_FUNCTION(dom_namednodemap_get_named_item) } /* }}} end dom_namednodemap_get_named_item */ -/* {{{ proto DOMNode dom_namednodemap_set_named_item(DOMNode arg); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1025163788 -Since: -*/ -PHP_FUNCTION(dom_namednodemap_set_named_item) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namednodemap_set_named_item */ - -/* {{{ proto DOMNode dom_namednodemap_remove_named_item(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D58B193 -Since: -*/ -PHP_FUNCTION(dom_namednodemap_remove_named_item) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namednodemap_remove_named_item */ - /* {{{ proto DOMNode dom_namednodemap_item(int index); URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-349467F9 Since: @@ -317,26 +274,6 @@ PHP_FUNCTION(dom_namednodemap_get_named_item_ns) } /* }}} end dom_namednodemap_get_named_item_ns */ -/* {{{ proto DOMNode dom_namednodemap_set_named_item_ns(DOMNode arg); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-setNamedItemNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_namednodemap_set_named_item_ns) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namednodemap_set_named_item_ns */ - -/* {{{ proto DOMNode dom_namednodemap_remove_named_item_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-removeNamedItemNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_namednodemap_remove_named_item_ns) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namednodemap_remove_named_item_ns */ - /* {{{ proto int|bool dom_namednodemap_count(); */ PHP_FUNCTION(dom_namednodemap_count) diff --git a/ext/dom/namelist.c b/ext/dom/namelist.c deleted file mode 100644 index a235536bb5..0000000000 --- a/ext/dom/namelist.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Christian Stocker <chregu@php.net> | - | Rob Richards <rrichards@php.net> | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - -/* {{{ arginfo */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namelist_get_name, 0, 0, 1) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namelist_get_namespace_uri, 0, 0, 1) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class DOMNameList -* -* URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList -* Since: DOM Level 3 -*/ - -const zend_function_entry php_dom_namelist_class_functions[] = { - PHP_FALIAS(getName, dom_namelist_get_name, arginfo_dom_namelist_get_name) - PHP_FALIAS(getNamespaceURI, dom_namelist_get_namespace_uri, arginfo_dom_namelist_get_namespace_uri) - PHP_FE_END -}; - -/* {{{ length int -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-length -Since: -*/ -int dom_namelist_length_read(dom_object *obj, zval *retval) -{ - ZVAL_STRING(retval, "TEST"); - return SUCCESS; -} - -/* }}} */ - -/* {{{ proto string dom_namelist_get_name(int index); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-getName -Since: -*/ -PHP_FUNCTION(dom_namelist_get_name) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namelist_get_name */ - -/* {{{ proto string dom_namelist_get_namespace_uri(int index); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-getNamespaceURI -Since: -*/ -PHP_FUNCTION(dom_namelist_get_namespace_uri) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namelist_get_namespace_uri */ - -#endif diff --git a/ext/dom/node.c b/ext/dom/node.c index 609d1a6116..2e74531467 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | @@ -82,25 +80,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_lookup_namespace_uri, 0, 0, 1) ZEND_ARG_INFO(0, prefix) ZEND_END_ARG_INFO(); -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(); - -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(); - -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_INFO(0, handler) -ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_get_user_data, 0, 0, 1) - ZEND_ARG_INFO(0, key) -ZEND_END_ARG_INFO(); - ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_getNodePath, 0, 0, 0) ZEND_END_ARG_INFO(); @@ -145,10 +124,6 @@ const zend_function_entry php_dom_node_class_functions[] = { /* {{{ */ PHP_FALIAS(lookupPrefix, dom_node_lookup_prefix, arginfo_dom_node_lookup_prefix) PHP_FALIAS(isDefaultNamespace, dom_node_is_default_namespace, arginfo_dom_node_is_default_namespace) PHP_FALIAS(lookupNamespaceUri, dom_node_lookup_namespace_uri, arginfo_dom_node_lookup_namespace_uri) - PHP_FALIAS(isEqualNode, dom_node_is_equal_node, arginfo_dom_node_is_equal_node) - PHP_FALIAS(getFeature, dom_node_get_feature, arginfo_dom_node_get_feature) - PHP_FALIAS(setUserData, dom_node_set_user_data, arginfo_dom_node_set_user_data) - PHP_FALIAS(getUserData, dom_node_get_user_data, arginfo_dom_node_get_user_data) PHP_ME(domnode, getNodePath, arginfo_dom_node_getNodePath, ZEND_ACC_PUBLIC) PHP_ME(domnode, getLineNo, arginfo_dom_node_getLineNo, ZEND_ACC_PUBLIC) PHP_ME(domnode, C14N, arginfo_dom_node_C14N, ZEND_ACC_PUBLIC) @@ -1228,7 +1203,7 @@ PHP_FUNCTION(dom_node_remove_child) } php_dom_throw_error(NOT_FOUND_ERR, stricterror); - RETURN_FALSE + RETURN_FALSE; } /* }}} end dom_node_remove_child */ @@ -1654,46 +1629,6 @@ PHP_FUNCTION(dom_node_lookup_namespace_uri) } /* }}} end dom_node_lookup_namespace_uri */ -/* {{{ proto bool dom_node_is_equal_node(DomNode arg); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-isEqualNode -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_is_equal_node) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_node_is_equal_node */ - -/* {{{ proto DomNode dom_node_get_feature(string feature, string version); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-getFeature -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_get_feature) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_node_get_feature */ - -/* {{{ proto mixed dom_node_set_user_data(string key, mixed data, userdatahandler handler); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-setUserData -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_set_user_data) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_node_set_user_data */ - -/* {{{ proto mixed dom_node_get_user_data(string key); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-getUserData -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_get_user_data) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_node_get_user_data */ - static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */ { zval *id; diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c index 84c4a9eb73..4c6967ffce 100644 --- a/ext/dom/nodelist.c +++ b/ext/dom/nodelist.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | diff --git a/ext/dom/notation.c b/ext/dom/notation.c index 2fc3a84fec..2256b359d8 100644 --- a/ext/dom/notation.c +++ b/ext/dom/notation.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 726b74b934..cdde529e2f 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | @@ -36,10 +34,6 @@ /* {{{ class entries */ PHP_DOM_EXPORT zend_class_entry *dom_node_class_entry; PHP_DOM_EXPORT zend_class_entry *dom_domexception_class_entry; -PHP_DOM_EXPORT zend_class_entry *dom_domstringlist_class_entry; -PHP_DOM_EXPORT zend_class_entry *dom_namelist_class_entry; -PHP_DOM_EXPORT zend_class_entry *dom_domimplementationlist_class_entry; -PHP_DOM_EXPORT zend_class_entry *dom_domimplementationsource_class_entry; PHP_DOM_EXPORT zend_class_entry *dom_domimplementation_class_entry; PHP_DOM_EXPORT zend_class_entry *dom_documentfragment_class_entry; PHP_DOM_EXPORT zend_class_entry *dom_document_class_entry; @@ -50,19 +44,12 @@ PHP_DOM_EXPORT zend_class_entry *dom_attr_class_entry; PHP_DOM_EXPORT zend_class_entry *dom_element_class_entry; PHP_DOM_EXPORT zend_class_entry *dom_text_class_entry; PHP_DOM_EXPORT zend_class_entry *dom_comment_class_entry; -PHP_DOM_EXPORT zend_class_entry *dom_typeinfo_class_entry; -PHP_DOM_EXPORT zend_class_entry *dom_userdatahandler_class_entry; -PHP_DOM_EXPORT zend_class_entry *dom_domerror_class_entry; -PHP_DOM_EXPORT zend_class_entry *dom_domerrorhandler_class_entry; -PHP_DOM_EXPORT zend_class_entry *dom_domlocator_class_entry; -PHP_DOM_EXPORT zend_class_entry *dom_domconfiguration_class_entry; PHP_DOM_EXPORT zend_class_entry *dom_cdatasection_class_entry; PHP_DOM_EXPORT zend_class_entry *dom_documenttype_class_entry; PHP_DOM_EXPORT zend_class_entry *dom_notation_class_entry; PHP_DOM_EXPORT zend_class_entry *dom_entity_class_entry; PHP_DOM_EXPORT zend_class_entry *dom_entityreference_class_entry; PHP_DOM_EXPORT zend_class_entry *dom_processinginstruction_class_entry; -PHP_DOM_EXPORT zend_class_entry *dom_string_extend_class_entry; #if defined(LIBXML_XPATH_ENABLED) PHP_DOM_EXPORT zend_class_entry *dom_xpath_class_entry; #endif @@ -77,9 +64,6 @@ zend_object_handlers dom_xpath_object_handlers; static HashTable classes; /* {{{ prop handler tables */ -static HashTable dom_domstringlist_prop_handlers; -static HashTable dom_namelist_prop_handlers; -static HashTable dom_domimplementationlist_prop_handlers; static HashTable dom_document_prop_handlers; static HashTable dom_node_prop_handlers; static HashTable dom_nodelist_prop_handlers; @@ -88,9 +72,6 @@ static HashTable dom_characterdata_prop_handlers; static HashTable dom_attr_prop_handlers; static HashTable dom_element_prop_handlers; static HashTable dom_text_prop_handlers; -static HashTable dom_typeinfo_prop_handlers; -static HashTable dom_domerror_prop_handlers; -static HashTable dom_domlocator_prop_handlers; static HashTable dom_documenttype_prop_handlers; static HashTable dom_notation_prop_handlers; static HashTable dom_entity_prop_handlers; @@ -310,31 +291,27 @@ static void dom_register_prop_handler(HashTable *prop_handler, char *name, size_ } /* }}} */ -static zval *dom_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */ +static zval *dom_get_property_ptr_ptr(zend_object *object, zend_string *name, int type, void **cache_slot) /* {{{ */ { - dom_object *obj = Z_DOMOBJ_P(object); - zend_string *member_str = zval_get_string(member); + dom_object *obj = php_dom_obj_from_obj(object); zval *retval = NULL; - if (!obj->prop_handler || !zend_hash_exists(obj->prop_handler, member_str)) { - retval = zend_std_get_property_ptr_ptr(object, member, type, cache_slot); + if (!obj->prop_handler || !zend_hash_exists(obj->prop_handler, name)) { + retval = zend_std_get_property_ptr_ptr(object, name, type, cache_slot); } - - zend_string_release_ex(member_str, 0); return retval; } /* }}} */ /* {{{ dom_read_property */ -zval *dom_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) +zval *dom_read_property(zend_object *object, zend_string *name, int type, void **cache_slot, zval *rv) { - dom_object *obj = Z_DOMOBJ_P(object); - zend_string *member_str = zval_get_string(member); + dom_object *obj = php_dom_obj_from_obj(object); zval *retval; dom_prop_handler *hnd = NULL; if (obj->prop_handler != NULL) { - hnd = zend_hash_find_ptr(obj->prop_handler, member_str); + hnd = zend_hash_find_ptr(obj->prop_handler, name); } else if (instanceof_function(obj->std.ce, dom_node_class_entry)) { php_error(E_WARNING, "Couldn't fetch %s. Node no longer exists", ZSTR_VAL(obj->std.ce->name)); } @@ -347,46 +324,41 @@ zval *dom_read_property(zval *object, zval *member, int type, void **cache_slot, retval = &EG(uninitialized_zval); } } else { - retval = zend_std_read_property(object, member, type, cache_slot, rv); + retval = zend_std_read_property(object, name, type, cache_slot, rv); } - zend_string_release_ex(member_str, 0); return retval; } /* }}} */ /* {{{ dom_write_property */ -zval *dom_write_property(zval *object, zval *member, zval *value, void **cache_slot) +zval *dom_write_property(zend_object *object, zend_string *name, zval *value, void **cache_slot) { - dom_object *obj = Z_DOMOBJ_P(object); - zend_string *member_str = zval_get_string(member); + dom_object *obj = php_dom_obj_from_obj(object); dom_prop_handler *hnd = NULL; if (obj->prop_handler != NULL) { - hnd = zend_hash_find_ptr(obj->prop_handler, member_str); + hnd = zend_hash_find_ptr(obj->prop_handler, name); } if (hnd) { hnd->write_func(obj, value); } else { - value = zend_std_write_property(object, member, value, cache_slot); + value = zend_std_write_property(object, name, value, cache_slot); } - zend_string_release_ex(member_str, 0); - return value; } /* }}} */ /* {{{ dom_property_exists */ -static int dom_property_exists(zval *object, zval *member, int check_empty, void **cache_slot) +static int dom_property_exists(zend_object *object, zend_string *name, int check_empty, void **cache_slot) { - dom_object *obj = Z_DOMOBJ_P(object); - zend_string *member_str = zval_get_string(member); + dom_object *obj = php_dom_obj_from_obj(object); dom_prop_handler *hnd = NULL; int retval = 0; if (obj->prop_handler != NULL) { - hnd = zend_hash_find_ptr(obj->prop_handler, member_str); + hnd = zend_hash_find_ptr(obj->prop_handler, name); } if (hnd) { zval tmp; @@ -402,17 +374,16 @@ static int dom_property_exists(zval *object, zval *member, int check_empty, void zval_ptr_dtor(&tmp); } } else { - retval = zend_std_has_property(object, member, check_empty, cache_slot); + retval = zend_std_has_property(object, name, check_empty, cache_slot); } - zend_string_release_ex(member_str, 0); return retval; } /* }}} */ -static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp) /* {{{ */ +static HashTable* dom_get_debug_info_helper(zend_object *object, int *is_temp) /* {{{ */ { - dom_object *obj = Z_DOMOBJ_P(object); + dom_object *obj = php_dom_obj_from_obj(object); HashTable *debug_info, *prop_handlers = obj->prop_handler, *std_props; @@ -453,7 +424,7 @@ static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp) /* {{{ * } /* }}} */ -static HashTable* dom_get_debug_info(zval *object, int *is_temp) /* {{{ */ +static HashTable* dom_get_debug_info(zend_object *object, int *is_temp) /* {{{ */ { return dom_get_debug_info_helper(object, is_temp); } @@ -500,9 +471,9 @@ PHP_FUNCTION(dom_import_simplexml) static dom_object* dom_objects_set_class(zend_class_entry *class_type); -static zend_object *dom_objects_store_clone_obj(zval *zobject) /* {{{ */ +static zend_object *dom_objects_store_clone_obj(zend_object *zobject) /* {{{ */ { - dom_object *intern = Z_DOMOBJ_P(zobject); + dom_object *intern = php_dom_obj_from_obj(zobject); dom_object *clone = dom_objects_set_class(intern->std.ce); clone->std.handlers = dom_get_obj_handlers(); @@ -583,7 +554,9 @@ ZEND_GET_MODULE(dom) void dom_objects_free_storage(zend_object *object); void dom_nnodemap_objects_free_storage(zend_object *object); -static zend_object *dom_objects_store_clone_obj(zval *zobject); +static zval *dom_nodelist_read_dimension(zend_object *object, zval *offset, int type, zval *rv); +static int dom_nodelist_has_dimension(zend_object *object, zval *member, int check_empty); +static zend_object *dom_objects_store_clone_obj(zend_object *zobject); static void dom_nnodemap_object_dtor(zend_object *object); #if defined(LIBXML_XPATH_ENABLED) void dom_xpath_objects_free_storage(zend_object *object); @@ -617,25 +590,6 @@ PHP_MINIT_FUNCTION(dom) dom_domexception_class_entry->ce_flags |= ZEND_ACC_FINAL; zend_declare_property_long(dom_domexception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PUBLIC); - REGISTER_DOM_CLASS(ce, "DOMStringList", NULL, php_dom_domstringlist_class_functions, dom_domstringlist_class_entry); - - zend_hash_init(&dom_domstringlist_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1); - dom_register_prop_handler(&dom_domstringlist_prop_handlers, "length", sizeof("length")-1, dom_domstringlist_length_read, NULL); - zend_hash_add_ptr(&classes, ce.name, &dom_domstringlist_prop_handlers); - - REGISTER_DOM_CLASS(ce, "DOMNameList", NULL, php_dom_namelist_class_functions, dom_namelist_class_entry); - - zend_hash_init(&dom_namelist_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1); - dom_register_prop_handler(&dom_namelist_prop_handlers, "length", sizeof("length")-1, dom_namelist_length_read, NULL); - zend_hash_add_ptr(&classes, ce.name, &dom_namelist_prop_handlers); - - REGISTER_DOM_CLASS(ce, "DOMImplementationList", NULL, php_dom_domimplementationlist_class_functions, dom_domimplementationlist_class_entry); - - zend_hash_init(&dom_domimplementationlist_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1); - dom_register_prop_handler(&dom_domimplementationlist_prop_handlers, "length", sizeof("length")-1, dom_domimplementationlist_length_read, NULL); - zend_hash_add_ptr(&classes, ce.name, &dom_domimplementationlist_prop_handlers); - - REGISTER_DOM_CLASS(ce, "DOMImplementationSource", NULL, php_dom_domimplementationsource_class_functions, dom_domimplementationsource_class_entry); REGISTER_DOM_CLASS(ce, "DOMImplementation", NULL, php_dom_domimplementation_class_functions, dom_domimplementation_class_entry); REGISTER_DOM_CLASS(ce, "DOMNode", NULL, php_dom_node_class_functions, dom_node_class_entry); @@ -757,37 +711,6 @@ PHP_MINIT_FUNCTION(dom) REGISTER_DOM_CLASS(ce, "DOMComment", dom_characterdata_class_entry, php_dom_comment_class_functions, dom_comment_class_entry); zend_hash_add_ptr(&classes, ce.name, &dom_characterdata_prop_handlers); - REGISTER_DOM_CLASS(ce, "DOMTypeinfo", NULL, php_dom_typeinfo_class_functions, dom_typeinfo_class_entry); - - zend_hash_init(&dom_typeinfo_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1); - dom_register_prop_handler(&dom_typeinfo_prop_handlers, "typeName", sizeof("typeName")-1, dom_typeinfo_type_name_read, NULL); - dom_register_prop_handler(&dom_typeinfo_prop_handlers, "typeNamespace", sizeof("typeNamespace")-1, dom_typeinfo_type_namespace_read, NULL); - zend_hash_add_ptr(&classes, ce.name, &dom_typeinfo_prop_handlers); - - REGISTER_DOM_CLASS(ce, "DOMUserDataHandler", NULL, php_dom_userdatahandler_class_functions, dom_userdatahandler_class_entry); - REGISTER_DOM_CLASS(ce, "DOMDomError", NULL, php_dom_domerror_class_functions, dom_domerror_class_entry); - - zend_hash_init(&dom_domerror_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1); - dom_register_prop_handler(&dom_domerror_prop_handlers, "severity", sizeof("severity")-1, dom_domerror_severity_read, NULL); - dom_register_prop_handler(&dom_domerror_prop_handlers, "message", sizeof("message")-1, dom_domerror_message_read, NULL); - dom_register_prop_handler(&dom_domerror_prop_handlers, "type", sizeof("type")-1, dom_domerror_type_read, NULL); - dom_register_prop_handler(&dom_domerror_prop_handlers, "relatedException", sizeof("relatedException")-1, dom_domerror_related_exception_read, NULL); - dom_register_prop_handler(&dom_domerror_prop_handlers, "related_data", sizeof("related_data")-1, dom_domerror_related_data_read, NULL); - dom_register_prop_handler(&dom_domerror_prop_handlers, "location", sizeof("location")-1, dom_domerror_location_read, NULL); - zend_hash_add_ptr(&classes, ce.name, &dom_domerror_prop_handlers); - - REGISTER_DOM_CLASS(ce, "DOMErrorHandler", NULL, php_dom_domerrorhandler_class_functions, dom_domerrorhandler_class_entry); - REGISTER_DOM_CLASS(ce, "DOMLocator", NULL, php_dom_domlocator_class_functions, dom_domlocator_class_entry); - - zend_hash_init(&dom_domlocator_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1); - dom_register_prop_handler(&dom_domlocator_prop_handlers, "lineNumber", sizeof("lineNumber")-1, dom_domlocator_line_number_read, NULL); - dom_register_prop_handler(&dom_domlocator_prop_handlers, "columnNumber", sizeof("columnNumber")-1, dom_domlocator_column_number_read, NULL); - dom_register_prop_handler(&dom_domlocator_prop_handlers, "offset", sizeof("offset")-1, dom_domlocator_offset_read, NULL); - dom_register_prop_handler(&dom_domlocator_prop_handlers, "relatedNode", sizeof("relatedNode")-1, dom_domlocator_related_node_read, NULL); - dom_register_prop_handler(&dom_domlocator_prop_handlers, "uri", sizeof("uri")-1, dom_domlocator_uri_read, NULL); - zend_hash_add_ptr(&classes, ce.name, &dom_domlocator_prop_handlers); - - REGISTER_DOM_CLASS(ce, "DOMConfiguration", NULL, php_dom_domconfiguration_class_functions, dom_domconfiguration_class_entry); REGISTER_DOM_CLASS(ce, "DOMCdataSection", dom_text_class_entry, php_dom_cdatasection_class_functions, dom_cdatasection_class_entry); zend_hash_add_ptr(&classes, ce.name, &dom_text_prop_handlers); @@ -834,8 +757,6 @@ PHP_MINIT_FUNCTION(dom) zend_hash_merge(&dom_processinginstruction_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0); zend_hash_add_ptr(&classes, ce.name, &dom_processinginstruction_prop_handlers); - REGISTER_DOM_CLASS(ce, "DOMStringExtend", NULL, php_dom_string_extend_class_functions, dom_string_extend_class_entry); - #if defined(LIBXML_XPATH_ENABLED) memcpy(&dom_xpath_object_handlers, &dom_object_handlers, sizeof(zend_object_handlers)); dom_xpath_object_handlers.offset = XtOffsetOf(dom_xpath_object, dom) + XtOffsetOf(dom_object, std); @@ -847,6 +768,7 @@ PHP_MINIT_FUNCTION(dom) zend_hash_init(&dom_xpath_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1); dom_register_prop_handler(&dom_xpath_prop_handlers, "document", sizeof("document")-1, dom_xpath_document_read, NULL); + dom_register_prop_handler(&dom_xpath_prop_handlers, "registerNodeNamespaces", sizeof("registerNodeNamespaces")-1, dom_xpath_register_node_ns_read, dom_xpath_register_node_ns_write); zend_hash_add_ptr(&classes, ce.name, &dom_xpath_prop_handlers); #endif @@ -933,9 +855,6 @@ PHP_MINFO_FUNCTION(dom) PHP_MSHUTDOWN_FUNCTION(dom) /* {{{ */ { - zend_hash_destroy(&dom_domstringlist_prop_handlers); - zend_hash_destroy(&dom_namelist_prop_handlers); - zend_hash_destroy(&dom_domimplementationlist_prop_handlers); zend_hash_destroy(&dom_document_prop_handlers); zend_hash_destroy(&dom_node_prop_handlers); zend_hash_destroy(&dom_namespace_node_prop_handlers); @@ -945,9 +864,6 @@ PHP_MSHUTDOWN_FUNCTION(dom) /* {{{ */ zend_hash_destroy(&dom_attr_prop_handlers); zend_hash_destroy(&dom_element_prop_handlers); zend_hash_destroy(&dom_text_prop_handlers); - zend_hash_destroy(&dom_typeinfo_prop_handlers); - zend_hash_destroy(&dom_domerror_prop_handlers); - zend_hash_destroy(&dom_domlocator_prop_handlers); zend_hash_destroy(&dom_documenttype_prop_handlers); zend_hash_destroy(&dom_notation_prop_handlers); zend_hash_destroy(&dom_entity_prop_handlers); @@ -1102,6 +1018,7 @@ zend_object *dom_xpath_objects_new(zend_class_entry *class_type) dom_xpath_object *intern = zend_object_alloc(sizeof(dom_xpath_object), class_type); intern->registered_phpfunctions = zend_new_array(0); + intern->register_node_ns = 1; intern->dom.prop_handler = &dom_xpath_prop_handlers; intern->dom.std.handlers = &dom_xpath_object_handlers; @@ -1530,22 +1447,23 @@ xmlNsPtr dom_get_nsdecl(xmlNode *node, xmlChar *localName) { } /* }}} end dom_get_nsdecl */ -zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type, zval *rv) /* {{{ */ +static zval *dom_nodelist_read_dimension(zend_object *object, zval *offset, int type, zval *rv) /* {{{ */ { zval offset_copy; if (!offset) { + zend_throw_error(NULL, "Cannot access node list without offset"); return NULL; } ZVAL_LONG(&offset_copy, zval_get_long(offset)); - zend_call_method_with_1_params(object, Z_OBJCE_P(object), NULL, "item", rv, &offset_copy); + zend_call_method_with_1_params(object, object->ce, NULL, "item", rv, &offset_copy); return rv; } /* }}} end dom_nodelist_read_dimension */ -int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty) +static int dom_nodelist_has_dimension(zend_object *object, zval *member, int check_empty) { zend_long offset = zval_get_long(member); zval rv; @@ -1553,8 +1471,11 @@ int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty) if (offset < 0) { return 0; } else { - zval *length = zend_read_property(Z_OBJCE_P(object), object, "length", sizeof("length") - 1, 0, &rv); + zval obj; + zval *length; + ZVAL_OBJ(&obj, object); + length = zend_read_property(object->ce, &obj, "length", sizeof("length") - 1, 0, &rv); return length && offset < Z_LVAL_P(length); } } /* }}} end dom_nodelist_has_dimension */ diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h index ce377b5ce7..11ca442df2 100644 --- a/ext/dom/php_dom.h +++ b/ext/dom/php_dom.h @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | @@ -67,6 +65,7 @@ extern zend_module_entry dom_module_entry; typedef struct _dom_xpath_object { int registerPhpFunctions; + int register_node_ns; HashTable *registered_phpfunctions; HashTable *node_list; dom_object dom; @@ -125,8 +124,6 @@ xmlNode *php_dom_libxml_hash_iter(xmlHashTable *ht, int index); xmlNode *php_dom_libxml_notation_iter(xmlHashTable *ht, int index); zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref); void dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce); -zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type, zval *rv); -int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty); #define REGISTER_DOM_CLASS(ce, name, parent_ce, funcs, entry) \ INIT_CLASS_ENTRY(ce, name, funcs); \ diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c index 8cd2848c51..f672bb5f9c 100644 --- a/ext/dom/processinginstruction.c +++ b/ext/dom/processinginstruction.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | diff --git a/ext/dom/string_extend.c b/ext/dom/string_extend.c deleted file mode 100644 index ecc29b0dd6..0000000000 --- a/ext/dom/string_extend.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Christian Stocker <chregu@php.net> | - | Rob Richards <rrichards@php.net> | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - -/* {{{ arginfo */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_string_extend_find_offset16, 0, 0, 1) - ZEND_ARG_INFO(0, offset32) -ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_string_extend_find_offset32, 0, 0, 1) - ZEND_ARG_INFO(0, offset16) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class domstringextend -* -* URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#i18n-methods-StringExtend -* Since: -*/ - -const zend_function_entry php_dom_string_extend_class_functions[] = { - PHP_FALIAS(findOffset16, dom_string_extend_find_offset16, arginfo_dom_string_extend_find_offset16) - PHP_FALIAS(findOffset32, dom_string_extend_find_offset32, arginfo_dom_string_extend_find_offset32) - PHP_FE_END -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ proto int dom_string_extend_find_offset16(int offset32); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#i18n-methods-StringExtend-findOffset16 -Since: -*/ -PHP_FUNCTION(dom_string_extend_find_offset16) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_string_extend_find_offset16 */ - -/* {{{ proto int dom_string_extend_find_offset32(int offset16); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#i18n-methods-StringExtend-findOffset32 -Since: -*/ -PHP_FUNCTION(dom_string_extend_find_offset32) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_string_extend_find_offset32 */ - -/* }}} */ - -#endif diff --git a/ext/dom/tests/DOMAttr_ownerElement_error_001.phpt b/ext/dom/tests/DOMAttr_ownerElement_error_001.phpt index a7766541d5..e57c3da913 100644 --- a/ext/dom/tests/DOMAttr_ownerElement_error_001.phpt +++ b/ext/dom/tests/DOMAttr_ownerElement_error_001.phpt @@ -19,5 +19,5 @@ var_dump($attr->ownerElement); --EXPECTF-- Warning: Couldn't fetch DOMAttr. Node no longer exists in %s on line %d -Notice: Undefined property: DOMAttr::$ownerElement in %s on line %d +Warning: Undefined property: DOMAttr::$ownerElement in %s on line %d NULL diff --git a/ext/dom/tests/bug36756.phpt b/ext/dom/tests/bug36756.phpt index 4e47b86e4b..ccf9ba5049 100644 --- a/ext/dom/tests/bug36756.phpt +++ b/ext/dom/tests/bug36756.phpt @@ -31,5 +31,5 @@ child Warning: Couldn't fetch DOMElement. Node no longer exists in %sbug36756.php on line %d -Notice: Undefined property: DOMElement::$nodeType in %sbug36756.php on line %d +Warning: Undefined property: DOMElement::$nodeType in %s on line %d nodeType: diff --git a/ext/dom/tests/bug47430.phpt b/ext/dom/tests/bug47430.phpt index efce132a2e..7be332ecc1 100644 --- a/ext/dom/tests/bug47430.phpt +++ b/ext/dom/tests/bug47430.phpt @@ -11,7 +11,11 @@ $dom->loadXML($xml); $elements = $dom->getElementsByTagName('i'); foreach ($elements as $i) { - $i->previousSibling->nodeValue = ''; + try { + $i->previousSibling->nodeValue = ''; + } catch (Error $e) { + echo $e->getMessage(), "\n"; + } } $arr = array(); @@ -20,10 +24,9 @@ $arr[0] = 'Value'; print_r($arr); ?> ---EXPECTF-- -Warning: Creating default object from empty value in %s on line %d - -Warning: Creating default object from empty value in %s on line %d +--EXPECT-- +Attempt to assign property 'nodeValue' of non-object +Attempt to assign property 'nodeValue' of non-object Array ( [0] => Value diff --git a/ext/dom/tests/bug55700.phpt b/ext/dom/tests/bug55700.phpt new file mode 100644 index 0000000000..9e00beb53e --- /dev/null +++ b/ext/dom/tests/bug55700.phpt @@ -0,0 +1,40 @@ +--TEST-- +Bug #55700 (XPath namespace prefix conflict, global registerNodeNS flag) +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +$doc = new DOMDocument(); +$doc->loadXML('<prefix:root xmlns:prefix="urn:a" />'); + +$xp = new DOMXPath($doc, true); +$xp->registerNamespace('prefix', 'urn:b'); + +echo($xp->query('//prefix:root')->length . "\n"); + +$xp = new DOMXPath($doc, false); +$xp->registerNamespace('prefix', 'urn:b'); + +echo($xp->query('//prefix:root')->length . "\n"); + +var_dump($xp->registerNodeNamespaces); +$xp->registerNodeNamespaces = true; + +var_dump($xp->registerNodeNamespaces); + +echo($xp->query('//prefix:root')->length . "\n"); + +var_dump($xp); +?> +--EXPECT-- +1 +0 +bool(false) +bool(true) +1 +object(DOMXPath)#4 (2) { + ["document"]=> + string(22) "(object value omitted)" + ["registerNodeNamespaces"]=> + bool(true) +} diff --git a/ext/dom/tests/bug67949.phpt b/ext/dom/tests/bug67949.phpt index dd27352e6c..c49f0e4e0e 100644 --- a/ext/dom/tests/bug67949.phpt +++ b/ext/dom/tests/bug67949.phpt @@ -42,7 +42,11 @@ var_dump(isset($nodes[$offset]), $nodes[$offset]->textContent); var_dump($offset); echo "testing read_dimension with null offset\n"; -var_dump($nodes[][] = 1); +try { + var_dump($nodes[][] = 1); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} echo "testing attribute access\n"; $anchor = $doc->getElementsByTagName('a')[0]; @@ -58,7 +62,7 @@ bool(false) testing property access string(4) "data" -Notice: Trying to get property 'textContent' of non-object in %s on line %d +Warning: Trying to get property 'textContent' of non-object in %s on line %d NULL testing offset not a long array(1) { @@ -66,7 +70,7 @@ array(1) { string(4) "test" } -Notice: Trying to get property 'textContent' of non-object in %s on line %d +Warning: Trying to get property 'textContent' of non-object in %s on line %d bool(false) NULL array(1) { @@ -82,7 +86,7 @@ bool(true) string(4) "data" string(4) "test" testing read_dimension with null offset -NULL +Cannot access node list without offset testing attribute access string(4) "href" ==DONE== diff --git a/ext/dom/text.c b/ext/dom/text.c index 168d06d8f4..bd4e29a208 100644 --- a/ext/dom/text.c +++ b/ext/dom/text.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | @@ -34,10 +32,6 @@ ZEND_END_ARG_INFO(); ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_text_is_whitespace_in_element_content, 0, 0, 0) ZEND_END_ARG_INFO(); -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_text_replace_whole_text, 0, 0, 1) - ZEND_ARG_INFO(0, content) -ZEND_END_ARG_INFO(); - ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_text_construct, 0, 0, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO(); @@ -54,7 +48,6 @@ const zend_function_entry php_dom_text_class_functions[] = { PHP_FALIAS(splitText, dom_text_split_text, arginfo_dom_text_split_text) PHP_FALIAS(isWhitespaceInElementContent, dom_text_is_whitespace_in_element_content, arginfo_dom_text_is_whitespace_in_element_content) PHP_FALIAS(isElementContentWhitespace, dom_text_is_whitespace_in_element_content, arginfo_dom_text_is_whitespace_in_element_content) - PHP_FALIAS(replaceWholeText, dom_text_replace_whole_text, arginfo_dom_text_replace_whole_text) PHP_ME(domtext, __construct, arginfo_dom_text_construct, ZEND_ACC_PUBLIC) PHP_FE_END }; @@ -215,14 +208,4 @@ PHP_FUNCTION(dom_text_is_whitespace_in_element_content) } /* }}} end dom_text_is_whitespace_in_element_content */ -/* {{{ proto DOMText dom_text_replace_whole_text(string content) -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Text3-replaceWholeText -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_text_replace_whole_text) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_text_replace_whole_text */ - #endif diff --git a/ext/dom/typeinfo.c b/ext/dom/typeinfo.c deleted file mode 100644 index 2d918c2007..0000000000 --- a/ext/dom/typeinfo.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Christian Stocker <chregu@php.net> | - | Rob Richards <rrichards@php.net> | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domtypeinfo -* -* URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#TypeInfo -* Since: DOM Level 3 -*/ - -const zend_function_entry php_dom_typeinfo_class_functions[] = { - PHP_FE_END -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ type_name string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#TypeInfo-typeName -Since: -*/ -int dom_typeinfo_type_name_read(dom_object *obj, zval *retval) -{ - ZVAL_NULL(retval); - return SUCCESS; -} - -/* }}} */ - -/* {{{ type_namespace string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#TypeInfo-typeNamespace -Since: -*/ -int dom_typeinfo_type_namespace_read(dom_object *obj, zval *retval) -{ - ZVAL_NULL(retval); - return SUCCESS; -} - -/* }}} */ - -/* }}} */ - -#endif diff --git a/ext/dom/userdatahandler.c b/ext/dom/userdatahandler.c deleted file mode 100644 index 6695d65c15..0000000000 --- a/ext/dom/userdatahandler.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Christian Stocker <chregu@php.net> | - | Rob Richards <rrichards@php.net> | - +----------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domuserdatahandler -* -* URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#UserDataHandler -* Since: DOM Level 3 -*/ - -const zend_function_entry php_dom_userdatahandler_class_functions[] = { - PHP_FALIAS(handle, dom_userdatahandler_handle, NULL) - PHP_FE_END -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ proto dom_void dom_userdatahandler_handle(short operation, string key, domobject data, node src, node dst); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-handleUserDataEvent -Since: -*/ -PHP_FUNCTION(dom_userdatahandler_handle) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_userdatahandler_handle */ - -/* }}} */ - -#endif diff --git a/ext/dom/xml_common.h b/ext/dom/xml_common.h index 6f51fecace..d239b85b63 100644 --- a/ext/dom/xml_common.h +++ b/ext/dom/xml_common.h @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index 69fdcb947f..5582831698 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | @@ -37,6 +35,7 @@ /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_xpath_construct, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, doc, DOMDocument, 0) + ZEND_ARG_INFO(0, registerNodeNS) ZEND_END_ARG_INFO(); ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_xpath_register_ns, 0, 0, 2) @@ -251,12 +250,13 @@ static void dom_xpath_ext_function_object_php(xmlXPathParserContextPtr ctxt, int PHP_METHOD(domxpath, __construct) { zval *doc; + zend_bool register_node_ns = 1; xmlDocPtr docp = NULL; dom_object *docobj; dom_xpath_object *intern; xmlXPathContextPtr ctx, oldctx; - if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "O", &doc, dom_document_class_entry) == FAILURE) { + if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "O|b", &doc, dom_document_class_entry, ®ister_node_ns) == FAILURE) { return; } @@ -286,6 +286,7 @@ PHP_METHOD(domxpath, __construct) intern->dom.ptr = ctx; ctx->userData = (void *)intern; intern->dom.document = docobj->document; + intern->register_node_ns = register_node_ns; php_libxml_increment_doc_ref((php_libxml_node_object *) &intern->dom, docp); } } @@ -306,6 +307,26 @@ int dom_xpath_document_read(dom_object *obj, zval *retval) } /* }}} */ +/* {{{ registerNodeNamespaces bool*/ +static inline dom_xpath_object *php_xpath_obj_from_dom_obj(dom_object *obj) { + return (dom_xpath_object*)((char*)(obj) - XtOffsetOf(dom_xpath_object, dom)); +} + +int dom_xpath_register_node_ns_read(dom_object *obj, zval *retval) +{ + ZVAL_BOOL(retval, php_xpath_obj_from_dom_obj(obj)->register_node_ns); + + return SUCCESS; +} + +int dom_xpath_register_node_ns_write(dom_object *obj, zval *newval) +{ + php_xpath_obj_from_dom_obj(obj)->register_node_ns = zend_is_true(newval); + + return SUCCESS; +} +/* }}} */ + /* {{{ proto bool dom_xpath_register_ns(string prefix, string uri) */ PHP_FUNCTION(dom_xpath_register_ns) { @@ -329,7 +350,7 @@ PHP_FUNCTION(dom_xpath_register_ns) } if (xmlXPathRegisterNs(ctxp, prefix, ns_uri) != 0) { - RETURN_FALSE + RETURN_FALSE; } RETURN_TRUE; } @@ -356,15 +377,16 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */ char *expr; xmlDoc *docp = NULL; xmlNsPtr *ns = NULL; - zend_bool register_node_ns = 1; + zend_bool register_node_ns; id = ZEND_THIS; + intern = Z_XPATHOBJ_P(id); + register_node_ns = intern->register_node_ns; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|O!b", &expr, &expr_len, &context, dom_node_class_entry, ®ister_node_ns) == FAILURE) { return; } - intern = Z_XPATHOBJ_P(id); - ctxp = (xmlXPathContextPtr) intern->dom.ptr; if (ctxp == NULL) { php_error_docref(NULL, E_WARNING, "Invalid XPath Context"); |