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.
This commit is contained in:
Marcus Puchalla 2014-12-16 13:44:35 +01:00
parent 4a1bb162c0
commit 07c3deaeb5

View file

@ -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))