From: Rob Richards Date: Fri, 8 Dec 2006 16:28:33 +0000 (+0000) Subject: mark more functions unicode safe X-Git-Tag: RELEASE_1_0_0RC1~759 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=95accd75bb13ba34251e13046fa3c1d5ca250ddb;p=php mark more functions unicode safe add tests --- diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c index b412bd9e8a..e18adb32bb 100644 --- a/ext/dom/documentfragment.c +++ b/ext/dom/documentfragment.c @@ -41,7 +41,7 @@ zend_function_entry php_dom_documentfragment_class_functions[] = { {NULL, NULL, NULL} }; -/* {{{ proto void DOMDocumentFragment::__construct(); */ +/* {{{ proto void DOMDocumentFragment::__construct() U */ PHP_METHOD(domdocumentfragment, __construct) { @@ -107,7 +107,7 @@ static void php_dom_xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc) { } } -/* {{{ proto void DOMDocumentFragment::appendXML(string data); */ +/* {{{ proto void DOMDocumentFragment::appendXML(string data) U */ PHP_METHOD(domdocumentfragment, appendXML) { zval *id; xmlNode *nodep; diff --git a/ext/dom/domconfiguration.c b/ext/dom/domconfiguration.c index 227fc6ce36..a17ca652c8 100644 --- a/ext/dom/domconfiguration.c +++ b/ext/dom/domconfiguration.c @@ -45,7 +45,7 @@ zend_function_entry php_dom_domconfiguration_class_functions[] = { /* {{{ attribute protos, not implemented yet */ -/* {{{ proto dom_void dom_domconfiguration_set_parameter(string name, domuserdata value); +/* {{{ proto dom_void dom_domconfiguration_set_parameter(string name, domuserdata value) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration-property Since: */ @@ -56,7 +56,7 @@ PHP_FUNCTION(dom_domconfiguration_set_parameter) /* }}} end dom_domconfiguration_set_parameter */ -/* {{{ proto domdomuserdata dom_domconfiguration_get_parameter(string name); +/* {{{ proto domdomuserdata dom_domconfiguration_get_parameter(string name) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration-getParameter Since: */ @@ -67,7 +67,7 @@ PHP_FUNCTION(dom_domconfiguration_get_parameter) /* }}} end dom_domconfiguration_get_parameter */ -/* {{{ proto boolean dom_domconfiguration_can_set_parameter(string name, domuserdata value); +/* {{{ proto boolean dom_domconfiguration_can_set_parameter(string name, domuserdata value) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration-canSetParameter Since: */ diff --git a/ext/dom/domerrorhandler.c b/ext/dom/domerrorhandler.c index 7905167531..f113466f95 100644 --- a/ext/dom/domerrorhandler.c +++ b/ext/dom/domerrorhandler.c @@ -43,7 +43,7 @@ zend_function_entry php_dom_domerrorhandler_class_functions[] = { /* {{{ attribute protos, not implemented yet */ -/* {{{ proto dom_boolean dom_domerrorhandler_handle_error(domerror error); +/* {{{ proto dom_boolean dom_domerrorhandler_handle_error(domerror error) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-ERRORS-DOMErrorHandler-handleError Since: */ diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c index e1218f0a73..88b38ba878 100644 --- a/ext/dom/domimplementation.c +++ b/ext/dom/domimplementation.c @@ -42,7 +42,7 @@ zend_function_entry php_dom_domimplementation_class_functions[] = { {NULL, NULL, NULL} }; -/* {{{ proto boolean dom_domimplementation_has_feature(string feature, string version); +/* {{{ proto boolean dom_domimplementation_has_feature(string feature, string version) URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-5CED94D7 Since: */ @@ -64,7 +64,7 @@ PHP_METHOD(domimplementation, hasFeature) /* }}} end dom_domimplementation_has_feature */ -/* {{{ proto DOMDocumentType dom_domimplementation_create_document_type(string qualifiedName, string publicId, string systemId); +/* {{{ proto DOMDocumentType dom_domimplementation_create_document_type(string qualifiedName, string publicId, string systemId) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Level-2-Core-DOM-createDocType Since: DOM Level 2 */ @@ -120,7 +120,7 @@ PHP_METHOD(domimplementation, createDocumentType) /* }}} end dom_domimplementation_create_document_type */ -/* {{{ proto DOMDocument dom_domimplementation_create_document(string namespaceURI, string qualifiedName, DOMDocumentType doctype); +/* {{{ proto DOMDocument dom_domimplementation_create_document(string namespaceURI, string qualifiedName, DOMDocumentType doctype) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Level-2-Core-DOM-createDocument Since: DOM Level 2 */ @@ -223,7 +223,7 @@ PHP_METHOD(domimplementation, createDocument) /* }}} end dom_domimplementation_create_document */ -/* {{{ proto DOMNode dom_domimplementation_get_feature(string feature, string version); +/* {{{ proto DOMNode dom_domimplementation_get_feature(string feature, string version) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementation3-getFeature Since: DOM Level 3 */ diff --git a/ext/dom/domimplementationlist.c b/ext/dom/domimplementationlist.c index 578a56a7dd..a22dc43368 100644 --- a/ext/dom/domimplementationlist.c +++ b/ext/dom/domimplementationlist.c @@ -59,7 +59,7 @@ int dom_domimplementationlist_length_read(dom_object *obj, zval **retval TSRMLS_ -/* {{{ proto domdomimplementation dom_domimplementationlist_item(int index); +/* {{{ proto domdomimplementation dom_domimplementationlist_item(int index) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationList-item Since: */ diff --git a/ext/dom/domimplementationsource.c b/ext/dom/domimplementationsource.c index 836f1a7569..15ce393764 100644 --- a/ext/dom/domimplementationsource.c +++ b/ext/dom/domimplementationsource.c @@ -44,7 +44,7 @@ zend_function_entry php_dom_domimplementationsource_class_functions[] = { /* {{{ attribute protos, not implemented yet */ -/* {{{ proto domdomimplementation dom_domimplementationsource_get_domimplementation(string features); +/* {{{ proto domdomimplementation dom_domimplementationsource_get_domimplementation(string features) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-getDOMImpl Since: */ @@ -55,7 +55,7 @@ PHP_FUNCTION(dom_domimplementationsource_get_domimplementation) /* }}} end dom_domimplementationsource_get_domimplementation */ -/* {{{ proto domimplementationlist dom_domimplementationsource_get_domimplementations(string features); +/* {{{ proto domimplementationlist dom_domimplementationsource_get_domimplementations(string features) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-getDOMImpls Since: */ diff --git a/ext/dom/domstringlist.c b/ext/dom/domstringlist.c index 1a2914c344..a7fba873b1 100644 --- a/ext/dom/domstringlist.c +++ b/ext/dom/domstringlist.c @@ -59,7 +59,7 @@ int dom_domstringlist_length_read(dom_object *obj, zval **retval TSRMLS_DC) -/* {{{ proto domstring dom_domstringlist_item(int index); +/* {{{ proto domstring dom_domstringlist_item(int index) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMStringList-item Since: */ diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c index c8cc8c2974..7a7a7c4415 100644 --- a/ext/dom/entityreference.c +++ b/ext/dom/entityreference.c @@ -40,7 +40,7 @@ zend_function_entry php_dom_entityreference_class_functions[] = { {NULL, NULL, NULL} }; -/* {{{ proto void DOMEntityReference::__construct(string name); */ +/* {{{ proto void DOMEntityReference::__construct(string name) U */ PHP_METHOD(domentityreference, __construct) { zval *id; diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c index 280b1bd61b..a96c636aaf 100644 --- a/ext/dom/namednodemap.c +++ b/ext/dom/namednodemap.c @@ -91,7 +91,7 @@ int dom_namednodemap_length_read(dom_object *obj, zval **retval TSRMLS_DC) -/* {{{ proto DOMNode dom_namednodemap_get_named_item(string name); +/* {{{ proto DOMNode dom_namednodemap_get_named_item(string name) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1074577549 Since: */ @@ -146,7 +146,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item) /* }}} end dom_namednodemap_get_named_item */ -/* {{{ proto DOMNode dom_namednodemap_set_named_item(DOMNode arg); +/* {{{ proto DOMNode dom_namednodemap_set_named_item(DOMNode arg) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1025163788 Since: */ @@ -157,7 +157,7 @@ PHP_FUNCTION(dom_namednodemap_set_named_item) /* }}} end dom_namednodemap_set_named_item */ -/* {{{ proto DOMNode dom_namednodemap_remove_named_item(string name); +/* {{{ proto DOMNode dom_namednodemap_remove_named_item(string name) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D58B193 Since: */ @@ -168,7 +168,7 @@ PHP_FUNCTION(dom_namednodemap_remove_named_item) /* }}} end dom_namednodemap_remove_named_item */ -/* {{{ proto DOMNode dom_namednodemap_item(int index); +/* {{{ proto DOMNode dom_namednodemap_item(int index) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-349467F9 Since: */ @@ -227,7 +227,7 @@ PHP_FUNCTION(dom_namednodemap_item) /* }}} end dom_namednodemap_item */ -/* {{{ proto DOMNode dom_namednodemap_get_named_item_ns(string namespaceURI, string localName); +/* {{{ proto DOMNode dom_namednodemap_get_named_item_ns(string namespaceURI, string localName) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-getNamedItemNS Since: DOM Level 2 */ @@ -282,7 +282,7 @@ 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); +/* {{{ proto DOMNode dom_namednodemap_set_named_item_ns(DOMNode arg) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-setNamedItemNS Since: DOM Level 2 */ @@ -293,7 +293,7 @@ PHP_FUNCTION(dom_namednodemap_set_named_item_ns) /* }}} end dom_namednodemap_set_named_item_ns */ -/* {{{ proto DOMNode dom_namednodemap_remove_named_item_ns(string namespaceURI, string localName); +/* {{{ proto DOMNode dom_namednodemap_remove_named_item_ns(string namespaceURI, string localName) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-removeNamedItemNS Since: DOM Level 2 */ diff --git a/ext/dom/namelist.c b/ext/dom/namelist.c index 8a3ce6aa1c..c3a19ffc41 100644 --- a/ext/dom/namelist.c +++ b/ext/dom/namelist.c @@ -58,7 +58,7 @@ int dom_namelist_length_read(dom_object *obj, zval **retval TSRMLS_DC) -/* {{{ proto string dom_namelist_get_name(int index); +/* {{{ proto string dom_namelist_get_name(int index) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-getName Since: */ @@ -69,7 +69,7 @@ PHP_FUNCTION(dom_namelist_get_name) /* }}} end dom_namelist_get_name */ -/* {{{ proto string dom_namelist_get_namespace_uri(int index); +/* {{{ proto string dom_namelist_get_namespace_uri(int index) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-getNamespaceURI Since: */ diff --git a/ext/dom/node.c b/ext/dom/node.c index 1169535ecb..3477bf2df8 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -905,7 +905,7 @@ static xmlNodePtr _php_dom_insert_fragment(xmlNodePtr nodep, xmlNodePtr prevsib, return newchild; } -/* {{{ proto domnode dom_node_insert_before(DomNode newChild, DomNode refChild); +/* {{{ proto domnode dom_node_insert_before(DomNode newChild, DomNode refChild) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-952280727 Since: */ @@ -1067,7 +1067,7 @@ PHP_FUNCTION(dom_node_insert_before) /* }}} end dom_node_insert_before */ -/* {{{ proto DomNode dom_node_replace_child(DomNode newChild, DomNode oldChild); +/* {{{ proto DomNode dom_node_replace_child(DomNode newChild, DomNode oldChild) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-785887307 Since: */ @@ -1159,7 +1159,7 @@ PHP_FUNCTION(dom_node_replace_child) /* }}} end dom_node_replace_child */ -/* {{{ proto DomNode dom_node_remove_child(DomNode oldChild); +/* {{{ proto DomNode dom_node_remove_child(DomNode oldChild) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1734834066 Since: */ @@ -1212,7 +1212,7 @@ PHP_FUNCTION(dom_node_remove_child) /* }}} end dom_node_remove_child */ -/* {{{ proto DomNode dom_node_append_child(DomNode newChild); +/* {{{ proto DomNode dom_node_append_child(DomNode newChild) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-184E7107 Since: */ @@ -1314,7 +1314,7 @@ PHP_FUNCTION(dom_node_append_child) /* }}} end dom_node_append_child */ -/* {{{ proto boolean dom_node_has_child_nodes(); +/* {{{ proto boolean dom_node_has_child_nodes() U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-810594187 Since: */ @@ -1343,7 +1343,7 @@ PHP_FUNCTION(dom_node_has_child_nodes) /* }}} end dom_node_has_child_nodes */ -/* {{{ proto DomNode dom_node_clone_node(boolean deep); +/* {{{ proto DomNode dom_node_clone_node(boolean deep) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-3A0ED0A4 Since: */ @@ -1407,7 +1407,7 @@ PHP_FUNCTION(dom_node_clone_node) -/* {{{ proto void dom_node_normalize(); +/* {{{ proto void dom_node_normalize() U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-normalize Since: */ @@ -1452,7 +1452,7 @@ PHP_FUNCTION(dom_node_is_supported) /* }}} end dom_node_is_supported */ -/* {{{ proto boolean dom_node_has_attributes(); +/* {{{ proto boolean dom_node_has_attributes() U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-NodeHasAttrs Since: DOM Level 2 */ @@ -1479,7 +1479,7 @@ PHP_FUNCTION(dom_node_has_attributes) } /* }}} end dom_node_has_attributes */ -/* {{{ proto short dom_node_compare_document_position(DomNode other); +/* {{{ proto short dom_node_compare_document_position(DomNode other) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-compareDocumentPosition Since: DOM Level 3 */ @@ -1490,7 +1490,7 @@ PHP_FUNCTION(dom_node_compare_document_position) /* }}} end dom_node_compare_document_position */ -/* {{{ proto boolean dom_node_is_same_node(DomNode other); +/* {{{ proto boolean dom_node_is_same_node(DomNode other) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-isSameNode Since: DOM Level 3 */ @@ -1517,7 +1517,7 @@ PHP_FUNCTION(dom_node_is_same_node) /* }}} end dom_node_is_same_node */ -/* {{{ proto string dom_node_lookup_prefix(string namespaceURI); +/* {{{ proto string dom_node_lookup_prefix(string namespaceURI) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-lookupNamespacePrefix Since: DOM Level 3 */ @@ -1569,7 +1569,7 @@ PHP_FUNCTION(dom_node_lookup_prefix) /* }}} end dom_node_lookup_prefix */ -/* {{{ proto boolean dom_node_is_default_namespace(string namespaceURI); +/* {{{ proto boolean dom_node_is_default_namespace(string namespaceURI) U URL: http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isDefaultNamespace Since: DOM Level 3 */ @@ -1600,7 +1600,7 @@ PHP_FUNCTION(dom_node_is_default_namespace) /* }}} end dom_node_is_default_namespace */ -/* {{{ proto string dom_node_lookup_namespace_uri(string prefix); +/* {{{ proto string dom_node_lookup_namespace_uri(string prefix) U URL: http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespaceURI Since: DOM Level 3 */ @@ -1630,7 +1630,7 @@ PHP_FUNCTION(dom_node_lookup_namespace_uri) /* }}} end dom_node_lookup_namespace_uri */ -/* {{{ proto boolean dom_node_is_equal_node(DomNode arg); +/* {{{ proto boolean dom_node_is_equal_node(DomNode arg) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-isEqualNode Since: DOM Level 3 */ @@ -1641,7 +1641,7 @@ PHP_FUNCTION(dom_node_is_equal_node) /* }}} end dom_node_is_equal_node */ -/* {{{ proto DomNode dom_node_get_feature(string feature, string version); +/* {{{ proto DomNode dom_node_get_feature(string feature, string version) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-getFeature Since: DOM Level 3 */ @@ -1652,7 +1652,7 @@ PHP_FUNCTION(dom_node_get_feature) /* }}} end dom_node_get_feature */ -/* {{{ proto DomUserData dom_node_set_user_data(string key, DomUserData data, userdatahandler handler); +/* {{{ proto DomUserData dom_node_set_user_data(string key, DomUserData data, userdatahandler handler) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-setUserData Since: DOM Level 3 */ @@ -1663,7 +1663,7 @@ PHP_FUNCTION(dom_node_set_user_data) /* }}} end dom_node_set_user_data */ -/* {{{ proto DomUserData dom_node_get_user_data(string key); +/* {{{ proto DomUserData dom_node_get_user_data(string key) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-getUserData Since: DOM Level 3 */ @@ -1919,14 +1919,14 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) } } -/* {{{ proto string DOMNode::C14N([bool exclusive [, bool with_comments [, array xpath [, array ns_prefixes]]]]) +/* {{{ proto string DOMNode::C14N([bool exclusive [, bool with_comments [, array xpath [, array ns_prefixes]]]]) U Canonicalize nodes to a string */ PHP_METHOD(domnode, C14N) { dom_canonicalization(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } -/* {{{ proto int DOMNode::C14NFile(string uri [, bool exclusive [, bool with_comments [, array xpath [, array ns_prefixes]]]]) +/* {{{ proto int DOMNode::C14NFile(string uri [, bool exclusive [, bool with_comments [, array xpath [, array ns_prefixes]]]]) U Canonicalize nodes to a file */ PHP_METHOD(domnode, C14NFile) { @@ -1935,7 +1935,7 @@ PHP_METHOD(domnode, C14NFile) #endif -/* {{{ proto int DOMNode::getNodePath() +/* {{{ proto int DOMNode::getNodePath() U Gets an xpath for a node */ PHP_METHOD(domnode, getNodePath) diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c index ac663db95b..2a9e2a6b58 100644 --- a/ext/dom/processinginstruction.c +++ b/ext/dom/processinginstruction.c @@ -40,7 +40,7 @@ zend_function_entry php_dom_processinginstruction_class_functions[] = { {NULL, NULL, NULL} }; -/* {{{ proto void DOMProcessingInstruction::__construct(string name, [string value]); */ +/* {{{ proto void DOMProcessingInstruction::__construct(string name, [string value]) U */ PHP_METHOD(domprocessinginstruction, __construct) { diff --git a/ext/dom/string_extend.c b/ext/dom/string_extend.c index 60c4a52ff9..2dda39ad45 100644 --- a/ext/dom/string_extend.c +++ b/ext/dom/string_extend.c @@ -44,7 +44,7 @@ zend_function_entry php_dom_string_extend_class_functions[] = { /* {{{ attribute protos, not implemented yet */ -/* {{{ proto int dom_string_extend_find_offset16(int offset32); +/* {{{ proto int dom_string_extend_find_offset16(int offset32) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#i18n-methods-StringExtend-findOffset16 Since: */ @@ -55,7 +55,7 @@ PHP_FUNCTION(dom_string_extend_find_offset16) /* }}} end dom_string_extend_find_offset16 */ -/* {{{ proto int dom_string_extend_find_offset32(int offset16); +/* {{{ proto int dom_string_extend_find_offset32(int offset16) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#i18n-methods-StringExtend-findOffset32 Since: */ diff --git a/ext/dom/tests/domattributes.phpt b/ext/dom/tests/domattributes.phpt index 9097a887e9..10a5538431 100644 --- a/ext/dom/tests/domattributes.phpt +++ b/ext/dom/tests/domattributes.phpt @@ -14,9 +14,10 @@ if(!$dom) { } $node = $dom->documentElement; - -$lang = $node->getAttributeNode('language'); -echo "Language: ".$lang->value."\n"; +if ($node->hasAttributes()) { + $lang = $node->getAttributeNode('language'); + echo "Language: ".$lang->value."\n"; +} $lang->value = 'en-US'; echo "Language: ".$lang->value."\n"; @@ -32,7 +33,18 @@ $top_element = $node->cloneNode(); print $dom->saveXML($top_element); +$dom->loadXML(b''); +$root = $dom->documentElement; +$nmap = $root->attributes; +print "\n\n"; + +if ($attr = $nmap->getNamedItemNS(NULL, 'att1')) { + print $attr->nodeValue."\n"; +} +if ($attr = $nmap->getNamedItemNS("urn::atest", 'att1')) { + print $attr->nodeValue."\n"; +} ?> --EXPECT-- @@ -41,3 +53,4 @@ Language: en-US Is ID?: NO +1 diff --git a/ext/dom/tests/domelement.phpt b/ext/dom/tests/domelement.phpt index bc69af602c..bae0baa964 100644 --- a/ext/dom/tests/domelement.phpt +++ b/ext/dom/tests/domelement.phpt @@ -14,7 +14,11 @@ if(!$dom) { } $node = $dom->documentElement; -echo "Tag Name: ".$node->tagName."\n"; +$node2 = $node->firstChild->parentNode; + +if ($node2->isSameNode($node)) { + echo "Tag Name: ".$node->tagName."\n"; +} $node->setAttribute('num', '1'); diff --git a/ext/dom/tests/domfragment.phpt b/ext/dom/tests/domfragment.phpt new file mode 100644 index 0000000000..391cb6b707 --- /dev/null +++ b/ext/dom/tests/domfragment.phpt @@ -0,0 +1,36 @@ +--TEST-- +DOMDocumentFragment Tests +--SKIPIF-- + +--FILE-- +loadXML(b''); +if(!$dom) { + echo "Error while parsing the document\n"; + exit; +} + +$node = $dom->documentElement; + +try { + $frag1 = new DOMDocumentFragment(); + $frag1->appendXML('1'); + $node->appendXML($frag1); +} catch (DOMException $e) { + print "Read Only!\n\n"; +} + +$frag2 = $dom->createDocumentFragment(); +$frag2->appendXML('2'); +$node->appendChild($frag2); + +print $dom->saveXML(); +?> +--EXPECT-- +Read Only! + + +2 diff --git a/ext/dom/tests/domimplementation.phpt b/ext/dom/tests/domimplementation.phpt new file mode 100644 index 0000000000..3ec69d677c --- /dev/null +++ b/ext/dom/tests/domimplementation.phpt @@ -0,0 +1,27 @@ +--TEST-- +DOMImplementation Tests +--SKIPIF-- + +--FILE-- +hasFeature("1.0", "Core")); + +$doctype = $domimp->createDocumentType("HTML", "-//W3C//DTD HTML 4.01//EN", "http://www.w3.org/TR/html4/strict.dtd"); + +$dom = $domimp->createDocument(NULL, "HTML", $doctype); + +$html = $dom->documentElement; + +$html->appendChild(new DOMElement("body", "hello world")); +$html->firstChild->appendChild(new DOMEntityReference("preformatted")); + +print $dom->saveXML(); +?> +--EXPECT-- +bool(false) + + +hello world&preformatted; diff --git a/ext/dom/tests/dompi.phpt b/ext/dom/tests/dompi.phpt new file mode 100644 index 0000000000..db26e346de --- /dev/null +++ b/ext/dom/tests/dompi.phpt @@ -0,0 +1,26 @@ +--TEST-- +DOMProcessingInstruction Tests +--SKIPIF-- + +--FILE-- +loadXML(b''); + +$pi = new DOMProcessingInstruction("mypi", "my instructions"); + +$dom->documentElement->appendChild($pi); + +print $pi->target."\n"; +print $pi->data."\n"; +$pi->data = "my new instructions"; + +print $dom->saveXML(); +?> +--EXPECT-- +mypi +my instructions + + diff --git a/ext/dom/text.c b/ext/dom/text.c index 28f58ac85b..a47fad0212 100644 --- a/ext/dom/text.c +++ b/ext/dom/text.c @@ -191,7 +191,7 @@ 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) +/* {{{ proto DOMText dom_text_replace_whole_text(string content) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Text3-replaceWholeText Since: DOM Level 3 */ diff --git a/ext/dom/userdatahandler.c b/ext/dom/userdatahandler.c index 245cf66333..1e91b54e67 100644 --- a/ext/dom/userdatahandler.c +++ b/ext/dom/userdatahandler.c @@ -43,7 +43,7 @@ zend_function_entry php_dom_userdatahandler_class_functions[] = { /* {{{ attribute protos, not implemented yet */ -/* {{{ proto dom_void dom_userdatahandler_handle(short operation, string key, domobject data, node src, node dst); +/* {{{ proto dom_void dom_userdatahandler_handle(short operation, string key, domobject data, node src, node dst) U URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-handleUserDataEvent Since: */ diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index d0885d1eb0..ebfde0d5e8 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -44,7 +44,7 @@ zend_function_entry php_dom_xpath_class_functions[] = { {NULL, NULL, NULL} }; -/* {{{ proto void DOMXPath::__construct(DOMDocument doc); */ +/* {{{ proto void DOMXPath::__construct(DOMDocument doc) U */ PHP_METHOD(domxpath, __construct) { zval *id, *doc; @@ -280,14 +280,14 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) { xmlXPathFreeObject(xpathobjp); } -/* {{{ proto DOMNodeList dom_xpath_query(string expr [,DOMNode context]); */ +/* {{{ proto DOMNodeList dom_xpath_query(string expr [,DOMNode context]) U */ PHP_FUNCTION(dom_xpath_query) { php_xpath_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_DOM_XPATH_QUERY); } /* }}} end dom_xpath_query */ -/* {{{ proto mixed dom_xpath_evaluate(string expr [,DOMNode context]); */ +/* {{{ proto mixed dom_xpath_evaluate(string expr [,DOMNode context]) U */ PHP_FUNCTION(dom_xpath_evaluate) { php_xpath_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_DOM_XPATH_EVALUATE);