functions : Added varDump function and use it in LSdebug function
authorBenjamin Renard <brenard@easter-eggs.com>
Wed, 11 Nov 2009 19:53:49 +0000 (19:53 +0000)
committerBenjamin Renard <brenard@easter-eggs.com>
Wed, 11 Nov 2009 19:53:49 +0000 (19:53 +0000)
trunk/includes/functions.php

index 59e00e1..035cb35 100644 (file)
@@ -208,13 +208,18 @@ function return_data($data) {
   return $data;
 }
 
+function varDump($data) {
+  ob_start();
+  var_dump($data);
+  $data=ob_get_contents(); 
+  ob_end_clean();
+  return $data;
+}
+
 $GLOBALS['LSdebug_fields']=array();
 function LSdebug($data,$dump=false) {
   if ($dump) {
-    ob_start();
-    var_dump($data);
-    $GLOBALS['LSdebug_fields'][]=ob_get_contents(); 
-    ob_end_clean();
+    $GLOBALS['LSdebug_fields'][]=varDump($data);
   }
   else {
     if (is_array($data)||is_object($data)) {