1
0
mirror of https://github.com/dg/dibi.git synced 2025-07-31 19:30:30 +02:00

tests: Nette\Debugger replaced with Tracy, examples requires PHP 5.3

This commit is contained in:
David Grudl
2013-12-19 04:37:53 +01:00
parent abd3e2116c
commit f31d4a9afa
25 changed files with 86 additions and 931 deletions

View File

@@ -0,0 +1,43 @@
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">
<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>
<?php
require __DIR__ . '/Tracy/tracy.phar';
require __DIR__ . '/../dibi/dibi.php';
Tracy\Debugger::enable();
dibi::connect(array(
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
'profiler' => array(
'run' => TRUE,
)
));
// 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,
)
));
// throws error because SQL is bad
dibi::query('SELECT FROM customers WHERE customer_id < ?', 38);