function krumo::dump
Dump information about a variable
@access public @static
Parameters
mixed $data,...:
19 calls to krumo::dump()
- krumo::backtrace in krumo/
class.krumo.php - Prints a debug backtrace
- krumo::classes in krumo/
class.krumo.php - Prints a list of all currently declared classes.
- krumo::conf in krumo/
class.krumo.php - Prints a list of all your configuration settings.
- krumo::cookie in krumo/
class.krumo.php - Prints a list of all the values from the <i>$_COOKIE</i> array.
- krumo::defines in krumo/
class.krumo.php - Prints a list of all currently declared constants.
File
-
krumo/
class.krumo.php, line 547
Class
- krumo
- Krumo API
Code
public static function dump($data) {
// disabled ?
//
if (!krumo::_debug()) {
return false;
}
// more arguments ?
//
if (func_num_args() > 1) {
$_ = func_get_args();
foreach ($_ as $d) {
krumo::dump($d);
}
return;
}
// the css ?
//
krumo::_css();
// find caller
// DEVEL: we added array_reverse() so the proper file+line number is found.
$_ = array_reverse(debug_backtrace());
while ($d = array_pop($_)) {
// DEVEL: changed if() condition below
if (strpos(@$d['file'], 'devel') === FALSE && strpos(@$d['file'], 'krumo') === FALSE && @$d['class'] != 'krumo') {
break;
}
}
// the content
// DEVEL: we add an ltr here.
?>
<div class="krumo-root" dir="ltr">
<ul class="krumo-node krumo-first">
<?php
echo krumo::_dump($data);
?>
<li class="krumo-footnote">
<div class="krumo-version" style="white-space:nowrap;">
<h6>Krumo version <?php
echo krumo::version();
?></h6> | <a
href="http://krumo.sourceforge.net"
target="_blank">http://krumo.sourceforge.net</a>
</div>
<?php
if (@$d['file']) {
?>
<span class="krumo-call" style="white-space:nowrap;">
Called from <code><?php
echo $d['file'];
?></code>,
line <code><?php
echo $d['line'];
?></code></span>
<?php
}
?>
</li>
</ul>
</div>
<?php
// flee the hive
//
$_recursion_marker = krumo::_marker();
if ($hive =& krumo::_hive($dummy)) {
foreach ($hive as $i => $bee) {
// skip closures set as properties
if (is_object($bee) && !$bee instanceof Closure) {
unset($hive[$i]->{$_recursion_marker});
// DEVEL: changed 'else' to 'elseif' below
}
elseif (is_array($bee)) {
unset($hive[$i][$_recursion_marker]);
}
}
}
// PHP 4.x.x array reference bug...
//
if (is_array($data) && version_compare(PHP_VERSION, "5", "<")) {
unset($GLOBALS[krumo::_marker()]);
}
}