$_SESSION, '$_GET' => $_GET, '$_POST' => $_POST); if(!is_array($data_a)) $data_a=array($dd_variable => $data); foreach($data_a as $dd_variable => $data) { if ($sort) { ksort($data); } ob_start(); var_dump($data); $c = ob_get_contents(); ob_end_clean(); $c = preg_replace("/\r\n|\r/", "\n", $c); $c = str_replace("]=>\n", '] = ', $c); $c = str_replace("\t", ' ', $c); $c = preg_replace('/= {2,}/', '= ', $c); $c = preg_replace("/\[\"(.*?)\"\] = /i", "[$1] = ", $c); $c = preg_replace('/ /', " ", $c); $c = preg_replace("/\"\"(.*?)\"/i", "\"$1\"", $c); $c = htmlspecialchars($c, ENT_NOQUOTES); // Expand numbers (ie. int(10) => int(2) 10, float(128.64) => float(6) 128.64 etc.) $c = preg_replace("/(int|float)\(([0-9\.]+)\)/ie", "'$1('.strlen('$2').') $2'", $c); // Syntax Highlighting of Strings. This seems cryptic, but it will also allow non-terminated strings to get parsed. $c = preg_replace("/(\[[\w ]+\] = string\([0-9]+\) )\"(.*?)/sim", "$1\"", $c); $c = preg_replace("/(\"\n{1,})( {0,}\})/sim", "$1$2", $c); $c = preg_replace("/(\"\n{1,})( {0,}\[)/sim", "$1$2", $c); $c = preg_replace("/(string\([0-9]+\) )\"(.*?)\"\n/sim", "$1\"$2\"\n", $c); $regex = array( // Numberrs 'numbers' => array('/(^|] = )(array|float|int|string|resource|object\(.*\)|\&object\(.*\))\(([0-9\.]+)\)/i', '$1$2($3)'), // Keywords 'null' => array('/(^|] = )(null)/i', '$1$2'), 'bool' => array('/(bool)\((true|false)\)/i', '$1($2)'), // Types 'types' => array('/(of type )\((.*)\)/i', '$1($2)'), // Objects 'object' => array('/(object|\&object)\(([\w]+)\)/i', '$1($2)'), // Function 'function' => array('/(^|] = )(array|string|int|float|bool|resource|object|\&object)\(/i', '$1$2('), ); foreach ($regex as $x) { $c = preg_replace($x[0], $x[1], $c); } $style = ' .dumpr { float: left; clear: both; margin: 4px 0px 4px 0px; background-color: #fbfbfb; z-index:99; color: #000000; font-size: 9pt; font-family: "Courier New",Courier,Monaco,monospace; padding-top: 4px; padding-bottom: 4px; padding-left: 9px; padding-right: 9px; background-color: #fcfcfc; border: 1px solid #c9c9c9; position:relative; text-align:left; } .dumpr pre { margin: 0px; padding: 0px; } .ddurl { position:absolute; } .ddurl a { font-family:arial; font-size:7pt; color: #474747; } .ddurl a:hover { color: #474747; font-size:8pt; background: #FFFF00; } .ddurl a:visited { color: #474747; } /* syntax highlighting */ .dumpr span.nolog {color: #FF0000;} .dumpr span.fileline {color: #505050;} .dumpr span.string {color: #c40000;} .dumpr span.number {color: #ff0000;} .dumpr span.keyword {color: #007200;} .dumpr span.function {color: #0000c4;} .dumpr span.object {color: #ac00ac;} .dumpr span.type {color: #0072c4;} '; $style = preg_replace("/ {2,}/", "", $style); $style = preg_replace("/\t|\r\n|\r|\n/", "", $style); $style = preg_replace("/\/\*.*?\*\//i", '', $style); $style = str_replace('}', '} ', $style); $style = str_replace(' {', '{', $style); $style = trim($style); $c = trim($c); $c = preg_replace("/\n<\/span>/", "\n", $c); $c = dd_wordwrap($c,100,"\n"); if($log==1 || $log==true) { $url_time = (isset($_SERVER[HTTPS])) ? 'https' : 'http'; $url_time .= "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]  -  ".date("d.m.y H:i:s").'
'; } $toggle_wordwrap = <<<\/SPAN>\\n/gi).test(a)) a=a.replace(/<\/SPAN>\\n/gi,""+""); else if((/<\/SPAN>\\r\\n/gi).test(a)) a=a.replace(/<\/SPAN>\\r\\n/gi,""+""); else a=a.replace(/<\/SPAN>/gi,""+"\\n"); this.parentNode.parentNode.parentNode.innerHTML=a; ENDE; $url='http://austroweb.at/software'; $dumpr_out= "\n\n"; $dumpr_out.= "\n"; $dumpr_out.= "
{$url_time}$file_dumprcall - line $line_dumprcall\n$dd_variable = $c\n
"; $dumpr_out.= "\n\n"; if($log==1 || $log==true) { if(file_exists($GLOBALS[DD][logfile])) { $cont_a = file($GLOBALS[DD][logfile]); $cont = implode('', $cont_a); $dumpr_out .= $cont; } $fileHandler = @fopen ($GLOBALS[DD][logfile], "w"); if($fileHandler == false) $log_error=1; else { fwrite ($fileHandler, $dumpr_out); fclose ($fileHandler); } } if($log == 0 || $log_error == 1) { if($log_error == 1) { if(!(isset($GLOBALS[DD][logfile]))) $err='$GLOBALS[DD][logfile] is not defined.'; else $err='$GLOBALS[DD][logfile] = \'' . $GLOBALS[DD][logfile] . '\' is not writeable.'; $dumpr_out=str_replace('
' , '
'.$err.'
', $dumpr_out); } echo $dumpr_out; } } } // dump constants matching $mask or all constants if $mask is null // @param string $mask[optional] mask to apply or dumpr everything if null // @param bool $sort[optional] sort defaults to true function ddrc($mask = null, $sort = true) { $arr = get_defined_constants(); $vars = array(); foreach ($arr as $key => $val) { if (!$mask || stristr($key, $mask)) { $vars[$key] = $val; } } dumpr($vars, $sort); } // dump global variables matching $mask or all global variables if $mask is null // @param string $mask[optional] mask to apply or dumpr everything if null // @param bool $sort[optional] sort defaults to true function ddrg($mask = null, $sort = true) { $arr = $GLOBALS; $vars = array(); foreach ($arr as $key => $val) { if (!$mask || stristr($key, $mask)) { $vars[$key] = $val; } } dumpr($vars, $sort); } // dump data matching $mask or complete array if $mask is null // @param string $mask[optional] mask to apply or dumpr everything if null // @param bool $sort[optional] sort defaults to true function ddrx($arr, $mask = null, $sort = true) { $vars = array(); foreach ($arr as $key => $val) { if (!$mask || stristr($key, $mask)) { $vars[$key] = $val; } } dumpr($vars, $sort); } ############################################# function dde($data='') { dd($data, 0); exit; } ############################################# function ddf($data='') { dd($data, 1); } ############################################# function dd_wordwrap($str,$cols,$cut) { $tag_open = '<'; $tag_close = '>'; $count = 0; $in_tag = 0; $str_len = strlen($str); $segment_width = 0; for ($i=1 ; $i<=$str_len ; $i++){ if ($str[$i] == $tag_open) { $in_tag++; } elseif ($str[$i] == $tag_close) { if ($in_tag > 0) { $in_tag--; } } else { if ($in_tag == 0) { $segment_width++; if ($str[$i] == "\n") { $segment_width = 0; $i++; } elseif (($segment_width > $cols) && ($str[$i] == " ")) { $str = substr($str,0,$i).$cut.substr($str,$i,$str_len); $i += strlen($cut); $str_len = strlen($str); $segment_width = 0; } } } } return $str; } ?>