protected function _compile_queries() { $output = array(); $input = parent::_compile_queries(); if (!empty($input)) { $this->CI->load->helper('text'); $highlight = array('SELECT', 'DISTINCT', 'FROM', 'WHERE', 'AND', 'LEFT JOIN', 'ORDER BY', 'GROUP BY', 'LIMIT', 'INSERT', 'INTO', 'VALUES', 'UPDATE', 'OR ', 'HAVING', 'OFFSET', 'NOT IN', 'IN', 'LIKE', 'NOT LIKE', 'COUNT', 'MAX', 'MIN', 'ON', 'AS', 'AVG', 'SUM', '(', ')'); foreach ($input as $database => $info) { $database = $this->base_uri($database); $output[$database] = array('name' => array_shift($info), 'total' => $this->milliseconds(array_shift($info))); foreach ($info as $db) { $db['query'] = highlight_code($db['query']); foreach ($highlight as $bold) { $db['query'] = str_replace($bold, '<strong>' . $bold . '</strong>', $db['query']); } $output[$database][] = array('query' => $db['query'], 'time' => $this->milliseconds($db['time'])); } } } return $output; }