mirror of
https://github.com/dg/dibi.git
synced 2025-08-25 15:01:29 +02:00
improved coding style
This commit is contained in:
@@ -106,7 +106,8 @@ class DibiNettePanel extends DibiObject implements Nette\Diagnostics\IBarPanel
|
||||
$event->connection->onEvent = NULL;
|
||||
$cmd = is_string($this->explain) ? $this->explain : ($event->connection->getConfig('driver') === 'oracle' ? 'EXPLAIN PLAN FOR' : 'EXPLAIN');
|
||||
$explain = dibi::dump($event->connection->nativeQuery("$cmd $event->sql"), TRUE);
|
||||
} catch (DibiException $e) {}
|
||||
} catch (DibiException $e) {
|
||||
}
|
||||
list($event->connection->onEvent, dibi::$numOfQueries, dibi::$totalTime) = $backup;
|
||||
}
|
||||
|
||||
|
@@ -7,8 +7,8 @@
|
||||
|
||||
namespace Dibi\Bridges\Nette;
|
||||
|
||||
use dibi,
|
||||
Nette;
|
||||
use dibi;
|
||||
use Nette;
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -7,8 +7,8 @@
|
||||
|
||||
namespace Dibi\Bridges\Tracy;
|
||||
|
||||
use dibi,
|
||||
Tracy;
|
||||
use dibi;
|
||||
use Tracy;
|
||||
|
||||
|
||||
/**
|
||||
@@ -85,7 +85,7 @@ class Panel extends \DibiObject implements Tracy\IBarPanel
|
||||
foreach ($this->events as $event) {
|
||||
$totalTime += $event->time;
|
||||
}
|
||||
return '<span title="dibi"><svg viewBox="0 0 2048 2048" style="vertical-align: bottom; width:1.23em; height:1.55em"><path fill="' . ( $count ? '#b079d6' : '#aaa') . '" d="M1024 896q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5-385-34.5-280-93.5-103-128v-170q119 84 325 127t443 43zm0 768q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5-385-34.5-280-93.5-103-128v-170q119 84 325 127t443 43zm0-384q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5-385-34.5-280-93.5-103-128v-170q119 84 325 127t443 43zm0-1152q208 0 385 34.5t280 93.5 103 128v128q0 69-103 128t-280 93.5-385 34.5-385-34.5-280-93.5-103-128v-128q0-69 103-128t280-93.5 385-34.5z"/></svg><span class="tracy-label">'
|
||||
return '<span title="dibi"><svg viewBox="0 0 2048 2048" style="vertical-align: bottom; width:1.23em; height:1.55em"><path fill="' . ($count ? '#b079d6' : '#aaa') . '" d="M1024 896q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5-385-34.5-280-93.5-103-128v-170q119 84 325 127t443 43zm0 768q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5-385-34.5-280-93.5-103-128v-170q119 84 325 127t443 43zm0-384q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5-385-34.5-280-93.5-103-128v-170q119 84 325 127t443 43zm0-1152q208 0 385 34.5t280 93.5 103 128v128q0 69-103 128t-280 93.5-385 34.5-385-34.5-280-93.5-103-128v-128q0-69 103-128t280-93.5 385-34.5z"/></svg><span class="tracy-label">'
|
||||
. $count . ' queries'
|
||||
. ($totalTime ? sprintf(' / %0.1f ms', $totalTime * 1000) : '')
|
||||
. '</span></span>';
|
||||
@@ -109,7 +109,8 @@ class Panel extends \DibiObject implements Tracy\IBarPanel
|
||||
$event->connection->onEvent = NULL;
|
||||
$cmd = is_string($this->explain) ? $this->explain : ($event->connection->getConfig('driver') === 'oracle' ? 'EXPLAIN PLAN FOR' : 'EXPLAIN');
|
||||
$explain = dibi::dump($event->connection->nativeQuery("$cmd $event->sql"), TRUE);
|
||||
} catch (\DibiException $e) {}
|
||||
} catch (\DibiException $e) {
|
||||
}
|
||||
list($event->connection->onEvent, dibi::$numOfQueries, dibi::$totalTime) = $backup;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user