Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b3f22f8

Browse filesBrowse files
committed
bug #52686 [Cache] fix detecting the server version with Doctrine DBAL 4 (xabbuh)
This PR was merged into the 5.4 branch. Discussion ---------- [Cache] fix detecting the server version with Doctrine DBAL 4 | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT Commits ------- 5da1bc7 fix detecting the server version with Doctrine DBAL 4
2 parents 48be4b3 + 5da1bc7 commit b3f22f8
Copy full SHA for b3f22f8

File tree

1 file changed

+5
-0
lines changed
Filter options

1 file changed

+5
-0
lines changed

‎src/Symfony/Component/Cache/Adapter/DoctrineDbalAdapter.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Adapter/DoctrineDbalAdapter.php
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Doctrine\DBAL\ParameterType;
2222
use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory;
2323
use Doctrine\DBAL\Schema\Schema;
24+
use Doctrine\DBAL\ServerVersionProvider;
2425
use Doctrine\DBAL\Tools\DsnParser;
2526
use Symfony\Component\Cache\Exception\InvalidArgumentException;
2627
use Symfony\Component\Cache\Marshaller\DefaultMarshaller;
@@ -420,6 +421,10 @@ private function getServerVersion(): string
420421
return $this->serverVersion;
421422
}
422423

424+
if ($this->conn instanceof ServerVersionProvider) {
425+
return $this->conn->getServerVersion();
426+
}
427+
423428
// The condition should be removed once support for DBAL <3.3 is dropped
424429
$conn = method_exists($this->conn, 'getNativeConnection') ? $this->conn->getNativeConnection() : $this->conn->getWrappedConnection();
425430
if ($conn instanceof ServerInfoAwareConnection) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.