Skip to content
Permalink
Browse files

Update DatabasePanel.php

  • Loading branch information...
recca0120 committed Apr 27, 2016
1 parent c39e748 commit 5a478a975b94116e2d6ea41b5bf5a76d4809d0ec
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/Panels/DatabasePanel.php
@@ -2,6 +2,7 @@
namespace Recca0120\LaravelTracy\Panels;
use Exception;
use PDO;
class DatabasePanel extends AbstractPanel
@@ -90,14 +91,17 @@ public function logQuery($prepare, $bindings = [], $time = 0, $name = null, PDO
$formattedSql = static::formatSql($sql);
$explains = [];
$version = 0;
if ($pdo instanceof PDO) {
$version = $pdo->getAttribute(PDO::ATTR_SERVER_VERSION);
$driver = $pdo->getAttribute(PDO::ATTR_DRIVER_NAME);
if ($driver === 'mysql') {
$explains = $this->explains($pdo, $prepare, $bindings);
}
} else {
$version = 0;
try {
$version = $pdo->getAttribute(PDO::ATTR_SERVER_VERSION);
} catch (Exception $e) {
}
}
$hints = static::performQueryAnalysis($sql, $version, $driver);

0 comments on commit 5a478a9

Please sign in to comment.
You can’t perform that action at this time.