-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DBAL-1156: Doctrine assumes that PDO is available #1097
Comments
Comment created by @Ocramius: Seems rather like a missing dependency in |
Comment created by azielinski: Why provide non-PDO drivers then? In doctrine-dbal not a single method or object from PDO is used (aside of PDOConnection.php), it's all about accessing constants like PDO::PARAM_STR. This particular thing could be polyfilled very easily. |
Comment created by @Ocramius: Those drivers work as long as PDO is also installed. |
Comment created by azielinski: Sure they do, my point is that with minimal effort (that I offer to provide) those drivers could work without PDO as well. In fact that would make more sense - I can imagine that one of typical use cases for e.g. Mysqli driver is a situation where PDO cannot be used for some reason. Correct me if I'm wrong, but I believe there is no real reason for doctrine-dbal to depend on PDO. Aside of accessing constants, PDO is only used by PDOConnection (which is only used by PDO-based drivers). PDO constants can be shimmed extremely easily. |
Comment created by @Ocramius: [~azielinski] if that's the minimal requirement, then a shim is fine |
I suspect this one can be closed as |
@chrisguitarguy thanks! |
Fixed in #2709 |
This is a thing I still don't understand about the DBAL: as a user, why in order to use Would the community consider a patch which replaces the usage of PDO constants with its own ones? |
@morozov we had that discussion already, right? maybe we can review this for |
@lcobucci #808 (comment) is the only discussion I'm aware of. The patch wasn't about fixing the real issue. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Jira issue originally created by user azielinski:
use PDO
and references to PDO class are seen in following files:Connection.php
Statement.php
Cache/ArrayStatement.php
Cache/ResultCacheStatement.php
Driver/PDOConnection.php
Driver/Mysqli/MysqliStatement.php
Driver/OCI8/OCI8Statement.php
Driver/SQLSrv/SQLSrvStatement.php
Driver/Portability/Statement.php
It's all about using constants like PDO::FETCH_COLUMN. No actual methods are invoked, no objects are instantiated. This could be easily abstracted out to a class included in doctrine-dbal.
I stumbled upon this because I tried to use
mysqli
driver specifically because my installation of PHP is compiled with --disable-pdo.As a quick & dirty workaround I included a file PDO.php with a shim, but it would be nice if Doctrine did not assume PDO is installed.
I am more than happy to prepare a pull request to fix it if you confirm this is something that needs attention.
The text was updated successfully, but these errors were encountered: