From: Christian Stocker Date: Tue, 12 Mar 2002 08:24:50 +0000 (+0000) Subject: nicer (optional) formated output in dump_mem and dump_mem_file X-Git-Tag: help~58 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=668ade05c6353eccc69ae07dbafa423f3c167a82;p=php nicer (optional) formated output in dump_mem and dump_mem_file --- diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index cc6e99f49d..2b797183f7 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -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;