Skip to content

Commit

Permalink
[TASK] Avoid deprecated AbstractSchemaManager::getDatabasePlatform()
Browse files Browse the repository at this point in the history
The doctrine team deprecated the `AbstractSchemaManager::getDatabasePlatform()`
method has been deprecated. [1]

Use `Connection::getDatabasePlatform()` instead to mitigate this deprecation.

[1] https://github.com/doctrine/dbal/blob/3.7.x/UPGRADE.md#deprecated-abstractschemamanagergetdatabaseplatform

Releases: main
  • Loading branch information
sbuerk committed Nov 21, 2023
1 parent ac78c77 commit ab020af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Classes/Core/Testbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -659,9 +659,10 @@ public function setUpTestDatabase(string $databaseName, string $originalDatabase
// @todo: This should by now work with using "our" ConnectionPool again, it does now, though.
$connectionParameters = $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default'];
unset($connectionParameters['dbname']);
$schemaManager = DriverManager::getConnection($connectionParameters)->createSchemaManager();
$connection = DriverManager::getConnection($connectionParameters);
$schemaManager = $connection->createSchemaManager();

if ($schemaManager->getDatabasePlatform()->getName() === 'sqlite') {
if ($connection->getDatabasePlatform()->getName() === 'sqlite') {
// This is the "path" option in sqlite: one file = one db
$schemaManager->dropDatabase($databaseName);
} elseif (in_array($databaseName, $schemaManager->listDatabases(), true)) {
Expand Down

0 comments on commit ab020af

Please sign in to comment.