本文整理汇总了PHP中ChromePhp::groupCollapsed方法的典型用法代码示例。如果您正苦于以下问题:PHP ChromePhp::groupCollapsed方法的具体用法?PHP ChromePhp::groupCollapsed怎么用?PHP ChromePhp::groupCollapsed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChromePhp
的用法示例。
在下文中一共展示了ChromePhp::groupCollapsed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: d
function d($arg)
{
$declared = 'variable';
ChromePhp::log('xdebug_get_declared_vars', xdebug_get_declared_vars());
ChromePhp::groupCollapsed('backtrace');
ChromePhp::log(debug_backtrace());
ChromePhp::groupEnd();
ChromePhp::info('Triggered notice.');
trigger_error('Custom notice', E_USER_NOTICE);
ChromePhp::warn('Triggered warning.');
trigger_error('Custom warning', E_USER_WARNING);
ChromePhp::error('Triggered error.');
trigger_error('Custom error', E_USER_ERROR);
}
示例2: chrome_debug
function chrome_debug($msg, $type = 'trace', $trace_level = 1)
{
if ('trace' == $type) {
ChromePhp::groupCollapsed($msg);
$traces = debug_backtrace(false);
$traces = array_reverse($traces);
$max = count($traces) - $trace_level;
for ($i = 0; $i < $max; $i++) {
$trace = $traces[$i];
$fun = isset($trace['class']) ? $trace['class'] . '::' . $trace['function'] : $trace['function'];
$file = isset($trace['file']) ? $trace['file'] : 'unknown file';
$line = isset($trace['line']) ? $trace['line'] : 'unknown line';
$trace_msg = '#' . $i . ' ' . $fun . ' called at [' . $file . ':' . $line . ']';
if (!empty($trace['args'])) {
ChromePhp::groupCollapsed($trace_msg);
ChromePhp::log($trace['args']);
ChromePhp::groupEnd();
} else {
ChromePhp::log($trace_msg);
}
}
ChromePhp::groupEnd();
} else {
if (method_exists('Behavior\\ChromePhp', $type)) {
//支持type trace,warn,log,error,group, groupCollapsed, groupEnd等
call_user_func(array('Behavior\\ChromePhp', $type), $msg);
} else {
//如果type不为trace,warn,log等,则为log的标签
call_user_func_array(array('Behavior\\ChromePhp', 'log'), func_get_args());
}
}
}
示例3: outputBrowser
static function outputBrowser($type, $data)
{
// Browser Extensions
if (CONSOLE_FIREPHP) {
try {
//if (!in_array($type, array("log", "info", "warn", "error"))) { $type = "log"; }
//FirePHP::{$type}($data);
switch ($type) {
case "log":
FirePHP::log($data);
break;
case "info":
FirePHP::info($data);
break;
case "warn":
FirePHP::warn($data);
break;
case "error":
FirePHP::error($data);
break;
default:
FirePHP::log($data);
break;
}
} catch (Exception $e) {
}
}
if (CONSOLE_CHROMELOGGER) {
try {
//if (!in_array($type, array("log", "info", "warn", "error", "group", , "groupCollapsed", "groupEnd"))) { $type = "log"; }
//ChromePhp::{$type}($data);
switch ($type) {
case "log":
ChromePhp::log($data);
break;
case "info":
ChromePhp::info($data);
break;
case "warn":
ChromePhp::warn($data);
break;
case "error":
ChromePhp::error($data);
break;
case "group":
ChromePhp::group($data);
break;
case "groupCollapsed":
ChromePhp::groupCollapsed($data);
break;
case "groupEnd":
ChromePhp::groupEnd($data);
break;
default:
ChromePhp::log($data);
break;
}
} catch (Exception $e) {
}
}
}