mirror of
https://github.com/dg/dibi.git
synced 2025-08-04 13:17:58 +02:00
DibiNettePanel: explain SQL command can be altered
This commit is contained in:
@@ -42,7 +42,7 @@ class DibiNettePanel extends DibiObject implements IBarPanel
|
||||
public function __construct($explain = TRUE, $filter = NULL)
|
||||
{
|
||||
$this->filter = $filter ? (int) $filter : DibiEvent::QUERY;
|
||||
$this->explain = (bool) $explain;
|
||||
$this->explain = $explain;
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,8 @@ class DibiNettePanel extends DibiObject implements IBarPanel
|
||||
try {
|
||||
$backup = array($event->connection->onEvent, dibi::$numOfQueries, dibi::$totalTime);
|
||||
$event->connection->onEvent = NULL;
|
||||
$explain = dibi::dump($event->connection->nativeQuery('EXPLAIN ' . $event->sql), TRUE);
|
||||
$cmd = is_string($this->explain) ? $this->explain : 'EXPLAIN';
|
||||
$explain = dibi::dump($event->connection->nativeQuery("$cmd $event->sql"), TRUE);
|
||||
} catch (DibiException $e) {}
|
||||
list($event->connection->onEvent, dibi::$numOfQueries, dibi::$totalTime) = $backup;
|
||||
}
|
||||
|
Reference in New Issue
Block a user