]> granicus.if.org Git - php/commitdiff
allow parser flags to be passed to xinclude()
authorRob Richards <rrichards@php.net>
Sun, 2 Jan 2005 12:22:36 +0000 (12:22 +0000)
committerRob Richards <rrichards@php.net>
Sun, 2 Jan 2005 12:22:36 +0000 (12:22 +0000)
ext/dom/document.c

index 6b3df1fc643d2ef0cf99b0d62abaab19f8dbb9fd..dbcd060d216bd9660dce52d6188ac3b472d5506d 100644 (file)
@@ -1743,23 +1743,27 @@ static void php_dom_remove_xinclude_nodes(xmlNodePtr cur TSRMLS_DC) {
        }
 }
 
-/* {{{ proto int dom_document_xinclude()
+/* {{{ proto int dom_document_xinclude([int options])
    Substitutues xincludes in a DomDocument */
 PHP_FUNCTION(dom_document_xinclude)
 {
        zval *id;
        xmlDoc *docp;
        xmlNodePtr root;
-       int err; 
+       int err, flags = 0
        dom_object *intern;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &id, dom_document_class_entry, &flags) == FAILURE) {
                return;
        }
 
        DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
 
+#if LIBXML_VERSION >= 20600
+       err = xmlXIncludeProcessFlags(docp, flags);
+#else
        err = xmlXIncludeProcess (docp);
+#endif
 
        /* XML_XINCLUDE_START and XML_XINCLUDE_END nodes need to be removed as these
        are added via xmlXIncludeProcess to mark beginning and ending of xincluded document