From 07c3deaeb5fced19f614ef46047c5de285033a97 Mon Sep 17 00:00:00 2001 From: Marcus Puchalla Date: Tue, 16 Dec 2014 13:44:35 +0100 Subject: [PATCH] Added 4th parameter to dBug constructor. With this optional parameter, that is false by default, you can trigger the init of the JS and CSS. This is needed if you want to use dBug multiple time to e.g. create multiple files (using ob_start etc. ). Until now it would only generate those sections on the first constructor call. --- dBug.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dBug.php b/dBug.php index 09107d2..6302e91 100755 --- a/dBug.php +++ b/dBug.php @@ -66,12 +66,14 @@ class dBug { var $arrHistory = array(); //constructor - function dBug($var,$forceType="",$bCollapsed=false) { + function dBug($var,$forceType="",$bCollapsed=false, $reinit = false) { //include js and css scripts - if(!defined('BDBUGINIT')) { - define("BDBUGINIT", TRUE); - $this->initJSandCSS(); - } + if(!defined('BDBUGINIT') || $reinit) { + if(!defined('BDBUGINIT')){ + define("BDBUGINIT", TRUE); + } + $this->initJSandCSS(); + } $arrAccept=array("array","object","xml"); //array of variable types that can be "forced" $this->bCollapsed = $bCollapsed; if(in_array($forceType,$arrAccept))