Skip to content

Commit

Permalink
examples: tracy is loaded before output [Closes #248]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Feb 19, 2017
1 parent 67bc7cc commit c9fcd53
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 26 deletions.
10 changes: 6 additions & 4 deletions examples/fetching-examples.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">

<h1>Fetching Examples | dibi</h1>

<?php

if (@!include __DIR__ . '/../vendor/autoload.php') {
Expand All @@ -10,6 +6,12 @@

Tracy\Debugger::enable();

?>
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">

<h1>Fetching Examples | dibi</h1>

<?php

dibi::connect([
'driver' => 'sqlite3',
Expand Down
10 changes: 6 additions & 4 deletions examples/result-set-data-types.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">

<h1>Result Set Data Types | dibi</h1>

<?php

use Dibi\Type;
Expand All @@ -14,6 +10,12 @@

date_default_timezone_set('Europe/Prague');

?>
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">

<h1>Result Set Data Types | dibi</h1>

<?php

dibi::connect([
'driver' => 'sqlite3',
Expand Down
12 changes: 6 additions & 6 deletions examples/tracy-and-exceptions.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">

<h1>Tracy & SQL Exceptions | dibi</h1>

<p>Dibi can display and log exceptions via <a href="https://tracy.nette.org">Tracy</a>.</p>

<?php

if (@!include __DIR__ . '/../vendor/autoload.php') {
Expand Down Expand Up @@ -31,3 +25,9 @@

// throws error because SQL is bad
dibi::query('SELECT FROM customers WHERE customer_id < ?', 38);

?><!DOCTYPE html><link rel="stylesheet" href="data/style.css">

<h1>Tracy & SQL Exceptions | dibi</h1>

<p>Dibi can display and log exceptions via <a href="https://tracy.nette.org">Tracy</a>.</p>
18 changes: 10 additions & 8 deletions examples/tracy.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">

<style> html { background: url(data/arrow.png) no-repeat bottom right; height: 100%; } </style>

<h1>Tracy | dibi</h1>

<p>Dibi can log queries and dump variables to the <a href="https://tracy.nette.org">Tracy</a>.</p>

<?php

if (@!include __DIR__ . '/../vendor/autoload.php') {
Expand Down Expand Up @@ -36,3 +28,13 @@

// result set will be dumped
Tracy\Debugger::barDump(dibi::fetchAll('SELECT * FROM customers WHERE customer_id < ?', 38), '[customers]');


?>
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">

<style> html { background: url(data/arrow.png) no-repeat bottom right; height: 100%; } </style>

<h1>Tracy | dibi</h1>

<p>Dibi can log queries and dump variables to the <a href="https://tracy.nette.org">Tracy</a>.</p>
10 changes: 6 additions & 4 deletions examples/using-extension-methods.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">

<h1>Using Extension Methods | dibi</h1>

<?php

if (@!include __DIR__ . '/../vendor/autoload.php') {
Expand All @@ -10,6 +6,12 @@

Tracy\Debugger::enable();

?>
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">

<h1>Using Extension Methods | dibi</h1>

<?php

dibi::connect([
'driver' => 'sqlite3',
Expand Down

0 comments on commit c9fcd53

Please sign in to comment.