@@ -295,7 +295,7 @@ public function createTable(): void
295
295
$ sql = "CREATE TABLE $ this ->table ( $ this ->idCol VARCHAR(64) NOT NULL PRIMARY KEY, $ this ->tokenCol VARCHAR(64) NOT NULL, $ this ->expirationCol INTEGER) " ;
296
296
break ;
297
297
default :
298
- throw new \DomainException (sprintf ('Creating the lock table is currently not implemented for PDO driver "%s". ' , $ driver ));
298
+ throw new \DomainException (sprintf ('Creating the lock table is currently not implemented for platform "%s". ' , $ driver ));
299
299
}
300
300
301
301
if (method_exists ($ conn , 'executeStatement ' )) {
@@ -331,33 +331,33 @@ private function getDriver(): string
331
331
$ this ->driver = $ con ->getAttribute (\PDO ::ATTR_DRIVER_NAME );
332
332
} else {
333
333
$ driver = $ con ->getDriver ();
334
+ $ platform = $ driver ->getDatabasePlatform ();
335
+
336
+ if ($ driver instanceof \Doctrine \DBAL \Driver \Mysqli \Driver) {
337
+ throw new \LogicException (sprintf ('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead. ' , static ::class));
338
+ }
334
339
335
340
switch (true ) {
336
- case $ driver instanceof \Doctrine \DBAL \Driver \Mysqli \Driver:
337
- throw new \LogicException (sprintf ('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead. ' , static ::class));
338
- case $ driver instanceof \Doctrine \DBAL \Driver \AbstractMySQLDriver:
341
+ case $ platform instanceof \Doctrine \DBAL \Platforms \MySQLPlatform:
342
+ case $ platform instanceof \Doctrine \DBAL \Platforms \MySQL57Platform:
339
343
$ this ->driver = 'mysql ' ;
340
344
break ;
341
- case $ driver instanceof \Doctrine \DBAL \Driver \PDOSqlite \Driver:
342
- case $ driver instanceof \Doctrine \DBAL \Driver \PDO \SQLite \Driver:
345
+ case $ platform instanceof \Doctrine \DBAL \Platforms \SqlitePlatform:
343
346
$ this ->driver = 'sqlite ' ;
344
347
break ;
345
- case $ driver instanceof \Doctrine \DBAL \Driver \ PDOPgSql \Driver :
346
- case $ driver instanceof \Doctrine \DBAL \Driver \ PDO \ PgSQL \Driver :
348
+ case $ platform instanceof \Doctrine \DBAL \Platforms \PostgreSQLPlatform :
349
+ case $ platform instanceof \Doctrine \DBAL \Platforms \PostgreSQL94Platform :
347
350
$ this ->driver = 'pgsql ' ;
348
351
break ;
349
- case $ driver instanceof \Doctrine \DBAL \Driver \OCI8 \Driver:
350
- case $ driver instanceof \Doctrine \DBAL \Driver \PDOOracle \Driver:
351
- case $ driver instanceof \Doctrine \DBAL \Driver \PDO \OCI \Driver:
352
+ case $ platform instanceof \Doctrine \DBAL \Platforms \OraclePlatform:
352
353
$ this ->driver = 'oci ' ;
353
354
break ;
354
- case $ driver instanceof \Doctrine \DBAL \Driver \SQLSrv \Driver:
355
- case $ driver instanceof \Doctrine \DBAL \Driver \PDOSqlsrv \Driver:
356
- case $ driver instanceof \Doctrine \DBAL \Driver \PDO \SQLSrv \Driver:
355
+ case $ platform instanceof \Doctrine \DBAL \Platforms \SQLServerPlatform:
356
+ case $ platform instanceof \Doctrine \DBAL \Platforms \SQLServer2012Platform:
357
357
$ this ->driver = 'sqlsrv ' ;
358
358
break ;
359
359
default :
360
- $ this ->driver = \get_class ($ driver );
360
+ $ this ->driver = \get_class ($ platform );
361
361
break ;
362
362
}
363
363
}
0 commit comments