示例#1
0
    /**
     * @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;
    }
 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();
 }
示例#3
0
 /**
  * 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();
 }
示例#4
0
 /**
  * @group ZF-4934
  */
 public function testAdvancedLogging()
 {
     Zend_Wildfire_Plugin_FirePhp::getInstance()->setOption('maxTraceDepth', 0);
     $message = 'This is a log message!';
     $label = 'Test Label';
     $table = array('Summary line for the table', array(array('Column 1', 'Column 2'), array('Row 1 c 1', ' Row 1 c 2'), array('Row 2 c 1', ' Row 2 c 2')));
     $this->_logger->addPriority('TRACE', 8);
     $this->_logger->addPriority('TABLE', 9);
     $this->_writer->setPriorityStyle(8, 'TRACE');
     $this->_writer->setPriorityStyle(9, 'TABLE');
     $this->_logger->trace($message);
     $this->_logger->table($table);
     try {
         throw new Exception('Test Exception');
     } catch (Exception $e) {
         $this->_logger->err($e);
     }
     try {
         Zend_Wildfire_Plugin_FirePhp::send($message, $label, 'UNKNOWN');
         $this->fail('Should not be able to log with undefined log style');
     } catch (Exception $e) {
         // success
     }
     $channel = Zend_Wildfire_Channel_HttpHeaders::getInstance();
     $protocol = $channel->getProtocol(Zend_Wildfire_Plugin_FirePhp::PROTOCOL_URI);
     $messages = array(Zend_Wildfire_Plugin_FirePhp::STRUCTURE_URI_FIREBUGCONSOLE => array(Zend_Wildfire_Plugin_FirePhp::PLUGIN_URI => array(1 => '[{"Type":"TABLE"},["Summary line for the table",[["Column 1","Column 2"],["Row 1 c 1"," Row 1 c 2"],["Row 2 c 1"," Row 2 c 2"]]]]')));
     $qued_messages = $protocol->getMessages();
     unset($qued_messages[Zend_Wildfire_Plugin_FirePhp::STRUCTURE_URI_FIREBUGCONSOLE][Zend_Wildfire_Plugin_FirePhp::PLUGIN_URI][0]);
     unset($qued_messages[Zend_Wildfire_Plugin_FirePhp::STRUCTURE_URI_FIREBUGCONSOLE][Zend_Wildfire_Plugin_FirePhp::PLUGIN_URI][2]);
     $this->assertEquals(serialize($qued_messages), serialize($messages));
 }
示例#5
0
文件: UTF8.php 项目: laiello/firephp
<?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';
示例#6
0
function test($table)
{
    Zend_Wildfire_Plugin_FirePhp::send($table, 'Test deep table', Zend_Wildfire_Plugin_FirePhp::TABLE);
    throw new Exception('Test Exception');
}
示例#7
0
 public function testChannelFlush()
 {
     $this->_setupWithoutFrontController(false);
     $channel = Zend_Wildfire_Channel_HttpHeaders::getInstance();
     $this->assertFalse($channel->flush(), 'Nothing to flush - No messages');
     Zend_Wildfire_Plugin_FirePhp::send('Hello World');
     $this->assertTrue($channel->flush(), 'One message to flush');
     $this->_request->setUserAgentExtensionEnabled(false);
     $this->assertFalse($channel->flush(), 'Nothing to flush - Extension not in UserAgent');
 }
示例#8
0
<?php

require_once dirname(__FILE__) . '/.Start.php';
Zend_Wildfire_Plugin_FirePhp::group('Group 1');
Zend_Wildfire_Plugin_FirePhp::send('Log message 1', '', Zend_Wildfire_Plugin_FirePhp::LOG);
Zend_Wildfire_Plugin_FirePhp::group('Group 2');
Zend_Wildfire_Plugin_FirePhp::send('Log message 2', '', Zend_Wildfire_Plugin_FirePhp::INFO);
Zend_Wildfire_Plugin_FirePhp::send('Backtrace to here', '', Zend_Wildfire_Plugin_FirePhp::TRACE);
Zend_Wildfire_Plugin_FirePhp::groupEnd();
Zend_Wildfire_Plugin_FirePhp::send('Log message 3', 'Label', Zend_Wildfire_Plugin_FirePhp::WARN);
Zend_Wildfire_Plugin_FirePhp::groupEnd();
require_once dirname(__FILE__) . '/.End.php';
示例#9
0
<?php

