Commit 631ca979 authored by Gábor Hojtsy's avatar Gábor Hojtsy

honour the timer setting, thus allowing an admin to only request the timer...

honour the timer setting, thus allowing an admin to only request the timer without the SQL log (this was not available before :)
parent 08aa077e
......@@ -30,25 +30,36 @@ function devel_exit() {
global $queries;
if (user_access('access devel information') && !strstr(request_uri(), 'feed')) { // try not to break the xml pages
$dev_block_start = "<div style=\"padding-top: 8em;\">";
$dev_block_end = "</div>";
// Query log off, timer on
if (!variable_get("dev_query", 0) && variable_get("dev_timer", 0)) {
print $dev_block_start . devel_timer() . $dev_block_end;
}
// Query log on
if (variable_get("dev_query", 0)) {
foreach ($queries as $query) {
$text[] = $query[0];
$sum += $query[1];
}
$counts = array_count_values($text);
print "<div style=\"padding-top: 8em;\">";
print $dev_block_start;
// don't t() this text. it has to work for a cached (aka bootstrap) page.
$txt = 'Executed '. count($queries). ' queries in '. round($sum * 1000, 2). ' microseconds. ';
if (function_exists('theme_table')) {
$txt .= 'Queries taking longer than '. variable_get("devel_execution", 5). ' ms, and queries executed more than once, are <span class="marker">highlighted</span>. '. devel_timer();
$txt .= 'Queries taking longer than '. variable_get("devel_execution", 5). ' ms, and queries executed more than once, are <span class="marker">highlighted</span>. ';
if (variable_get("dev_timer", 0)) { $txt .= devel_timer(); }
print theme("box", t("Query log"), $txt. devel_query_table($queries, $counts));
}
else {
print $txt;
dprint_r($queries);
}
print "</div>";
print $dev_block_end;
}
// lots of profile info. not sure how to use it yet.
if (extension_loaded('xdebug') && ini_get("xdebug.auto_profile")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment