diff --git a/examples/tracy-and-exceptions.php b/examples/tracy-and-exceptions.php index 376dcc0..d5f4a4e 100644 --- a/examples/tracy-and-exceptions.php +++ b/examples/tracy-and-exceptions.php @@ -2,11 +2,7 @@
Dibi can display and log exceptions via Tracy, part of Nette Framework.
- -Dibi can display and log exceptions via Tracy.
'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 diff --git a/examples/tracy-and-variables.php b/examples/tracy.php similarity index 60% rename from examples/tracy-and-variables.php rename to examples/tracy.php index 0b90aec..5e5d820 100644 --- a/examples/tracy-and-variables.php +++ b/examples/tracy.php @@ -2,13 +2,9 @@ -Dibi can dump variables via Tracy, part of Nette Framework.
- -Dibi can log queries and dump variables to the Tracy.
'sqlite3', 'database' => 'data/sample.s3db', 'profiler' => array( @@ -29,4 +26,13 @@ dibi::connect(array( )); +// add panel to debug bar +$panel = new Dibi\Bridges\Tracy\Panel; +$panel->register($connection); + + +// query will be logged +dibi::query('SELECT 123'); + +// result set will be dumped Tracy\Debugger::barDump( dibi::fetchAll('SELECT * FROM customers WHERE customer_id < ?', 38), '[customers]' );