Skip to content

Commit

Permalink
explain mysql only
Browse files Browse the repository at this point in the history
  • Loading branch information
Recca Tsai committed Jun 20, 2016
1 parent 2492bc2 commit 37ac791
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Panels/DatabasePanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public static function formatSql($sql, array $params = null, PDO $connection = n
* @param string $sql
* @param string $version
* @param float $driver
*
*
* @return array
*/
public static function performQueryAnalysis($sql, $version = null, $driver = null)
Expand Down Expand Up @@ -302,8 +302,15 @@ protected function getAttributes()

$fullSql = self::prepareBindings($sql, $bindings);
$formattedSql = self::formatSql($fullSql);

try {
$driver = $pdo->getAttribute(PDO::ATTR_DRIVER_NAME);
} catch (Exception $e) {
$driver = null;
}

$explains = [];
if ($driver && $pdo instanceof PDO) {
if ($pdo instanceof PDO && $driver === 'mysql') {
$explains = static::explain($pdo, $sql, $bindings);
}

Expand Down

0 comments on commit 37ac791

Please sign in to comment.