Skip to content

Commit a869f6b

Browse files
author
Composite PHP
committed
Fix Docrtine DBAL deprecation notice, initialize Config and set DefaultSchemaManagerFactory
1 parent 0945254 commit a869f6b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ConnectionManager.php

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Doctrine\DBAL\Connection;
99
use Doctrine\DBAL\DriverManager;
1010
use Doctrine\DBAL\Exception;
11+
use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory;
1112

1213
class ConnectionManager
1314
{
@@ -24,6 +25,12 @@ public static function getConnection(string $name, ?Configuration $config = null
2425
{
2526
if (!isset(self::$connections[$name])) {
2627
try {
28+
if (!$config) {
29+
$config = new Configuration();
30+
}
31+
if (!$config->getSchemaManagerFactory()) {
32+
$config->setSchemaManagerFactory(new DefaultSchemaManagerFactory());
33+
}
2734
self::$connections[$name] = DriverManager::getConnection(
2835
params: self::getConnectionParams($name),
2936
config: $config,

0 commit comments

Comments
 (0)