/** * Stores query data into session data for debugging purposes * * @param string $query Query text * @param object $link database link * @param object|boolean $result Query result * @param integer $time Time to execute query * * @return void */ private function _dbgQuery($query, $link, $result, $time) { $hash = md5($query); if (isset($_SESSION['debug']['queries'][$hash])) { $_SESSION['debug']['queries'][$hash]['count']++; } else { $_SESSION['debug']['queries'][$hash] = array(); $error_message = $this->getError($link); if ($result == false && is_string($error_message)) { $_SESSION['debug']['queries'][$hash]['error'] = '<b style="color:red">' . htmlspecialchars($error_message) . '</b>'; } $_SESSION['debug']['queries'][$hash]['count'] = 1; $_SESSION['debug']['queries'][$hash]['query'] = htmlspecialchars($query); $_SESSION['debug']['queries'][$hash]['time'] = $time; } $_SESSION['debug']['queries'][$hash]['trace'][] = PMA_Error::formatBacktrace(debug_backtrace(), " ", "\n"); }
/** * Get HTML backtrace * * @return string */ public function getBacktraceDisplay() { return PMA_Error::formatBacktrace($this->getBacktrace(), "<br />\n", "<br />\n"); }