Merge d85f1013bd
into 4a1bb162c0
This commit is contained in:
commit
334328ca3b
1 changed files with 10 additions and 8 deletions
18
dBug.php
18
dBug.php
|
@ -66,12 +66,14 @@ class dBug {
|
|||
var $arrHistory = array();
|
||||
|
||||
//constructor
|
||||
function dBug($var,$forceType="",$bCollapsed=false) {
|
||||
function __construct($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))
|
||||
|
@ -188,7 +190,7 @@ class dBug {
|
|||
$var_ser = serialize($var);
|
||||
array_push($this->arrHistory, $var_ser);
|
||||
|
||||
$this->makeTableHeader("array","array");
|
||||
$this->makeTableHeader("array","array (size: ".sizeof($var).")");
|
||||
if(is_array($var)) {
|
||||
foreach($var as $key=>$value) {
|
||||
$this->makeTDHeader("array",$key);
|
||||
|
@ -218,7 +220,7 @@ class dBug {
|
|||
function varIsObject($var) {
|
||||
$var_ser = serialize($var);
|
||||
array_push($this->arrHistory, $var_ser);
|
||||
$this->makeTableHeader("object","object");
|
||||
$this->makeTableHeader("object","object .(".get_class($var).")");
|
||||
|
||||
if(is_object($var)) {
|
||||
$arrObjVars=get_object_vars($var);
|
||||
|
@ -253,7 +255,7 @@ class dBug {
|
|||
|
||||
//if variable is a resource type
|
||||
function varIsResource($var) {
|
||||
$this->makeTableHeader("resourceC","resource",1);
|
||||
$this->makeTableHeader("resourceC","resource (".get_resource_type($var).")",1);
|
||||
echo "<tr>\n<td>\n";
|
||||
switch(get_resource_type($var)) {
|
||||
case "fbsql result":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue