本文整理汇总了PHP中Zend_Wildfire_Plugin_FirePhp类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Wildfire_Plugin_FirePhp类的具体用法?PHP Zend_Wildfire_Plugin_FirePhp怎么用?PHP Zend_Wildfire_Plugin_FirePhp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Wildfire_Plugin_FirePhp类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toHTML
/**
* @return string
*/
public function toHTML()
{
\Zend_Wildfire_Plugin_FirePhp::send($this->_root, 'DEBUG', \Zend_Wildfire_Plugin_FirePhp::WARN);
$html = <<<HTML
<ul>
<li>201500000000
<ul>
<li>
<b>
<i>20150000001</i>
</b>
<ul>
<li>20150000002</li>
</ul>
</li>
<li>20150000003</li>
<li>20150000004
<ul>
<li>20150000005
<li>20150000006
<ul>
<li>20150000007</li>
</ul>
</li>
</li>
</ul>
</li>
<li>20150000008</li>
</ul>
</li>
</ul>
HTML;
return $html;
}
示例2: __construct
public function __construct()
{
$this->_message = new \Zend_Wildfire_Plugin_FirePhp_TableMessage('Doctrine Queries');
$this->_message->setBuffered(true);
$this->_message->setHeader(array('Time', 'Event', 'Parameters'));
$this->_message->setOption('includeLineNumbers', false);
\Zend_Wildfire_Plugin_FirePhp::getInstance()->send($this->_message, 'Doctrine Queries');
}
示例3: tearDown
public function tearDown()
{
if (extension_loaded('pdo_sqlite')) {
$this->_db->getConnection()->exec('DROP TABLE foo');
}
Zend_Wildfire_Channel_HttpHeaders::destroyInstance();
Zend_Wildfire_Plugin_FirePhp::destroyInstance();
}
示例4: tearDown
public function tearDown()
{
if (extension_loaded('pdo_sqlite') && class_exists('Doctrine_Core')) {
Doctrine_Manager::connection()->getDbh()->exec('DROP TABLE accounts');
}
// unregister doctrine namespace
Zend_Loader_Autoloader::getInstance()->unregisterNamespace('Doctrine_');
Zend_Wildfire_Channel_HttpHeaders::destroyInstance();
Zend_Wildfire_Plugin_FirePhp::destroyInstance();
}
示例5: testgroupedloggingAction
public function testgroupedloggingAction()
{
$logger = Zend_Registry::get('logger');
Zend_Wildfire_Plugin_FirePhp::group("Collapsed Group", array('Collapsed' => true));
$logger->log('Message in collapsed group', Zend_Log::DEBUG);
Zend_Wildfire_Plugin_FirePhp::groupEnd();
Zend_Wildfire_Plugin_FirePhp::group("Expanded Group", array('Collapsed' => false));
$logger->log('Message in expanded group', Zend_Log::DEBUG);
Zend_Wildfire_Plugin_FirePhp::groupEnd();
}
示例6: testgroupsAction
public function testgroupsAction()
{
Zend_Wildfire_Plugin_FirePhp::group('Group 1');
Zend_Wildfire_Plugin_FirePhp::send('Test Message 1');
Zend_Wildfire_Plugin_FirePhp::group('Group 2');
Zend_Wildfire_Plugin_FirePhp::send('Test Message 2', 'Label', Zend_Wildfire_Plugin_FirePhp::INFO);
Zend_Wildfire_Plugin_FirePhp::groupEnd();
Zend_Wildfire_Plugin_FirePhp::send('Test Message 3');
Zend_Wildfire_Plugin_FirePhp::groupEnd();
}
示例7: setEnabled
/**
*
* @param boolean $enable
*/
public function setEnabled($enable)
{
parent::setEnabled($enable);
if ($enable) {
$this->_message = new TableMessage($this->label);
$this->_message->setBuffered(true);
$this->_message->setHeader(array('Time', 'Event', 'Parameters', 'Results'));
$this->_message->setDestroy(true);
Zend_Wildfire_Plugin_FirePhp::getInstance()->send($this->_message);
}
}
示例8: __construct
/**
* Constructor
*/
public function __construct()
{
$conn = Doctrine_Manager::connection();
$conn->setListener($this->profiler = new Doctrine_Connection_Profiler());
// setup firebug
$this->message = new Zend_Wildfire_Plugin_FirePhp_TableMessage($this->label);
$this->message->setBuffered(true);
$this->message->setHeader(array('Time', 'Event', 'Parameters'));
$this->message->setDestroy(true);
$this->message->setOption('includeLineNumbers', false);
Zend_Wildfire_Plugin_FirePhp::getInstance()->send($this->message);
}
示例9: __construct
/**
* Constructor
*
* @param string $label OPTIONAL Label for the profiling info.
* @return void
*/
public function __construct($label = null)
{
$this->_label = $label;
if (!$this->_label) {
$this->_label = 'Imind_Profiler_Doctrine_Firebug';
}
if (!$this->_message) {
$this->_message = new Zend_Wildfire_Plugin_FirePhp_TableMessage($this->_label);
$this->_message->setBuffered(true);
$this->_message->setHeader(array('Name', 'Time', 'Event', 'Parameters'));
$this->_message->setDestroy(true);
Zend_Wildfire_Plugin_FirePhp::getInstance()->send($this->_message);
}
}
示例10: setEnabled
/**
* Enable or disable the profiler. If $enable is false, the profiler
* is disabled and will not log any queries sent to it.
*
* @param boolean $enable
* @return Zend_Db_Profiler Provides a fluent interface
*/
public function setEnabled($enable)
{
parent::setEnabled($enable);
if ($this->getEnabled()) {
if (!$this->_message) {
$this->_message = new Zend_Wildfire_Plugin_FirePhp_TableMessage($this->_label);
$this->_message->setBuffered(true);
$this->_message->setHeader(array('Time', 'Event', 'Parameters'));
$this->_message->setDestroy(true);
Zend_Wildfire_Plugin_FirePhp::getInstance()->send($this->_message);
}
} else {
if ($this->_message) {
$this->_message->setDestroy(true);
$this->_message = null;
}
}
return $this;
}
示例11: display
/**
* Display profiling results and flush output buffer
*
* @param Stat $stat
* @return void
*/
public function display(Stat $stat)
{
$firebugMessage = new \Zend_Wildfire_Plugin_FirePhp_TableMessage($this->_renderCaption());
$firebugMessage->setHeader(array_keys($this->_columns));
foreach ($this->_getTimerIds($stat) as $timerId) {
$row = array();
foreach ($this->_columns as $column) {
$row[] = $this->_renderColumnValue($stat->fetch($timerId, $column), $column);
}
$firebugMessage->addRow($row);
}
\Zend_Wildfire_Plugin_FirePhp::send($firebugMessage);
// setup the wildfire channel
$firebugChannel = \Zend_Wildfire_Channel_HttpHeaders::getInstance();
$firebugChannel->setRequest($this->getRequest());
$firebugChannel->setResponse($this->getResponse());
// flush the wildfire headers into the response object
$firebugChannel->flush();
// send the response headers
$firebugChannel->getResponse()->sendHeaders();
ob_end_flush();
}
示例12: display
/**
* Display profiling results and flush output buffer
*/
public function display()
{
$firebugMessage = new Zend_Wildfire_Plugin_FirePhp_TableMessage($this->_renderCaption());
$firebugMessage->setHeader(array_keys($this->_getColumns()));
foreach ($this->_getTimers() as $timerId) {
$row = array();
foreach ($this->_getColumns() as $columnId) {
$row[] = $this->_renderColumnValue($timerId, $columnId);
}
$firebugMessage->addRow($row);
}
Zend_Wildfire_Plugin_FirePhp::getInstance()->send($firebugMessage);
// setup the wildfire channel
$firebugChannel = Zend_Wildfire_Channel_HttpHeaders::getInstance();
$firebugChannel->setRequest($this->_request ? $this->_request : new Zend_Controller_Request_Http());
$firebugChannel->setResponse($this->_response ? $this->_response : new Zend_Controller_Response_Http());
// flush the wildfire headers into the response object
$firebugChannel->flush();
// send the response headers
$firebugChannel->getResponse()->sendHeaders();
ob_end_flush();
}
示例13: _check
public function _check($subject, $controller, $action)
{
$decisions = array();
$object = Zend_Registry::get('userid');
$user = new Evil_Object_Fixed('user', $object);
$role = $user->getValue('role');
$logger = Zend_Registry::get('logger');
Zend_Wildfire_Plugin_FirePhp::group('Access');
$conditions = array('controller', 'action', 'object', 'subject', 'role');
foreach (self::$_rules as $ruleName => $rule) {
$selected = true;
foreach ($conditions as $condition) {
if (isset($rule[$condition])) {
if (is_array($rule[$condition])) {
if (!in_array(${$condition}, $rule[$condition])) {
$selected = false;
break;
}
} elseif ($rule[$condition] != ${$condition}) {
$selected = false;
break;
}
}
}
if ($selected) {
$decisions[(int) $rule['weight']] = $rule['decision'];
$logger->log($ruleName . ' applicable!', Zend_Log::INFO);
}
}
if (count($decisions) > 0) {
$decision = $decisions[max(array_keys($decisions))];
$logger->info('Вердикт: ' . $decision);
} else {
throw new Exception('No rules applicable');
}
Zend_Wildfire_Plugin_FirePhp::groupEnd('Access');
return $decision;
}
示例14: dirname
<?php
require_once dirname(__FILE__) . '/.Start.php';
Zend_Wildfire_Plugin_FirePhp::send(array("Отладочный"), 'UTF-8 characters with json_encode()', Zend_Wildfire_Plugin_FirePhp::LOG);
Zend_Wildfire_Plugin_FirePhp::send("Отладочный", 'UTF-8 characters with json_encode()', Zend_Wildfire_Plugin_FirePhp::LOG);
Zend_Wildfire_Plugin_FirePhp::send(array('Test work. Проверка работы.'), 'UTF-8 characters with json_encode()', Zend_Wildfire_Plugin_FirePhp::LOG);
Zend_Wildfire_Plugin_FirePhp::send('Test work. Проверка работы.', 'UTF-8 characters with json_encode()', Zend_Wildfire_Plugin_FirePhp::LOG);
Zend_Json::$useBuiltinEncoderDecoder = true;
Zend_Wildfire_Plugin_FirePhp::send(array("Отладочный"), 'UTF-8 characters with Zend_Json_Encoder::encode()', Zend_Wildfire_Plugin_FirePhp::LOG);
Zend_Wildfire_Plugin_FirePhp::send("Отладочный", 'UTF-8 characters with Zend_Json_Encoder::encode()', Zend_Wildfire_Plugin_FirePhp::LOG);
Zend_Wildfire_Plugin_FirePhp::send(array('Test work. Проверка работы.'), 'UTF-8 characters with Zend_Json_Encoder::encode()', Zend_Wildfire_Plugin_FirePhp::LOG);
Zend_Wildfire_Plugin_FirePhp::send('Test work. Проверка работы.', 'UTF-8 characters with Zend_Json_Encoder::encode()', Zend_Wildfire_Plugin_FirePhp::LOG);
require_once dirname(__FILE__) . '/.End.php';
示例15: dirname
require_once dirname(__FILE__) . '/.Start.php';
Zend_Wildfire_Plugin_FirePhp::send('Hello World');
/* Defaults to FirePHP::LOG */
Zend_Wildfire_Plugin_FirePhp::send('Log message', '', Zend_Wildfire_Plugin_FirePhp::LOG);
Zend_Wildfire_Plugin_FirePhp::send('Info message', '', Zend_Wildfire_Plugin_FirePhp::INFO);
Zend_Wildfire_Plugin_FirePhp::send('Warn message', '', Zend_Wildfire_Plugin_FirePhp::WARN);
Zend_Wildfire_Plugin_FirePhp::send('Error message', '', Zend_Wildfire_Plugin_FirePhp::ERROR);
Zend_Wildfire_Plugin_FirePhp::send('Message with label', 'Label', Zend_Wildfire_Plugin_FirePhp::LOG);
Zend_Wildfire_Plugin_FirePhp::send(true, 'Label', Zend_Wildfire_Plugin_FirePhp::LOG);
Zend_Wildfire_Plugin_FirePhp::send(false, 'Label', Zend_Wildfire_Plugin_FirePhp::LOG);
Zend_Wildfire_Plugin_FirePhp::send(null, 'Label', Zend_Wildfire_Plugin_FirePhp::INFO);
Zend_Wildfire_Plugin_FirePhp::send(1, 'Label', Zend_Wildfire_Plugin_FirePhp::WARN);
Zend_Wildfire_Plugin_FirePhp::send(1.1, 'Label', Zend_Wildfire_Plugin_FirePhp::LOG);
Zend_Wildfire_Plugin_FirePhp::send(array('key1' => 'val1', 'key2' => array(array('v1', 'v2'), 'v3')), 'TestArray', Zend_Wildfire_Plugin_FirePhp::LOG);
function test($Arg1)
{
throw new Exception('Test Exception');
}
try {
test(array('Hello' => 'World'));
} catch (Exception $e) {
/* Log exception including stack trace & variables */
Zend_Wildfire_Plugin_FirePhp::send($e);
}
Zend_Wildfire_Plugin_FirePhp::send('Backtrace to here', '', Zend_Wildfire_Plugin_FirePhp::TRACE);
Zend_Wildfire_Plugin_FirePhp::send(array('2 SQL queries took 0.06 seconds', array(array('SQL Statement', 'Time', 'Result'), array('SELECT * FROM Foo', '0.02', array('row1', 'row2')), array('SELECT * FROM Bar', '0.04', array('row1', 'row2')))), '', Zend_Wildfire_Plugin_FirePhp::TABLE);
Zend_Wildfire_Plugin_FirePhp::send(array(array('SQL Statement', 'Time', 'Result'), array('SELECT * FROM Foo', '0.02', array('row1', 'row2')), array('SELECT * FROM Bar', '0.04', array('row1', 'row2'))), '2 SQL queries took 0.06 seconds (Second Table)', Zend_Wildfire_Plugin_FirePhp::TABLE);
Zend_Wildfire_Plugin_FirePhp::send(array("Отладочный"), 'UTF-8 characters', Zend_Wildfire_Plugin_FirePhp::LOG);
/* Will show only in "Server" tab for the request */
Zend_Wildfire_Plugin_FirePhp::send(apache_request_headers(), 'RequestHeaders', Zend_Wildfire_Plugin_FirePhp::DUMP);
require_once dirname(__FILE__) . '/.End.php';