当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Log::table方法代码示例

本文整理汇总了PHP中Zend_Log::table方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Log::table方法的具体用法?PHP Zend_Log::table怎么用?PHP Zend_Log::table使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Log的用法示例。


在下文中一共展示了Zend_Log::table方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     $writer = new Zend_Log_Writer_Firebug();
     $logger = new Zend_Log($writer);
     $logger->addPriority('LOGD', 8);
     $writer->setPriorityStyle(8, 'LOG');
     $logger->addPriority('ERROR', 9);
     $writer->setPriorityStyle(9, 'ERROR');
     $logger->addPriority('TRACE', 10);
     $writer->setPriorityStyle(10, 'TRACE');
     $logger->addPriority('EXCEPTION', 11);
     $writer->setPriorityStyle(11, 'EXCEPTION');
     $logger->addPriority('TABLE', 12);
     $writer->setPriorityStyle(12, 'TABLE');
     $logger->logd($_SERVER);
     $logger->info($_SERVER);
     $logger->warn($_SERVER);
     $logger->error($_SERVER);
     $logger->trace($_SERVER);
     try {
         throw new Exception('Test Exception');
     } catch (Exception $e) {
         $logger->exception($e);
     }
     $logger->table(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')))));
 }
开发者ID:besters,项目名称:My-Base,代码行数:26,代码来源:IndexController.php

示例2: dirname

<?php

define('ZF_APPLICATION_DIRECTORY', dirname(dirname(dirname(__FILE__))));
define('ZF_LIBRARY_DIRECTORY', dirname(ZF_APPLICATION_DIRECTORY) . '/library');
set_include_path(ZF_LIBRARY_DIRECTORY);
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
$request = new Zend_Controller_Request_Http();
$response = new Zend_Controller_Response_Http();
$channel = Zend_Wildfire_Channel_HttpHeaders::getInstance();
$channel->setRequest($request);
$channel->setResponse($response);
$writer = new Zend_Log_Writer_Firebug();
$writer->setPriorityStyle(8, 'TABLE');
$logger = new Zend_Log($writer);
$logger->addPriority('TABLE', 8);
$db = Zend_Db::factory('PDO_SQLITE', array('dbname' => ':memory:'));
$profiler = new Zend_Db_Profiler_Firebug('Queries');
$profiler->setEnabled(true);
$db->setProfiler($profiler);
$db->getConnection()->exec('CREATE TABLE foo (
                              id      INTEGNER NOT NULL,
                              col1    VARCHAR(10) NOT NULL
                            )');
$table = array('sdfsdf', array(array('sdfsdf', 'sdfsdf'), array('sdwt32g2', '23g23g')));
$logger->table($table);
$channel->flush();
$channel->getResponse()->sendHeaders();
开发者ID:laiello,项目名称:firephp,代码行数:28,代码来源:Test1.php


注:本文中的Zend_Log::table方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。