本文整理汇总了PHP中Dumper::_vars方法的典型用法代码示例。如果您正苦于以下问题:PHP Dumper::_vars方法的具体用法?PHP Dumper::_vars怎么用?PHP Dumper::_vars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dumper
的用法示例。
在下文中一共展示了Dumper::_vars方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _object
/**
* Render a dump for an object
*
* @param mixed $data
* @param string $name
* @access private
* @static
*/
private static function _object(&$data, $name)
{
$reflection = new ReflectionObject($data);
$childCount = count($reflection->getProperties());
$collapsed = Dumper::_isCollapsed(self::$_level, $childCount);
$class = get_class($data);
$dont_traverse = Dumper::_config('dont_traverse', 'objects', array());
// Traverse deeper if we're on level 0, or otherwise if the current class
// is not in the dont_traverse config setting
$traverse_this = self::$_level == 0 || !in_array($class, $dont_traverse);
// Setup the CSS classes depending on how many children there are
if ($childCount > 0 && $collapsed) {
$elementClasses = ' dumper-expand';
} elseif ($childCount > 0 && $traverse_this) {
$elementClasses = ' dumper-expand dumper-opened';
} else {
$elementClasses = '';
}
$output = sprintf('<li class="dumper-child"> <div class="dumper-element%s"', $elementClasses);
if (count($data) > 0) {
$output .= 'onClick="dumper.toggle(this);"';
}
$output .= 'onMouseOver="dumper.over(this);" onMouseOut="dumper.out(this);">';
$addendum = '';
if ($childCount == 0) {
$addendum = ' (empty)';
} else {
if (!$traverse_this) {
$addendum = ' (skipped)';
}
}
$output .= sprintf('<a class="dumper-name"></a> <em class="dumper-type">obj</em> ', $name);
$output .= sprintf('%s <strong class="dumper-class">%s</strong>%s</div>', Dumper::get_separator(), $class, $addendum);
echo $output;
if ($childCount && $traverse_this) {
Dumper::_vars($data);
}
echo '</li>';
}