diff options
Diffstat (limited to 'ext/dom/document.c')
-rw-r--r-- | ext/dom/document.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/ext/dom/document.c b/ext/dom/document.c index 2b66fccf80..5cb114d45c 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -82,6 +82,8 @@ const zend_function_entry php_dom_document_class_functions[] = { /* {{{ */ PHP_ME(domdocument, relaxNGValidateSource, arginfo_class_DOMDocument_relaxNGValidateSource, ZEND_ACC_PUBLIC) #endif PHP_ME(domdocument, registerNodeClass, arginfo_class_DOMDocument_registerNodeClass, ZEND_ACC_PUBLIC) + PHP_ME(domdocument, append, arginfo_class_DOMParentNode_append, ZEND_ACC_PUBLIC) + PHP_ME(domdocument, prepend, arginfo_class_DOMParentNode_prepend, ZEND_ACC_PUBLIC) PHP_FE_END }; /* }}} */ @@ -2128,4 +2130,48 @@ PHP_METHOD(domdocument, registerNodeClass) } /* }}} */ +/* {{{ proto void domdocument::append(string|DOMNode ...$nodes) +URL: https://dom.spec.whatwg.org/#dom-parentnode-append +Since: DOM Living Standard (DOM4) +*/ +PHP_METHOD(domdocument, append) +{ + int argc; + zval *args, *id; + dom_object *intern; + xmlNode *context; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) { + RETURN_THROWS(); + } + + id = ZEND_THIS; + DOM_GET_OBJ(context, id, xmlNodePtr, intern); + + dom_parent_node_append(intern, args, argc); +} +/* }}} */ + +/* {{{ proto void domdocument::prepend(string|DOMNode ...$nodes) +URL: https://dom.spec.whatwg.org/#dom-parentnode-prepend +Since: DOM Living Standard (DOM4) +*/ +PHP_METHOD(domdocument, prepend) +{ + int argc; + zval *args, *id; + dom_object *intern; + xmlNode *context; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) { + RETURN_THROWS(); + } + + id = ZEND_THIS; + DOM_GET_OBJ(context, id, xmlNodePtr, intern); + + dom_parent_node_prepend(intern, args, argc); +} +/* }}} */ + #endif /* HAVE_LIBXML && HAVE_DOM */ |