Skip to content

Commit bc7bc5e

Browse files
Merge branch '5.0' into 5.1
* 5.0: [VarDumper] fix typo Fix support for PHP8 union types [FrameworkBundle] preserve dots in query-string when redirecting [3.4] Fix support for PHP8 union types [PhpUnitBridge] Streamline ansi/no-ansi of composer according to phpunit --colors option [3.4] Small update in our internal terminology [Cache] fix compat with DBAL v3 [HttpClient] Convert CurlHttpClient::handlePush() to instance method [VarDumper] Fix CliDumper coloration [DI] tighten detection of local dirs to prevent false positives [FrameworkBundle] preserve dots in query-string when redirecting Fix precendence in 4.4 bumped Symfony version to 3.4.43 updated VERSION for 3.4.42 update CONTRIBUTORS for 3.4.42 updated CHANGELOG for 3.4.42
2 parents 1c7ac88 + 444da17 commit bc7bc5e

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

Store/PdoStore.php

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -318,26 +318,31 @@ private function getDriver(): string
318318
if ($con instanceof \PDO) {
319319
$this->driver = $con->getAttribute(\PDO::ATTR_DRIVER_NAME);
320320
} else {
321-
switch ($this->driver = $con->getDriver()->getName()) {
322-
case 'mysqli':
323-
throw new NotSupportedException(sprintf('The store "%s" does not support the mysqli driver, use pdo_mysql instead.', static::class));
324-
case 'pdo_mysql':
325-
case 'drizzle_pdo_mysql':
321+
$driver = $con->getDriver();
322+
323+
switch (true) {
324+
case $driver instanceof \Doctrine\DBAL\Driver\Mysqli\Driver:
325+
throw new \LogicException(sprintf('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead.', static::class));
326+
327+
case $driver instanceof \Doctrine\DBAL\Driver\AbstractMySQLDriver:
326328
$this->driver = 'mysql';
327329
break;
328-
case 'pdo_sqlite':
330+
case $driver instanceof \Doctrine\DBAL\Driver\PDOSqlite\Driver:
329331
$this->driver = 'sqlite';
330332
break;
331-
case 'pdo_pgsql':
333+
case $driver instanceof \Doctrine\DBAL\Driver\PDOPgSql\Driver:
332334
$this->driver = 'pgsql';
333335
break;
334-
case 'oci8':
335-
case 'pdo_oracle':
336+
case $driver instanceof \Doctrine\DBAL\Driver\OCI8\Driver:
337+
case $driver instanceof \Doctrine\DBAL\Driver\PDOOracle\Driver:
336338
$this->driver = 'oci';
337339
break;
338-
case 'pdo_sqlsrv':
340+
case $driver instanceof \Doctrine\DBAL\Driver\SQLSrv\Driver:
339341
$this->driver = 'sqlsrv';
340342
break;
343+
default:
344+
$this->driver = \get_class($driver);
345+
break;
341346
}
342347
}
343348

0 commit comments

Comments
 (0)