本文整理汇总了PHP中debug::trace方法的典型用法代码示例。如果您正苦于以下问题:PHP debug::trace方法的具体用法?PHP debug::trace怎么用?PHP debug::trace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类debug
的用法示例。
在下文中一共展示了debug::trace方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: debugger
/**
* Get the HTML for the debugger, and add the CSS and JS to the response
*
* @param array $elts
* @return string
*/
public static function debugger(array $elts = null)
{
if (is_null($elts)) {
debug::timer('nyro');
debug::timer('nyroRender');
return debug::debugger(array('timing' => array('Timing', debug::timer(), 'time'), 'included' => array('Included Files', get_included_files(), array('name' => 'code_red', 'type' => 'script')), 'session' => array('Session vars', $_SESSION, 'shield'), 'db_queries' => array('DB Queries', db::log(), 'database'), 'consts' => array('Constants', array_reverse(get_defined_constants(true), true), array('name' => 'gear', 'type' => 'script')), 'request' => array('Request', request::get(), array('name' => 'right', 'type' => 'arrow')), 'cookies' => array('Cookies', $_COOKIE, array('name' => 'gray', 'type' => 'user')), 'get' => array('Get', $_GET, array('name' => 'show', 'type' => 'tag')), 'post' => array('Post', $_POST, array('name' => 'green', 'type' => 'tag')), 'files' => array('Files', $_FILES, array('name' => 'orange', 'type' => 'tag')), 'response' => array('Response', array('Headers' => response::getInstance()->getHeader(), 'Included Files' => response::getInstance()->getIncFiles()), array('name' => 'right', 'type' => 'arrow'))));
}
if (request::get('out') != 'html') {
return;
}
$menu = array();
$content = array();
$close = utils::getIcon(array('name' => 'cross', 'type' => 'default', 'attr' => array('class' => 'close', 'alt' => 'Close')));
foreach ($elts as $k => $v) {
$icon = array_key_exists(2, $v) ? utils::getIcon(is_array($v[2]) ? $v[2] : array('name' => 'show', 'type' => $v[2])) : null;
$menu[] = '<a rel="' . $k . '">' . $icon . $v[0] . '</a>';
$tmp = '<div class="debugElt" id="' . $k . '" style="display: none;">' . $close . '<h2>' . $icon . $v[0] . '</h2>';
if (is_array($v[1])) {
if (is_numeric(key($v[1])) && !is_array($v[1])) {
$tmp .= '<ol><li>' . implode('</li><li>', $v[1]) . '</li></ol>';
} else {
$tmp .= debug::trace($v[1]);
}
} else {
$tmp .= $v[1];
}
$tmp .= '</div>';
$content[] = $tmp;
}
$resp = response::getInstance();
return '<div id="nyroDebugger">' . $resp->getIncludeTagFile('js', 'debug') . $resp->getIncludeTagFile('css', 'debug') . '<ul><li id="close">' . $close . '</li><li>' . implode('</li><li>', $menu) . '</li></ul>' . implode("\n", $content) . '</div>';
}
示例2: handleError
/**
* Handle an error to be shown to the user
*
* @param Exception $err
* @return string The debug to be shown
*/
private static function handleError(Exception $err) {
return debug::trace($err, DEV? 2 : 0);
}
示例3: __toString
/**
* Create the data Table out regarding the request out
*
* @return string
*/
public function __toString()
{
try {
return $this->to(request::get('out'));
} catch (Exception $e) {
if (DEV) {
print_r($e);
exit;
debug::trace($e, 2);
} else {
throw $e;
}
}
}
示例4:
<?php
if ($form->hasErrors()) {
echo debug::trace($form->getErrors());
}
?>
<?php echo $form; ?><br />
<a href="<?php echo $indexPage; ?>"><?php tr::__('scaffold_back', 1) ?></a>