diff --git a/src/Dibi/Bridges/Nette/DibiExtension21.php b/src/Dibi/Bridges/Nette/DibiExtension21.php
deleted file mode 100644
index f74ae23a..00000000
--- a/src/Dibi/Bridges/Nette/DibiExtension21.php
+++ /dev/null
@@ -1,52 +0,0 @@
-getContainerBuilder();
- $config = $this->getConfig();
-
- $useProfiler = isset($config['profiler'])
- ? $config['profiler']
- : $container->parameters['debugMode'];
-
- unset($config['profiler']);
-
- if (isset($config['flags'])) {
- $flags = 0;
- foreach ((array) $config['flags'] as $flag) {
- $flags |= constant($flag);
- }
- $config['flags'] = $flags;
- }
-
- $connection = $container->addDefinition($this->prefix('connection'))
- ->setClass('Dibi\Connection', [$config])
- ->setAutowired(isset($config['autowired']) ? $config['autowired'] : TRUE);
-
- if ($useProfiler) {
- $panel = $container->addDefinition($this->prefix('panel'))
- ->setClass('Dibi\Bridges\Nette\Panel')
- ->addSetup('Nette\Diagnostics\Debugger::getBar()->addPanel(?)', ['@self'])
- ->addSetup('Nette\Diagnostics\Debugger::getBlueScreen()->addPanel(?)', ['Dibi\Bridges\Nette\Panel::renderException']);
-
- $connection->addSetup('$service->onEvent[] = ?', [[$panel, 'logEvent']]);
- }
- }
-
-}
diff --git a/src/Dibi/Bridges/Nette/Panel.php b/src/Dibi/Bridges/Nette/Panel.php
deleted file mode 100644
index cc7e439f..00000000
--- a/src/Dibi/Bridges/Nette/Panel.php
+++ /dev/null
@@ -1,153 +0,0 @@
-filter = $filter ? (int) $filter : Event::QUERY;
- $this->explain = $explain;
- }
-
-
- public function register(Dibi\Connection $connection)
- {
- Debugger::getBar()->addPanel($this);
- Debugger::getBlueScreen()->addPanel([__CLASS__, 'renderException']);
- $connection->onEvent[] = [$this, 'logEvent'];
- }
-
-
- /**
- * After event notification.
- * @return void
- */
- public function logEvent(Event $event)
- {
- if (($event->type & $this->filter) === 0) {
- return;
- }
- $this->events[] = $event;
- }
-
-
- /**
- * Returns blue-screen custom tab.
- * @return mixed
- */
- public static function renderException($e)
- {
- if ($e instanceof Dibi\Exception && $e->getSql()) {
- return [
- 'tab' => 'SQL',
- 'panel' => Helpers::dump($e->getSql(), TRUE),
- ];
- }
- }
-
-
- /**
- * Returns HTML code for custom tab. (Nette\Diagnostics\IBarPanel)
- * @return mixed
- */
- public function getTab()
- {
- $totalTime = 0;
- foreach ($this->events as $event) {
- $totalTime += $event->time;
- }
- return ''
- . count($this->events) . ' queries'
- . ($totalTime ? sprintf(' / %0.1f ms', $totalTime * 1000) : '')
- . '';
- }
-
-
- /**
- * Returns HTML code for custom panel. (Nette\Diagnostics\IBarPanel)
- * @return mixed
- */
- public function getPanel()
- {
- $totalTime = $s = NULL;
- $h = 'htmlSpecialChars';
- foreach ($this->events as $event) {
- $totalTime += $event->time;
- $explain = NULL; // EXPLAIN is called here to work SELECT FOUND_ROWS()
- if ($this->explain && $event->type === Event::SELECT) {
- try {
- $backup = [$event->connection->onEvent, \dibi::$numOfQueries, \dibi::$totalTime];
- $event->connection->onEvent = NULL;
- $cmd = is_string($this->explain) ? $this->explain : ($event->connection->getConfig('driver') === 'oracle' ? 'EXPLAIN PLAN FOR' : 'EXPLAIN');
- $explain = Helpers::dump($event->connection->nativeQuery("$cmd $event->sql"), TRUE);
- } catch (Dibi\Exception $e) {
- }
- list($event->connection->onEvent, \dibi::$numOfQueries, \dibi::$totalTime) = $backup;
- }
-
- $s .= '
Time ms | SQL Statement | Rows | Connection |
---|