Skip to content
This repository has been archived by the owner on Dec 16, 2018. It is now read-only.

Commit

Permalink
Added sintaks higlight code and update spark info
Browse files Browse the repository at this point in the history
  • Loading branch information
purwandi committed Jan 23, 2012
1 parent 7bba8b7 commit 2151706
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion libraries/Profiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ protected function _compile_queries()
$this->CI->load->helper('text');

// Key words we want bolded
$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', '(', ')');
// $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 ($dbs as $db)
{
Expand All @@ -182,6 +182,15 @@ protected function _compile_queries()
foreach ($db->queries as $key => $val)
{
$time = number_format($db->query_times[$key], 4);

$val = highlight_code($val, ENT_QUOTES);

/*
foreach ($highlight as $bold)
{
$val = str_replace($bold, '<strong>'.$bold.'</strong>', $val);
}
*/
$output[] = array($time, $val);
}
}
Expand Down
2 changes: 1 addition & 1 deletion spark.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: debug-toolbar

# This is the current version of this spark. All sparks should be in
# x.x.x format. Validation will fail otherwise.
version: 1.0.6
version: 1.0.7

# This is the version of CodeIgniter this spark is compatible up to. It should
# be in x.x.x format
Expand Down

0 comments on commit 2151706

Please sign in to comment.