]> granicus.if.org Git - php/commitdiff
nicer (optional) formated output in dump_mem and dump_mem_file
authorChristian Stocker <chregu@php.net>
Tue, 12 Mar 2002 08:24:50 +0000 (08:24 +0000)
committerChristian Stocker <chregu@php.net>
Tue, 12 Mar 2002 08:24:50 +0000 (08:24 +0000)
ext/domxml/php_domxml.c

index cc6e99f49d8cef821bbcd518be098d6ecb74c28c..2b797183f7953e78f3d6e0831b608efbb1746b95 100644 (file)
@@ -2826,7 +2826,10 @@ PHP_FUNCTION(domxml_dump_mem)
 
        DOMXML_PARAM_ONE(docp, id, le_domxmldocp,"|l",&format);
        if (format)
+       {
+               xmlKeepBlanksDefault(0);
                xmlDocDumpFormatMemory(docp, &mem, &size, format);
+       }
        else
                xmlDocDumpMemory(docp, &mem, &size);
 
@@ -2846,12 +2849,21 @@ PHP_FUNCTION(domxml_dump_mem_file)
        zval *id;
        xmlDoc *docp;
        int file_len, bytes;
+       int format = 0;
        int compressmode = 0;
        char *file;
-       DOMXML_PARAM_THREE(docp, id, le_domxmldocp, "s|l", &file, &file_len, &compressmode);
+       DOMXML_PARAM_FOUR(docp, id, le_domxmldocp, "s|ll", &file, &file_len, &compressmode,&format);
 
        xmlSetCompressMode (compressmode);
-       bytes = xmlSaveFile(file,docp);
+
+       if (format)
+       {
+               xmlKeepBlanksDefault(0);
+               bytes = xmlSaveFormatFile(file,docp,format);
+       }
+       else
+               bytes = xmlSaveFile(file,docp);
+
        if (bytes == -1)
        {
                RETURN_FALSE;