Skip to content

[Cache] remove Doctrine DBAL < 3.3 related code #52685

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Symfony/Component/Cache/Adapter/DoctrineDbalAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,7 @@ private function getServerVersion(): string
return $this->serverVersion;
}

// The condition should be removed once support for DBAL <3.3 is dropped
$conn = method_exists($this->conn, 'getNativeConnection') ? $this->conn->getNativeConnection() : $this->conn->getWrappedConnection();
$conn = $this->conn->getNativeConnection();
if ($conn instanceof ServerInfoAwareConnection) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this does not really make sense. If we call getNativeConnection(), we get the native handle of the PHP extension used, e.g. a mysqli instance or an sqlsrv resource. Those objects/resources won't ever implement ServerInfoAwareConnection. Something's off here.

Copy link
Member Author

@xabbuh xabbuh Nov 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you are right. Looks like we first need to fix it in a way similar to #52715.

return $this->serverVersion = $conn->getServerVersion();
}
Expand Down