From 70a5dc7e363bc879aaac6e293866445598d2249f Mon Sep 17 00:00:00 2001 From: bnu Date: Fri, 10 Jan 2014 03:54:46 +0900 Subject: [PATCH] =?UTF-8?q?#278=2025ca3e1=20=EC=97=90=EC=84=9C=20query=20?= =?UTF-8?q?=ED=98=B8=EC=B6=9C=20=EC=8B=9C=EC=A0=90=EC=9D=84=20=EC=9E=98?= =?UTF-8?q?=EB=AA=BB=20=EC=9E=A1=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/db/DB.class.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/classes/db/DB.class.php b/classes/db/DB.class.php index e09457d1f..f23320576 100644 --- a/classes/db/DB.class.php +++ b/classes/db/DB.class.php @@ -436,8 +436,6 @@ class DB $elapsed_time = $this->act_finish - $this->act_start; $this->elapsed_time = $elapsed_time; $GLOBALS['__db_elapsed_time__'] += $elapsed_time; - $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - $bt = $bt[6]; $site_module_info = Context::get('site_module_info'); $log = array(); @@ -448,8 +446,20 @@ class DB $log['module'] = $site_module_info->module; $log['act'] = Context::get('act'); $log['time'] = date('Y-m-d H:i:s'); - $log['called_file'] = $bt['file'].':'.$bt['line']; - $log['called_method'] = $bt['class'].$bt['type'].$bt['function']; + + $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + foreach($bt as $no => $call) + { + if($call['function'] == 'executeQuery' || $call['function'] == 'executeQueryArray') + { + $call_no = $no; + $call_no++; + $log['called_file'] = $bt[$call_no]['file'].':'.$bt[$call_no]['line']; + $call_no++; + $log['called_method'] = $bt[$call_no]['class'].$bt[$call_no]['type'].$bt[$call_no]['function']; + break; + } + } // leave error log if an error occured (if __DEBUG_DB_OUTPUT__ is defined) if($this->isError())