From 41ea779ebb5808ff0e55f8dcda26f1c6ad7b2004 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 6 May 2025 20:55:03 +0200 Subject: [PATCH] choose the correctly cased class name for the SQLite platform --- .../Component/Cache/Adapter/DoctrineDbalAdapter.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Cache/Adapter/DoctrineDbalAdapter.php b/src/Symfony/Component/Cache/Adapter/DoctrineDbalAdapter.php index c3a4909e211df..8e52dfee240a0 100644 --- a/src/Symfony/Component/Cache/Adapter/DoctrineDbalAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/DoctrineDbalAdapter.php @@ -359,9 +359,16 @@ private function getPlatformName(): string $platform = $this->conn->getDatabasePlatform(); + if (interface_exists(DBALException::class)) { + // DBAL 4+ + $sqlitePlatformClass = 'Doctrine\DBAL\Platforms\SQLitePlatform'; + } else { + $sqlitePlatformClass = 'Doctrine\DBAL\Platforms\SqlitePlatform'; + } + return $this->platformName = match (true) { $platform instanceof \Doctrine\DBAL\Platforms\AbstractMySQLPlatform => 'mysql', - $platform instanceof \Doctrine\DBAL\Platforms\SqlitePlatform => 'sqlite', + $platform instanceof $sqlitePlatformClass => 'sqlite', $platform instanceof \Doctrine\DBAL\Platforms\PostgreSQLPlatform => 'pgsql', $platform instanceof \Doctrine\DBAL\Platforms\OraclePlatform => 'oci', $platform instanceof \Doctrine\DBAL\Platforms\SQLServerPlatform => 'sqlsrv',