Skip to content

Commit

Permalink
Tracy\Panel: fixed object to string converion error with custom driver (
Browse files Browse the repository at this point in the history
dg#373)

Co-authored-by: Miloslav Hůla <miloslav.hula@fsv.cvut.cz>
(cherry picked from commit 7b02296)
  • Loading branch information
milo authored and Jakub-Fajkus committed Feb 9, 2022
1 parent 26ad2ff commit 040610f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Dibi/Bridges/Tracy/Panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ public function getPanel(): ?string

private function getConnectionName(Dibi\Connection $connection): string
{
return $connection->getConfig('driver')
$driver = $connection->getConfig('driver');
return (is_object($driver) ? get_class($driver) : $driver)
. ($connection->getConfig('name') ? '/' . $connection->getConfig('name') : '')
. ($connection->getConfig('host') ? ' @ ' . $connection->getConfig('host') : '');
}
Expand Down

0 comments on commit 040610f

Please sign in to comment.