Commit 08aa077e authored by moshe weitzman's avatar moshe weitzman

bug fix which prevented query log from outputting.

query log and execution time now requires a permission to be seen. if you are upgrading assign the 'access devel information' permission as desired

note also that a new release was recently made at www.xdebug.org
parent 8a6faf5a
......@@ -29,18 +29,17 @@ function devel_timer() {
function devel_exit() {
global $queries;
if (!headers_sent()) { // don't output anything if we haven't already. prevents busting of XML pages
if (user_access('access devel information') && !strstr(request_uri(), 'feed')) { // try not to break the xml pages
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;\">";
$text[] = $query[0];
$sum += $query[1];
}
$counts = array_count_values($text);
print "<div style=\"padding-top: 8em;\">";
// 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. ';
// 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();
print theme("box", t("Query log"), $txt. devel_query_table($queries, $counts));
......@@ -53,7 +52,8 @@ function devel_exit() {
}
// lots of profile info. not sure how to use it yet.
if (extension_loaded('xdebug') && ini_get("xdebug.auto_profile")) {
xdebug_dump_function_profile(3);
// comented out because generates too much output. output to log file instead. see xdebug docs
// dprint_r(xdebug_get_function_profile());;
};
}
}
......@@ -115,4 +115,8 @@ function devel_settings() {
return $output;
}
function devel_perm() {
return array('access devel information');
}
?>
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