本文整理汇总了PHP中Zend_Wildfire_Plugin_FirePhp::_recordMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Wildfire_Plugin_FirePhp::_recordMessage方法的具体用法?PHP Zend_Wildfire_Plugin_FirePhp::_recordMessage怎么用?PHP Zend_Wildfire_Plugin_FirePhp::_recordMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Wildfire_Plugin_FirePhp
的用法示例。
在下文中一共展示了Zend_Wildfire_Plugin_FirePhp::_recordMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send
/**
* Logs variables to the Firebug Console
* via HTTP response headers and the FirePHP Firefox Extension.
*
* @param mixed $var The variable to log.
* @param string $label OPTIONAL Label to prepend to the log event.
* @param string $style OPTIONAL Style of the log event.
* @return boolean Returns TRUE if the variable was added to the response headers or buffered.
* @throws Zend_Wildfire_Exception
*/
public static function send($var, $label = null, $style = null)
{
if (self::$_instance === null) {
self::getInstance();
}
if (!self::$_instance->_enabled) {
return false;
}
if ($var instanceof Zend_Wildfire_Plugin_FirePhp_Message) {
if ($var->getBuffered()) {
if (!in_array($var, self::$_instance->_messages)) {
self::$_instance->_messages[] = $var;
}
return true;
}
if ($var->getDestroy()) {
return false;
}
$style = $var->getStyle();
$label = $var->getLabel();
$var = $var->getMessage();
}
if (!self::$_instance->_channel->isReady()) {
return false;
}
if ($var instanceof Exception) {
$var = array('Class' => get_class($var), 'Message' => $var->getMessage(), 'File' => $var->getFile(), 'Line' => $var->getLine(), 'Type' => 'throw', 'Trace' => $var->getTrace());
$style = self::EXCEPTION;
} else {
if ($style == self::TRACE) {
$trace = debug_backtrace();
if (!$trace) {
return false;
}
for ($i = 0; $i < sizeof($trace); $i++) {
if (isset($trace[$i]['class']) && substr($trace[$i]['class'], 0, 8) != 'Zend_Log' && substr($trace[$i]['class'], 0, 13) != 'Zend_Wildfire') {
$i--;
break;
}
}
if ($i == sizeof($trace)) {
$i = 0;
}
$var = array('Class' => $trace[$i]['class'], 'Type' => $trace[$i]['type'], 'Function' => $trace[$i]['function'], 'Message' => isset($trace[$i]['args'][0]) ? $trace[$i]['args'][0] : '', 'File' => isset($trace[$i]['file']) ? $trace[$i]['file'] : '', 'Line' => isset($trace[$i]['line']) ? $trace[$i]['line'] : '', 'Args' => $trace[$i]['args'], 'Trace' => array_splice($trace, $i + 1));
} else {
if ($style === null) {
$style = self::LOG;
}
}
}
switch ($style) {
case self::LOG:
case self::INFO:
case self::WARN:
case self::ERROR:
case self::EXCEPTION:
case self::TRACE:
case self::TABLE:
case self::DUMP:
case self::GROUP_START:
case self::GROUP_END:
break;
default:
#require_once 'Zend/Wildfire/Exception.php';
throw new Zend_Wildfire_Exception('Log style "' . $style . '" not recognized!');
break;
}
if ($style == self::DUMP) {
return self::$_instance->_recordMessage(self::STRUCTURE_URI_DUMP, array('key' => $label, 'data' => $var));
} else {
$meta = array('Type' => $style);
if ($label != null) {
$meta['Label'] = $label;
}
return self::$_instance->_recordMessage(self::STRUCTURE_URI_FIREBUGCONSOLE, array('data' => $var, 'meta' => $meta));
}
}