2010-08-03 12:28:07 +02:00
|
|
|
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">
|
2010-04-01 05:24:13 +02:00
|
|
|
|
2013-12-19 04:37:53 +01:00
|
|
|
<h1>Tracy & SQL Exceptions | dibi</h1>
|
2008-10-28 02:06:55 +00:00
|
|
|
|
2015-10-05 16:14:16 +02:00
|
|
|
<p>Dibi can display and log exceptions via <a href="https://tracy.nette.org">Tracy</a>.</p>
|
2008-10-28 02:06:55 +00:00
|
|
|
|
2008-07-17 03:51:29 +00:00
|
|
|
<?php
|
|
|
|
|
2014-06-27 11:17:22 +02:00
|
|
|
if (@!include __DIR__ . '/../vendor/autoload.php') {
|
|
|
|
die('Install dependencies using `composer install --dev`');
|
|
|
|
}
|
2008-07-17 03:51:29 +00:00
|
|
|
|
2008-10-28 02:06:55 +00:00
|
|
|
|
2015-01-10 19:03:16 +01:00
|
|
|
// enable Tracy
|
2013-12-19 04:37:53 +01:00
|
|
|
Tracy\Debugger::enable();
|
2008-07-17 03:51:29 +00:00
|
|
|
|
|
|
|
|
2015-10-06 01:39:01 +02:00
|
|
|
$connection = dibi::connect([
|
2015-06-19 03:11:36 +02:00
|
|
|
'driver' => 'sqlite3',
|
2012-10-18 23:00:12 +02:00
|
|
|
'database' => 'data/sample.s3db',
|
2015-10-06 01:39:01 +02:00
|
|
|
'profiler' => [
|
2012-02-06 18:15:52 +01:00
|
|
|
'run' => TRUE,
|
2015-10-06 01:39:01 +02:00
|
|
|
],
|
|
|
|
]);
|
2012-02-06 18:15:52 +01:00
|
|
|
|
|
|
|
|
2015-01-10 19:03:16 +01:00
|
|
|
// add panel to debug bar
|
|
|
|
$panel = new Dibi\Bridges\Tracy\Panel;
|
|
|
|
$panel->register($connection);
|
2008-07-17 03:51:29 +00:00
|
|
|
|
|
|
|
|
2010-08-03 11:48:51 +02:00
|
|
|
// throws error because SQL is bad
|
2012-01-03 05:14:44 +01:00
|
|
|
dibi::query('SELECT FROM customers WHERE customer_id < ?', 38);
|