We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a04029f commit 121133aCopy full SHA for 121133a
lib/Doctrine/DBAL/DriverManager.php
@@ -10,6 +10,7 @@
10
use Doctrine\DBAL\Driver\PDO;
11
use Doctrine\DBAL\Driver\SQLAnywhere;
12
use Doctrine\DBAL\Driver\SQLSrv;
13
+use Doctrine\Deprecations\Deprecation;
14
15
use function array_keys;
16
use function array_merge;
@@ -217,6 +218,12 @@ public static function getConnection(
217
218
}
219
220
if (isset($params['pdo'])) {
221
+ Deprecation::trigger(
222
+ 'doctrine/dbal',
223
+ 'https://github.com/doctrine/dbal/pull/3554',
224
+ 'Passing a user provided PDO instance directly to Doctrine is deprecated.'
225
+ );
226
+
227
$params['pdo']->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
228
$params['driver'] = 'pdo_' . $params['pdo']->getAttribute(\PDO::ATTR_DRIVER_NAME);
229
0 commit comments