Skip to content

Commit 41ea779

Browse files
committed
choose the correctly cased class name for the SQLite platform
1 parent ed0a235 commit 41ea779

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Symfony/Component/Cache/Adapter/DoctrineDbalAdapter.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,16 @@ private function getPlatformName(): string
359359

360360
$platform = $this->conn->getDatabasePlatform();
361361

362+
if (interface_exists(DBALException::class)) {
363+
// DBAL 4+
364+
$sqlitePlatformClass = 'Doctrine\DBAL\Platforms\SQLitePlatform';
365+
} else {
366+
$sqlitePlatformClass = 'Doctrine\DBAL\Platforms\SqlitePlatform';
367+
}
368+
362369
return $this->platformName = match (true) {
363370
$platform instanceof \Doctrine\DBAL\Platforms\AbstractMySQLPlatform => 'mysql',
364-
$platform instanceof \Doctrine\DBAL\Platforms\SqlitePlatform => 'sqlite',
371+
$platform instanceof $sqlitePlatformClass => 'sqlite',
365372
$platform instanceof \Doctrine\DBAL\Platforms\PostgreSQLPlatform => 'pgsql',
366373
$platform instanceof \Doctrine\DBAL\Platforms\OraclePlatform => 'oci',
367374
$platform instanceof \Doctrine\DBAL\Platforms\SQLServerPlatform => 'sqlsrv',

0 commit comments

Comments
 (0)