1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 14:16:39 +02:00

Tracy\Panel: fixed object to string converion error with custom driver (#373)

Co-authored-by: Miloslav Hůla <miloslav.hula@fsv.cvut.cz>
This commit is contained in:
Miloslav Hůla
2020-09-15 16:32:07 +02:00
committed by David Grudl
parent df4cddac1f
commit 7b02296f3e

View File

@@ -167,7 +167,8 @@ class Panel implements Tracy\IBarPanel
private function getConnectionName(Dibi\Connection $connection): 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('name') ? '/' . $connection->getConfig('name') : '')
. ($connection->getConfig('host') ? '@' . $connection->getConfig('host') : ''); . ($connection->getConfig('host') ? '@' . $connection->getConfig('host') : '');
} }