Skip to content

Commit d6f07ae

Browse files
authored
Merge pull request #129 from lambal/patch-2
修改Controller的showTrace方法
2 parents 6b2f8a2 + 1d33d46 commit d6f07ae

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

libs/Swoole/Controller.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,10 @@ public function showTrace($detail=false)
160160
{
161161
$_trace['SESSION_ID'] = session_id();
162162
}
163-
$_trace['读取数据库'] = $this->swoole->db->read_times . '';
164-
$_trace['写入数据库'] = $this->swoole->db->write_times . '';
163+
if($this->swoole->db instanceof \Swoole\Database) {
164+
$_trace['读取数据库'] = $this->swoole->db->read_times . '';
165+
$_trace['写入数据库'] = $this->swoole->db->write_times . '';
166+
}
165167
$_trace['加载文件数目'] = count($included_files);
166168
$_trace['PHP执行占用'] = $this->showTime();
167169
$_trace = array_merge($this->trace,$_trace);

0 commit comments

Comments
 (0)