]> granicus.if.org Git - php/commitdiff
@ added formatting option to domxml_dump_mem() (chregu)
authorChristian Stocker <chregu@php.net>
Fri, 8 Mar 2002 09:18:31 +0000 (09:18 +0000)
committerChristian Stocker <chregu@php.net>
Fri, 8 Mar 2002 09:18:31 +0000 (09:18 +0000)
ext/domxml/php_domxml.c

index 2774755ec3998e7517852a5e313e565f9c255562..f8fb980d042999a4c5eba1c0f8a73dec93d68cd7 100644 (file)
@@ -2614,17 +2614,22 @@ PHP_FUNCTION(domxml_intdtd)
 }
 /* }}} */
 
-/* {{{ proto string domxml_dump_mem([object doc_handle])
-   Dumps document into string */
+/* {{{ proto string domxml_dump_mem([object doc_handle[,int format] ])
+   Dumps document into string and optionally formats it */
 PHP_FUNCTION(domxml_dump_mem)
 {
        zval *id;
        xmlDoc *docp;
        xmlChar *mem;
+       int format = 0;
        int size;
 
-       DOMXML_PARAM_NONE(docp, id, le_domxmldocp);
-       xmlDocDumpMemory(docp, &mem, &size);
+       DOMXML_PARAM_ONE(docp, id, le_domxmldocp,"|l",&format);
+       if (format)
+               xmlDocDumpFormatMemory(docp, &mem, &size, format);
+       else
+               xmlDocDumpMemory(docp, &mem, &size);
+
        if (!size) {
                RETURN_FALSE;
        }