Skip to content

Commit e0e275d

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: [Translation] [Bridge] [Lokalise] do not export empty strings [Lock] Use platform to identify the PDO driver fix merge [HttpFoundation] Update http messages of statuses 413 and 422 [DependencyInjection] fix support for "new" in initializers on PHP 8.1 added missing trasnlations in Greek add translation for zh_TW 41830 missing translations for serbian sr latn Changed some translations to be more in line with native Serbian language [HttpFoundation] Fix ianaCodesReasonPhrasesProvider to consume a local file Add armenian translation for #41835 Add swedish translation for #41835 Added missing danish translations and fixed typo in validators.da.xlf [FrameworkBundle] Minor improvement - No `array_merge` in loop
2 parents 1fcea54 + 2e8219d commit e0e275d

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

Store/PdoStore.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ public function createTable(): void
293293
$sql = "CREATE TABLE $this->table ($this->idCol VARCHAR(64) NOT NULL PRIMARY KEY, $this->tokenCol VARCHAR(64) NOT NULL, $this->expirationCol INTEGER)";
294294
break;
295295
default:
296-
throw new \DomainException(sprintf('Creating the lock table is currently not implemented for PDO driver "%s".', $driver));
296+
throw new \DomainException(sprintf('Creating the lock table is currently not implemented for platform "%s".', $driver));
297297
}
298298

299299
if (method_exists($conn, 'executeStatement')) {
@@ -345,33 +345,33 @@ private function getDriver(): string
345345
$this->driver = $con->getAttribute(\PDO::ATTR_DRIVER_NAME);
346346
} else {
347347
$driver = $con->getDriver();
348+
$platform = $driver->getDatabasePlatform();
349+
350+
if ($driver instanceof \Doctrine\DBAL\Driver\Mysqli\Driver) {
351+
throw new \LogicException(sprintf('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead.', static::class));
352+
}
348353

349354
switch (true) {
350-
case $driver instanceof \Doctrine\DBAL\Driver\Mysqli\Driver:
351-
throw new \LogicException(sprintf('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead.', static::class));
352-
case $driver instanceof \Doctrine\DBAL\Driver\AbstractMySQLDriver:
355+
case $platform instanceof \Doctrine\DBAL\Platforms\MySQLPlatform:
356+
case $platform instanceof \Doctrine\DBAL\Platforms\MySQL57Platform:
353357
$this->driver = 'mysql';
354358
break;
355-
case $driver instanceof \Doctrine\DBAL\Driver\PDOSqlite\Driver:
356-
case $driver instanceof \Doctrine\DBAL\Driver\PDO\SQLite\Driver:
359+
case $platform instanceof \Doctrine\DBAL\Platforms\SqlitePlatform:
357360
$this->driver = 'sqlite';
358361
break;
359-
case $driver instanceof \Doctrine\DBAL\Driver\PDOPgSql\Driver:
360-
case $driver instanceof \Doctrine\DBAL\Driver\PDO\PgSQL\Driver:
362+
case $platform instanceof \Doctrine\DBAL\Platforms\PostgreSQLPlatform:
363+
case $platform instanceof \Doctrine\DBAL\Platforms\PostgreSQL94Platform:
361364
$this->driver = 'pgsql';
362365
break;
363-
case $driver instanceof \Doctrine\DBAL\Driver\OCI8\Driver:
364-
case $driver instanceof \Doctrine\DBAL\Driver\PDOOracle\Driver:
365-
case $driver instanceof \Doctrine\DBAL\Driver\PDO\OCI\Driver:
366+
case $platform instanceof \Doctrine\DBAL\Platforms\OraclePlatform:
366367
$this->driver = 'oci';
367368
break;
368-
case $driver instanceof \Doctrine\DBAL\Driver\SQLSrv\Driver:
369-
case $driver instanceof \Doctrine\DBAL\Driver\PDOSqlsrv\Driver:
370-
case $driver instanceof \Doctrine\DBAL\Driver\PDO\SQLSrv\Driver:
369+
case $platform instanceof \Doctrine\DBAL\Platforms\SQLServerPlatform:
370+
case $platform instanceof \Doctrine\DBAL\Platforms\SQLServer2012Platform:
371371
$this->driver = 'sqlsrv';
372372
break;
373373
default:
374-
$this->driver = \get_class($driver);
374+
$this->driver = \get_class($platform);
375375
break;
376376
}
377377
}

0 commit comments

Comments
 (0)