From 3756e1a462b480b08485e9207dff06e64287df9e Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 29 Apr 2012 09:54:24 +0200 Subject: [PATCH] Improved pretty_dump --- frontend/cphp/include.misc.php | 6 ++++-- frontend/test.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/cphp/include.misc.php b/frontend/cphp/include.misc.php index 83e8d58..b43fe11 100644 --- a/frontend/cphp/include.misc.php +++ b/frontend/cphp/include.misc.php @@ -99,8 +99,10 @@ function pretty_dump($input) { ob_start(); var_dump($input); - $output = nl2br(ob_get_clean()); - return $output; + $output = ob_get_contents(); + ob_end_clean(); + $output = nl2br(str_replace(" ", "   ", $output)); + echo($output); } /*function is_empty($variable) diff --git a/frontend/test.php b/frontend/test.php index 7c178bf..c5d23ad 100644 --- a/frontend/test.php +++ b/frontend/test.php @@ -16,6 +16,6 @@ $settings['master_pubkey'] = "/etc/cvm/key.pub"; var_dump($sNode->sDiskFree, $sNode->sDiskUsed, $sNode->sRealHostname);*/ $sContainer = new Container(1); -var_dump($sContainer); +pretty_dump($sContainer); ?>