Skip to content

Commit 470b00f

Browse files
aragon999schneider-felix
authored andcommitted
fix: Skip sql_set_default_session_variables for Shopware >= 6.7
1 parent 7e26db3 commit 470b00f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/Components/Health/Checker/PerformanceChecker/MysqlSettingsChecker.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Frosh\Tools\Components\Health\HealthCollection;
1010
use Frosh\Tools\Components\Health\SettingsResult;
1111
use Shopware\Core\DevOps\Environment\EnvironmentHelper;
12+
use Symfony\Component\DependencyInjection\Attribute\Autowire;
1213

1314
class MysqlSettingsChecker implements PerformanceCheckerInterface, CheckerInterface
1415
{
@@ -23,8 +24,11 @@ class MysqlSettingsChecker implements PerformanceCheckerInterface, CheckerInterf
2324
'UTC',
2425
];
2526

26-
public function __construct(private readonly Connection $connection)
27-
{
27+
public function __construct(
28+
private readonly Connection $connection,
29+
#[Autowire(param: 'kernel.shopware_version')]
30+
private readonly string $shopwareVersion,
31+
) {
2832
}
2933

3034
public function collect(HealthCollection $collection): void
@@ -86,6 +90,11 @@ private function checkTimeZone(HealthCollection $collection): void
8690

8791
private function checkCheckDefaultEnvironmentSessionVariables(HealthCollection $collection): void
8892
{
93+
// https://github.com/shopware/shopware/commit/c0a162f11852130b34e7c725bd7429aeb89a7b75
94+
if (\version_compare($this->shopwareVersion, '6.7.0', '>=')) {
95+
return;
96+
}
97+
8998
$setSessionVariables = (bool) EnvironmentHelper::getVariable('SQL_SET_DEFAULT_SESSION_VARIABLES', true);
9099
if ($setSessionVariables) {
91100
$collection->add(

0 commit comments

Comments
 (0)