This repository has been archived on 2025-02-26. You can view files and clone it, but cannot push or open issues or pull requests.
szurubooru/src/Views/debug.phtml
Marcin Kurczewski 50e4b40721 Upgraded to newest chibi
- Separate non-static router class
- Moved some setup code to new method, Core::init
- Persistent database connection between tests
2014-05-23 23:34:50 +02:00

27 lines
821 B
PHTML

<?php
$this->assets->addStylesheet('debug.css');
?>
<div class="main-wrapper">
<?php foreach (Core::getDatabase()->getLogs() as $log): ?>
<div class="debug">
<?php
$query = $log->getStatement();
$query = str_replace('(', '<span>(', $query);
$query = str_replace(')', ')</span>', $query);
?>
<pre class="query"><?= $query ?></pre>
<pre class="bindings"><?= join(', ', array_map(function($key) use ($log)
{
return $key . '=<span class="value">' . $log->getBindings()[$key] . '</span>';
},
array_keys($log->getBindings()))) ?></pre>
<table>
<tr><td>Execution:</td><td><?= sprintf('%.05fs', $log->getExecutionTime()) ?></td></tr>
<tr><td>Retrieval:</td><td><?= sprintf('%.05fs', $log->getRetrievalTime()) ?></td></tr>
</table>
</div>
<?php endforeach ?>
</div>