require_once dirname(__FILE__) . '/.Start.php';
$firephp = Zend_Wildfire_Plugin_FirePhp::getInstance();
Zend_Wildfire_Plugin_FirePhp::send('Hello World', 'Label', Zend_Wildfire_Plugin_FirePhp::LOG);
Zend_Wildfire_Plugin_FirePhp::send('', 'Trace to here', Zend_Wildfire_Plugin_FirePhp::TRACE);
try {
    test();
} catch (Exception $e) {
    Zend_Wildfire_Plugin_FirePhp::send($e);
}
function test()
{
    throw new Exception('Test Exception');
}
$logger = Zend_Registry::get('logger');
$logger->info('Test info message');
$logger->addPriority('TRACE', 8);
$writer->setPriorityStyle(8, 'TRACE');
$logger->trace('Trace to here');
$profiler = new Zend_Db_Profiler_Firebug('All DB Queries');
$profiler->setEnabled(true);
$db = Zend_Db::factory('PDO_SQLITE', array('dbname' => ':memory:'));
$db->setProfiler($profiler);
$db->getConnection()->exec('CREATE TABLE foo (
                              id      INTEGNER NOT NULL,
                              col1    VARCHAR(10) NOT NULL  
                            )');
$db->insert('foo', array('id' => 1, 'col1' => 'original'));
require_once dirname(__FILE__) . '/.End.php';
示例#10
0
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';
示例#11
0
    static $publicStaticVar = 'Public static Var';
    protected $protectedVar = 'Protected Var';
    protected static $protectedStaticVar = 'Protected static Var';
    private $privateVar = 'PrivateVar';
    private static $privateStaticVar = 'Private static Var';
    public $publicVar2 = 'Public var 2';
    public static $publicStaticVar2 = 'Public static var 2';
    private $lotsOfData = "jhsdfjkhsdfjh sdkjhfasjkdhf sakjdhfg skaj dfhsa dfk jhsdfgkjsa dfksadf sadf sadfh\n jksdjhfg sadjkhfsahjdfghja sdfkj sajdfhkgsadfhj sfd jahksdfhjas dfjkahsdfhjasg dfkas df jhasdf ajkshdfgjhkadfs";
}
class TestObject2
{
    var $publicVar = 'Public Var';
    private $privateVar = 'PrivateVar';
}
class TestObject3
{
}
$obj = new TestObject();
$obj2 = new TestObject2();
$obj3 = new TestObject3();
$obj->child = $obj2;
$obj->child2 = $obj3;
$obj->child3 = $obj;
$obj = array('hello' => 'world', 'obj' => $obj, 'last' => 30, array('foo' => 'bar'), array('first', 'second'));
Zend_Wildfire_Plugin_FirePhp::send($obj, 'Test Object', Zend_Wildfire_Plugin_FirePhp::INFO);
$obj1 = new stdClass();
$obj2 = new stdClass();
$obj1->p = $obj2;
$obj2->p = $obj1;
Zend_Wildfire_Plugin_FirePhp::send($obj1, '$obj1', Zend_Wildfire_Plugin_FirePhp::INFO);
require_once dirname(__FILE__) . '/.End.php';
示例#12
0
 /**
  *
  * @return integer
  */
 private function _checkDigitalEletronica()
 {
     $tipoDigital = $this->_getParam('tipoDigital');
     $params = array();
     $params['nuAno'] = date('Y');
     $params['sqTipoEtiqueta'] = (int) $tipoDigital;
     $params['sqUnidadeOrg'] = \Core_Integration_Sica_User::getUserUnit();
     $dtoSearch = Core_Dto::factoryFromData($params, 'search');
     Zend_Wildfire_Plugin_FirePhp::send($dtoSearch, 'dtoSearch');
     if (!$this->getService()->verificaLiberacaoDigitalEletronica($dtoSearch)) {
         return 1;
     }
     return 0;
 }