Closed
Description
Historically, the DBAL public API uses PDO
constants which creates a hard dependency and makes the abstraction not that abstract. For the end user, it means that even if none of the PDO
drivers are going to be used, the production environment still has to have ext-pdo
installed.
To eliminate the dependency, the PDO
constants in the method signatures should be replaced by the DBAL's own ones:
PDO::PARAM_*
→Doctrine\DBAL\Driver\Statement::PARAM_*
,PDO::FETCH_*
→Doctrine\DBAL\Driver\ResultStatement::FETCH_*
,PDO::CASE_*
→Doctrine\DBAL\Driver\ResultStatement::CASE_*
.
It can be done in phases:
- In
2.x
, introduce the new DBAL constants and assign them corresponding PDO values, e.g.Statement::PARAM_INT = PDO::PARAM_INT
. - Deprecate the usage of
PDO::
constants when calling the DBAL methods. - In
3.0
, replace thePDO
constants with their integer values, e.g.Statement::PARAM_INT = 1
- Remove the dependency.