version 1.1, 2012/02/21 23:47:54
|
version 1.1.1.3, 2013/07/22 01:31:40
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| PHP Version 5 | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1997-2012 The PHP Group | | | Copyright (c) 1997-2013 The PHP Group | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 3.01 of the PHP license, | |
| 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 | |
| that is bundled with this package in the file LICENSE, and is | |
Line 429 int dom_node_parent_node_read(dom_object *obj, zval **
|
Line 429 int dom_node_parent_node_read(dom_object *obj, zval **
|
return SUCCESS; |
return SUCCESS; |
} |
} |
|
|
if (NULL == (*retval = php_dom_create_object(nodeparent, &ret, NULL, *retval, obj TSRMLS_CC))) { | if (NULL == (*retval = php_dom_create_object(nodeparent, &ret, *retval, obj TSRMLS_CC))) { |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); |
return FAILURE; |
return FAILURE; |
} |
} |
Line 498 int dom_node_first_child_read(dom_object *obj, zval **
|
Line 498 int dom_node_first_child_read(dom_object *obj, zval **
|
return SUCCESS; |
return SUCCESS; |
} |
} |
|
|
if (NULL == (*retval = php_dom_create_object(first, &ret, NULL, *retval, obj TSRMLS_CC))) { | if (NULL == (*retval = php_dom_create_object(first, &ret, *retval, obj TSRMLS_CC))) { |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); |
return FAILURE; |
return FAILURE; |
} |
} |
Line 535 int dom_node_last_child_read(dom_object *obj, zval **r
|
Line 535 int dom_node_last_child_read(dom_object *obj, zval **r
|
return SUCCESS; |
return SUCCESS; |
} |
} |
|
|
if (NULL == (*retval = php_dom_create_object(last, &ret, NULL, *retval, obj TSRMLS_CC))) { | if (NULL == (*retval = php_dom_create_object(last, &ret, *retval, obj TSRMLS_CC))) { |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); |
return FAILURE; |
return FAILURE; |
} |
} |
Line 569 int dom_node_previous_sibling_read(dom_object *obj, zv
|
Line 569 int dom_node_previous_sibling_read(dom_object *obj, zv
|
return SUCCESS; |
return SUCCESS; |
} |
} |
|
|
if (NULL == (*retval = php_dom_create_object(prevsib, &ret, NULL, *retval, obj TSRMLS_CC))) { | if (NULL == (*retval = php_dom_create_object(prevsib, &ret, *retval, obj TSRMLS_CC))) { |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); |
return FAILURE; |
return FAILURE; |
} |
} |
Line 602 int dom_node_next_sibling_read(dom_object *obj, zval *
|
Line 602 int dom_node_next_sibling_read(dom_object *obj, zval *
|
|
|
ALLOC_ZVAL(*retval); |
ALLOC_ZVAL(*retval); |
|
|
if (NULL == (*retval = php_dom_create_object(nextsib, &ret, NULL, *retval, obj TSRMLS_CC))) { | if (NULL == (*retval = php_dom_create_object(nextsib, &ret, *retval, obj TSRMLS_CC))) { |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); |
return FAILURE; |
return FAILURE; |
} |
} |
Line 674 int dom_node_owner_document_read(dom_object *obj, zval
|
Line 674 int dom_node_owner_document_read(dom_object *obj, zval
|
|
|
ALLOC_ZVAL(*retval); |
ALLOC_ZVAL(*retval); |
|
|
if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, NULL, *retval, obj TSRMLS_CC))) { | if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, *retval, obj TSRMLS_CC))) { |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); |
return FAILURE; |
return FAILURE; |
} |
} |
Line 1087 PHP_FUNCTION(dom_node_insert_before)
|
Line 1087 PHP_FUNCTION(dom_node_insert_before)
|
xmlUnlinkNode((xmlNodePtr) lastattr); |
xmlUnlinkNode((xmlNodePtr) lastattr); |
php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC); |
php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC); |
} else { |
} else { |
DOM_RET_OBJ_EX(child, &ret, intern); | DOM_RET_OBJ(child, &ret, intern); |
return; |
return; |
} |
} |
} |
} |
Line 1129 PHP_FUNCTION(dom_node_insert_before)
|
Line 1129 PHP_FUNCTION(dom_node_insert_before)
|
xmlUnlinkNode((xmlNodePtr) lastattr); |
xmlUnlinkNode((xmlNodePtr) lastattr); |
php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC); |
php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC); |
} else { |
} else { |
DOM_RET_OBJ_EX(child, &ret, intern); | DOM_RET_OBJ(child, &ret, intern); |
return; |
return; |
} |
} |
} |
} |
Line 1148 PHP_FUNCTION(dom_node_insert_before)
|
Line 1148 PHP_FUNCTION(dom_node_insert_before)
|
|
|
dom_reconcile_ns(parentp->doc, new_child); |
dom_reconcile_ns(parentp->doc, new_child); |
|
|
DOM_RET_OBJ_EX(new_child, &ret, intern); | DOM_RET_OBJ(new_child, &ret, intern); |
|
|
} |
} |
/* }}} end dom_node_insert_before */ |
/* }}} end dom_node_insert_before */ |
Line 1232 PHP_FUNCTION(dom_node_replace_child)
|
Line 1232 PHP_FUNCTION(dom_node_replace_child)
|
xmlReplaceNode(oldchild, newchild); |
xmlReplaceNode(oldchild, newchild); |
dom_reconcile_ns(nodep->doc, newchild); |
dom_reconcile_ns(nodep->doc, newchild); |
} |
} |
DOM_RET_OBJ_EX(oldchild, &ret, intern); | DOM_RET_OBJ(oldchild, &ret, intern); |
return; |
return; |
} else { |
} else { |
php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); |
php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); |
Line 1281 PHP_FUNCTION(dom_node_remove_child)
|
Line 1281 PHP_FUNCTION(dom_node_remove_child)
|
while (children) { |
while (children) { |
if (children == child) { |
if (children == child) { |
xmlUnlinkNode(child); |
xmlUnlinkNode(child); |
DOM_RET_OBJ_EX(child, &ret, intern); | DOM_RET_OBJ(child, &ret, intern); |
return; |
return; |
} |
} |
children = children->next; |
children = children->next; |
Line 1389 PHP_FUNCTION(dom_node_append_child)
|
Line 1389 PHP_FUNCTION(dom_node_append_child)
|
|
|
dom_reconcile_ns(nodep->doc, new_child); |
dom_reconcile_ns(nodep->doc, new_child); |
|
|
DOM_RET_OBJ_EX(new_child, &ret, intern); | DOM_RET_OBJ(new_child, &ret, intern); |
} |
} |
/* }}} end dom_node_append_child */ |
/* }}} end dom_node_append_child */ |
|
|
Line 1478 PHP_FUNCTION(dom_node_clone_node)
|
Line 1478 PHP_FUNCTION(dom_node_clone_node)
|
intern = NULL; |
intern = NULL; |
} |
} |
|
|
DOM_RET_OBJ_EX(node, &ret, intern); | DOM_RET_OBJ(node, &ret, intern); |
} |
} |
/* }}} end dom_node_clone_node */ |
/* }}} end dom_node_clone_node */ |
|
|
Line 1825 static void dom_canonicalization(INTERNAL_FUNCTION_PAR
|
Line 1825 static void dom_canonicalization(INTERNAL_FUNCTION_PAR
|
if (Z_TYPE_PP(tmpns) == IS_STRING) { |
if (Z_TYPE_PP(tmpns) == IS_STRING) { |
char *prefix; |
char *prefix; |
ulong idx; |
ulong idx; |
int prefix_key_len; | uint prefix_key_len; |
|
|
if (zend_hash_get_current_key_ex(Z_ARRVAL_PP(tmp), |
if (zend_hash_get_current_key_ex(Z_ARRVAL_PP(tmp), |
&prefix, &prefix_key_len, &idx, 0, NULL) == HASH_KEY_IS_STRING) { |
&prefix, &prefix_key_len, &idx, 0, NULL) == HASH_KEY_IS_STRING) { |
Line 1895 static void dom_canonicalization(INTERNAL_FUNCTION_PAR
|
Line 1895 static void dom_canonicalization(INTERNAL_FUNCTION_PAR
|
RETVAL_FALSE; |
RETVAL_FALSE; |
} else { |
} else { |
if (mode == 0) { |
if (mode == 0) { |
|
#ifdef LIBXML2_NEW_BUFFER |
|
ret = xmlOutputBufferGetSize(buf); |
|
#else |
ret = buf->buffer->use; |
ret = buf->buffer->use; |
|
#endif |
if (ret > 0) { |
if (ret > 0) { |
|
#ifdef LIBXML2_NEW_BUFFER |
|
RETVAL_STRINGL((char *) xmlOutputBufferGetContent(buf), ret, 1); |
|
#else |
RETVAL_STRINGL((char *) buf->buffer->content, ret, 1); |
RETVAL_STRINGL((char *) buf->buffer->content, ret, 1); |
|
#endif |
} else { |
} else { |
RETVAL_EMPTY_STRING(); |
RETVAL_EMPTY_STRING(); |
} |
} |