-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Look harder for a native connection #1210
Conversation
4c4a3bc
to
5c0e06c
Compare
It is not like this could work from another directory than the root of the project.
5c0e06c
to
1e98776
Compare
Tagging @morozov because we currently have a discussion about deprecating the methods you use to access the PDO connection, see doctrine/dbal#4966 |
I think in previous discussions, we established that this |
a9bba0b
to
f9d5556
Compare
doctrine/dbal 3 switches from inheritance to composition but still provides an accessor for PDO, and it is named like the method in Connection. Unwrapping until that method no longer exists should give the innermost connection regardless of the DBAL version Fixes doctrine#1209
f9d5556
to
c9e0386
Compare
Okay, in other words, this class will be broken when DBAL 4 is used eventually and that won't be a problem? In that case, the change looks good. 🙂 |
Yes. Maybe we should create |
|
||
/* Attempt to commit or rollback while no transaction is running | ||
results in an exception since PHP 8 + pdo_mysql combination */ | ||
return ! $wrappedConnection instanceof PDO || $wrappedConnection->inTransaction(); | ||
return ! $innermostConnection instanceof PDO || $innermostConnection->inTransaction(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the "in transaction" method for the drivers of the platform that don't support transactional DDL is still of interest, it looks like the right course of action is to revive the discussion in PHP internals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are planning to drop the TransactionHelper
class in the next major release (ref), so I don't think it will be of interest.
fixes #1209 |
doctrine/dbal 3 switches from inheritance to composition but still
provides an accessor for PDO, and it is named like the method in
Connection.
Unwrapping until that method no longer exists should give the innermost
connection regardless of the DBAL version
I hade to adapt some tests to ensure
getWrappedConnection
returns an object.Fixes #1209
How can I test this?
composer config repositories.greg0ire vcs https://github.com/greg0ire/migrations composer require doctrine/migrations "dev-fix-compat-with-dbal-3 as 3.3.0"