Skip to content

Commit abb34d3

Browse files
committed
minor symfony#59220 [Messenger] choose the correctly cased class name for the MariaDB platform (xabbuh)
This PR was merged into the 7.1 branch. Discussion ---------- [Messenger] choose the correctly cased class name for the MariaDB platform | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT see e.g. https://github.com/symfony/symfony/actions/runs/12353148434/job/34471646429?pr=58370#step:9:631 Commits ------- fd4e493 choose the correctly cased class name for the MariaDB platform
2 parents b53e128 + fd4e493 commit abb34d3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/ConnectionTest.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Doctrine\DBAL\Connection as DBALConnection;
1515
use Doctrine\DBAL\Exception as DBALException;
1616
use Doctrine\DBAL\Platforms\AbstractPlatform;
17-
use Doctrine\DBAL\Platforms\MariaDb1060Platform;
1817
use Doctrine\DBAL\Platforms\MariaDBPlatform;
1918
use Doctrine\DBAL\Platforms\MySQL57Platform;
2019
use Doctrine\DBAL\Platforms\MySQL80Platform;
@@ -590,9 +589,16 @@ class_exists(MySQLPlatform::class) ? new MySQLPlatform() : new MySQL57Platform()
590589
'SELECT m.* FROM messenger_messages m WHERE (m.queue_name = ?) AND (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) ORDER BY available_at ASC LIMIT 1 FOR UPDATE',
591590
];
592591

593-
if (class_exists(MariaDb1060Platform::class)) {
592+
if (interface_exists(DBALException::class)) {
593+
// DBAL 4+
594+
$mariaDbPlatformClass = 'Doctrine\DBAL\Platforms\MariaDB1060Platform';
595+
} else {
596+
$mariaDbPlatformClass = 'Doctrine\DBAL\Platforms\MariaDb1060Platform';
597+
}
598+
599+
if (class_exists($mariaDbPlatformClass)) {
594600
yield 'MariaDB106' => [
595-
new MariaDb1060Platform(),
601+
new $mariaDbPlatformClass(),
596602
'SELECT m.* FROM messenger_messages m WHERE (m.queue_name = ?) AND (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) ORDER BY available_at ASC LIMIT 1 FOR UPDATE SKIP LOCKED',
597603
];
598604
}

0 commit comments

Comments
 (0)