Skip to content

Commit 444da17

Browse files
Merge branch '4.4' into 5.0
* 4.4: [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 ccacac4 + 0fed0d6 commit 444da17

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
@@ -306,26 +306,31 @@ private function getDriver(): string
306306
if ($con instanceof \PDO) {
307307
$this->driver = $con->getAttribute(\PDO::ATTR_DRIVER_NAME);
308308
} else {
309-
switch ($this->driver = $con->getDriver()->getName()) {
310-
case 'mysqli':
311-
throw new NotSupportedException(sprintf('The store "%s" does not support the mysqli driver, use pdo_mysql instead.', static::class));
312-
case 'pdo_mysql':
313-
case 'drizzle_pdo_mysql':
309+
$driver = $con->getDriver();
310+
311+
switch (true) {
312+
case $driver instanceof \Doctrine\DBAL\Driver\Mysqli\Driver:
313+
throw new \LogicException(sprintf('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead.', static::class));
314+
315+
case $driver instanceof \Doctrine\DBAL\Driver\AbstractMySQLDriver:
314316
$this->driver = 'mysql';
315317
break;
316-
case 'pdo_sqlite':
318+
case $driver instanceof \Doctrine\DBAL\Driver\PDOSqlite\Driver:
317319
$this->driver = 'sqlite';
318320
break;
319-
case 'pdo_pgsql':
321+
case $driver instanceof \Doctrine\DBAL\Driver\PDOPgSql\Driver:
320322
$this->driver = 'pgsql';
321323
break;
322-
case 'oci8':
323-
case 'pdo_oracle':
324+
case $driver instanceof \Doctrine\DBAL\Driver\OCI8\Driver:
325+
case $driver instanceof \Doctrine\DBAL\Driver\PDOOracle\Driver:
324326
$this->driver = 'oci';
325327
break;
326-
case 'pdo_sqlsrv':
328+
case $driver instanceof \Doctrine\DBAL\Driver\SQLSrv\Driver:
327329
$this->driver = 'sqlsrv';
328330
break;
331+
default:
332+
$this->driver = \get_class($driver);
333+
break;
329334
}
330335
}
331336

0 commit comments

Comments
 (0)