From 040610fc3caabdf5cc892841ec7668e99564496c 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 (cherry picked from commit 7b02296f3ee5af713d89bf1eb94484fbe3f25bd8) --- 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 8731e25cf..b1056c823 100644 --- a/src/Dibi/Bridges/Tracy/Panel.php +++ b/src/Dibi/Bridges/Tracy/Panel.php @@ -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') : ''); }