Added optional SQL queries debug

This commit is contained in:
Marcin Kurczewski 2013-10-19 12:53:49 +02:00
parent 5d51297c16
commit 4b5c13519c
3 changed files with 12 additions and 4 deletions

View file

@ -8,6 +8,7 @@ filesPath=./files/
thumbsPath=./thumbs/
mediaPath=./public_html/media/
title=szurubooru
debugQueries=0
[browsing]
usersPerPage=8

View file

@ -115,7 +115,7 @@ body {
footer {
text-align: center;
margin-top: 1em;
margin: 1em 0;
padding-top: 0.5em;
border-top: 1px solid #eee;
font-size: small;
@ -306,3 +306,8 @@ button:hover {
display: block;
clear: both;
}
pre.debug {
text-align: left;
color: black;
}

View file

@ -98,9 +98,11 @@
<footer>
<div class="main-wrapper">
Load: <?php echo sprintf('%.05f', microtime(true) - trueStartTime()) ?>s
&nbsp;
Queries: <?php echo count(queryLogger()->getLogs()) ?>
<span>Load: <?php echo sprintf('%.05f', microtime(true) - trueStartTime()) ?>s</span>
<span>Queries: <?php echo count(queryLogger()->getLogs()) ?></span>
<?php if ($this->config->main->debugQueries): ?>
<pre class="debug"><?php echo join('<br>', array_map(function($x) { return preg_replace('/\s+/', ' ', $x); }, queryLogger()->getLogs())) ?></pre>
<?php endif ?>
</div>
</footer>
</body>