mirror of
https://github.com/dg/dibi.git
synced 2025-07-30 19:00:13 +02:00
examples: improved Tracy examples
This commit is contained in:
@@ -2,11 +2,7 @@
|
||||
|
||||
<h1>Tracy & SQL Exceptions | dibi</h1>
|
||||
|
||||
<p>Dibi can display and log exceptions via Tracy, part of Nette Framework.</p>
|
||||
|
||||
<ul>
|
||||
<li>Tracy Debugger: http://tracy.nette.org
|
||||
</ul>
|
||||
<p>Dibi can display and log exceptions via <a href="http://tracy.nette.org">Tracy</a>.</p>
|
||||
|
||||
<?php
|
||||
|
||||
@@ -15,10 +11,11 @@ if (@!include __DIR__ . '/../vendor/autoload.php') {
|
||||
}
|
||||
|
||||
|
||||
// enable Tracy
|
||||
Tracy\Debugger::enable();
|
||||
|
||||
|
||||
dibi::connect(array(
|
||||
$connection = dibi::connect(array(
|
||||
'driver' => 'sqlite3',
|
||||
'database' => 'data/sample.s3db',
|
||||
'profiler' => array(
|
||||
@@ -27,17 +24,9 @@ dibi::connect(array(
|
||||
));
|
||||
|
||||
|
||||
// throws error because SQL is bad
|
||||
dibi::query('SELECT * FROM customers WHERE customer_id < ?', 38);
|
||||
|
||||
|
||||
dibi::connect(array(
|
||||
'driver' => 'sqlite3',
|
||||
'database' => 'data/sample.s3db',
|
||||
'profiler' => array(
|
||||
'run' => TRUE,
|
||||
)
|
||||
));
|
||||
// add panel to debug bar
|
||||
$panel = new Dibi\Bridges\Tracy\Panel;
|
||||
$panel->register($connection);
|
||||
|
||||
|
||||
// throws error because SQL is bad
|
||||
|
Reference in New Issue
Block a user