include trace of executed queries

This commit is contained in:
Sebastian Mendel
2008-05-08 06:07:00 +00:00
parent c53238a89e
commit 91007aa3d6
2 changed files with 30 additions and 0 deletions

View File

@@ -150,6 +150,21 @@ function PMA_DBI_try_query($query, $link = null, $options = 0)
$_SESSION['debug']['queries'][$hash]['query'] = $query; $_SESSION['debug']['queries'][$hash]['query'] = $query;
$_SESSION['debug']['queries'][$hash]['time'] = $time; $_SESSION['debug']['queries'][$hash]['time'] = $time;
} }
$trace = array();
foreach (debug_backtrace() as $trace_step) {
$trace[] = PMA_Error::relPath($trace_step['file']) . '#'
. $trace_step['line'] . ': '
. (isset($trace_step['class']) ? $trace_step['class'] : '')
. (isset($trace_step['object']) ? get_class($trace_step['object']) : '')
. (isset($trace_step['type']) ? $trace_step['type'] : '')
. (isset($trace_step['function']) ? $trace_step['function'] : '')
. '('
. (isset($trace_step['params']) ? implode(', ', $trace_step['params']) : '')
. ')'
;
}
$_SESSION['debug']['queries'][$hash]['trace'][] = $trace;
} }
return $r; return $r;

View File

@@ -172,6 +172,21 @@ function PMA_DBI_try_query($query, $link = null, $options = 0)
$_SESSION['debug']['queries'][$hash]['query'] = $query; $_SESSION['debug']['queries'][$hash]['query'] = $query;
$_SESSION['debug']['queries'][$hash]['time'] = $time; $_SESSION['debug']['queries'][$hash]['time'] = $time;
} }
$trace = array();
foreach (debug_backtrace() as $trace_step) {
$trace[] = PMA_Error::relPath($trace_step['file']) . '#'
. $trace_step['line'] . ': '
. (isset($trace_step['class']) ? $trace_step['class'] : '')
. (isset($trace_step['object']) ? get_class($trace_step['object']) : '')
. (isset($trace_step['type']) ? $trace_step['type'] : '')
. (isset($trace_step['function']) ? $trace_step['function'] : '')
. '('
. (isset($trace_step['params']) ? implode(', ', $trace_step['params']) : '')
. ')'
;
}
$_SESSION['debug']['queries'][$hash]['trace'][] = $trace;
} }
return $r; return $r;