You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the one hand, it's unclear to the implementors of Driver::connect(), whether the parameters should be taken from $params or from the individual parameters. On the other hand, the code components that call connect() need to mimic the behavior of the Connection class:
By being this verbose, this API doesn't solve any design problem. On the contrary, once a driver receives these parameters individually, it may have to pack them back or regroup otherwise before processing:
Since Driver::connect() plays the role of an adapter between the DBAL Connection::connect() and the Driver Connection::__construct(), it shouldn't expect Connection::connect() to do any adaptation.
The text was updated successfully, but these errors were encountered:
User credentials and driver options are passed to the driver both via individual parameters and as part of
$params
:dbal/src/Connection.php
Lines 352 to 356 in 48625f1
On the one hand, it's unclear to the implementors of
Driver::connect()
, whether the parameters should be taken from$params
or from the individual parameters. On the other hand, the code components that callconnect()
need to mimic the behavior of theConnection
class:dbal/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php
Lines 195 to 198 in d6f232e
dbal/tests/Functional/Driver/AbstractDriverTest.php
Lines 34 to 37 in 3d8c575
More examples:
dbal/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php
Lines 120 to 123 in 48625f1
dbal/tests/Functional/Schema/SqliteSchemaManagerTest.php
Lines 53 to 56 in 48625f1
dbal/tests/Doctrine/Tests/DBAL/Functional/Driver/Mysqli/ConnectionTest.php
Lines 63 to 68 in f88dc28
dbal/tests/Doctrine/Tests/DBAL/Driver/PDOPgSql/DriverTest.php
Lines 96 to 101 in f88dc28
dbal/tests/Doctrine/Tests/DBAL/Functional/Driver/PDOSqlsrv/DriverTest.php
Lines 47 to 52 in f88dc28
By being this verbose, this API doesn't solve any design problem. On the contrary, once a driver receives these parameters individually, it may have to pack them back or regroup otherwise before processing:
dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Driver.php
Lines 17 to 19 in 747b042
dbal/lib/Doctrine/DBAL/Driver/SQLSrv/Driver.php
Lines 34 to 40 in 4074ae9
dbal/lib/Doctrine/DBAL/Driver/SQLAnywhere/Driver.php
Lines 78 to 84 in 4074ae9
Since
Driver::connect()
plays the role of an adapter between the DBALConnection::connect()
and the DriverConnection::__construct()
, it shouldn't expectConnection::connect()
to do any adaptation.The text was updated successfully, but these errors were encountered: