Description
Bug Report
Q | A |
---|---|
BC Break | ? |
Version | 3.0.0 |
Summary
\Doctrine\DBAL\DriverManager::getConnection
does not accept an existing PDO object as a configuration option.
I'm not sure if this support was removed in 3.0.0 or if this is a bug. I'm really hoping it's a bug since I won't be able to use 3.0.0 in the case that it's not supported. =)
I think it's a bug since the 3.0.0 documentation is the same API as the 2.x series (or I guess it could be a documentation c&p issue).
Thank you!
Current behaviour
When using
DriverManager::getConnection(['pdo' => new \PDO(/* constructor options */)]);
\Doctrine\DBAL\Exception
is thrown with the message "The options 'driver' or 'driverClass' are mandatory if no PDO instance is given to DriverManager::getConnection().".
How to reproduce
Execute
DriverManager::getConnection(['pdo' => new \PDO(/* constructor options */)]);
Notice that \Doctrine\DBAL\Exception
is thrown with the message "The options 'driver' or 'driverClass' are mandatory if no PDO instance is given to DriverManager::getConnection().".
Expected behaviour
No Throwable is thrown and DriverManager::getConnection
returns a viable connection. (i.e. it works as it does in 2.12.1)