本文整理汇总了PHP中Zend_Db_Profiler::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Db_Profiler::__construct方法的具体用法?PHP Zend_Db_Profiler::__construct怎么用?PHP Zend_Db_Profiler::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Db_Profiler
的用法示例。
在下文中一共展示了Zend_Db_Profiler::__construct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($enabled = false)
{
parent::__construct($enabled);
$this->_log = new Zend_Log();
$writer = new Zend_Log_Writer_Stream(APPLICATION_PATH . '/../data/log/db-queries.log');
$this->_log->addWriter($writer);
}
示例2: __construct
public function __construct($enabled = false)
{
parent::__construct($enabled);
$stream = @fopen(BASE_PATH . '/data/logs/db-queries.log', 'w', false);
if (!$stream) {
throw new App_Exception('Failed to open stream');
}
$writer = new Zend_Log_Writer_Stream($stream);
$this->_log = new Zend_Log($writer);
}
示例3: __construct
public function __construct($enable)
{
parent::__construct($enable);
$writer = new Kwf_Log_Writer_Stream(APP_PATH . '/querylog', 'w');
$writer->setFormatter(new Zend_Log_Formatter_Simple("%message%\n"));
$this->_logger = new Zend_Log($writer);
/*
foreach (new DirectoryIterator('/tmp') as $item) {
if (substr($item->getFilename(), 0, 9) == 'querylog.') {
$time = (int)(substr($item->getFilename(), 9, -2));
if (time()-$time > 15*60) {
@unlink($item->getPathname());
}
}
}
*/
}
示例4: Monkeys_Db_Profiler
public function Monkeys_Db_Profiler()
{
parent::__construct(true);
}