From 7b02296f3ee5af713d89bf1eb94484fbe3f25bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20H=C5=AFla?= Date: Tue, 15 Sep 2020 16:32:07 +0200 Subject: [PATCH] Tracy\Panel: fixed object to string converion error with custom driver (#373) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Miloslav Hůla --- src/Dibi/Bridges/Tracy/Panel.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Dibi/Bridges/Tracy/Panel.php b/src/Dibi/Bridges/Tracy/Panel.php index 8731e25c..b1056c82 100644 --- a/src/Dibi/Bridges/Tracy/Panel.php +++ b/src/Dibi/Bridges/Tracy/Panel.php @@ -167,7 +167,8 @@ class Panel implements Tracy\IBarPanel 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') : ''); }