From 80f7ad1494016fb5f296afc2dc2642fc16fc84cf Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 28 May 2013 21:46:46 +0200 Subject: [PATCH] add option maxsize --- utils/xmldump.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/utils/xmldump.php b/utils/xmldump.php index 042efef02..faf0e46d7 100644 --- a/utils/xmldump.php +++ b/utils/xmldump.php @@ -13,6 +13,7 @@ function usage() { /* {{{ */ echo " -v, --version: print version and exit.\n"; echo " --config: set alternative config file.\n"; echo " --folder: set start folder.\n"; + echo " --maxsize: maximum size of files to be include in output.\n"; } /* }}} */ function wrapWithCData($text) { /* {{{ */ @@ -24,7 +25,7 @@ function wrapWithCData($text) { /* {{{ */ $version = "0.0.1"; $shortoptions = "hv"; -$longoptions = array('help', 'version', 'config:', 'folder:'); +$longoptions = array('help', 'version', 'config:', 'folder:', 'maxsize:'); if(false === ($options = getopt($shortoptions, $longoptions))) { usage(); exit(0); @@ -52,6 +53,13 @@ if(isset($options['config'])) { if(isset($settings->_extraPath)) ini_set('include_path', $settings->_extraPath. PATH_SEPARATOR .ini_get('include_path')); +/* Set alternative config file */ +if(isset($options['maxsize'])) { + $maxsize = intval($maxsize); +} else { + $maxsize = 100000; +} + require_once("SeedDMS/Core.php"); if(isset($options['folder'])) { @@ -250,6 +258,11 @@ function tree($folder, $parent=null, $indent='') { /* {{{ */ echo $indent." ".$owner->getId()."\n"; echo $indent." ".wrapWithCData($file->getComment())."\n"; echo $indent." ".wrapWithCData($file->getOriginalFileName())."\n"; + echo $indent." contentDir . $file->getPath())."\">\n"; + if(filesize($dms->contentDir . $file->getPath()) < 1000000) { + echo chunk_split(base64_encode(file_get_contents($dms->contentDir . $file->getPath())), 76, "\n"); + } + echo $indent." \n"; echo $indent." \n"; } echo $indent." \n"; @@ -404,7 +417,7 @@ if($attrdefs) { } echo "\">\n"; echo " ".$attrdef->getName()."\n"; - echo " ".$attrdef->hasMultipleValues()."\n"; + echo " ".$attrdef->getMultipleValues()."\n"; echo " ".$attrdef->getValueSet()."\n"; echo " ".$attrdef->getType()."\n"; echo " ".$attrdef->getMinValues()."\n";