From 1dc546b00223b46b9be52c4a9354e78f5e529f3b Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 10 Jun 2024 11:05:00 +0200 Subject: [PATCH] Add support for FosHttpCache 3.0 and FosHttpCacheBundle 3.0 (#7452) Add support for FosHttpCache 3.0 --- composer.json | 5 +++-- .../DependencyInjection/SuluHttpCacheExtension.php | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 3876a9a1009..ae4f35b420b 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,7 @@ "ext-dom": "*", "ext-json": "*", "ext-simplexml": "*", + "composer-runtime-api": "^2.0", "composer/package-versions-deprecated": "^1.8", "contao/imagine-svg": "^1.0", "doctrine/annotations": "^1.2 || ^2.0", @@ -44,8 +45,8 @@ "doctrine/phpcr-bundle": "^2.2 || ^3.0", "dragonmantank/cron-expression": "^1.1 || ^2.0 || ^3.0", "friendsofphp/proxy-manager-lts": "^1.0", - "friendsofsymfony/http-cache": "^2.10", - "friendsofsymfony/http-cache-bundle": "^2.10.1", + "friendsofsymfony/http-cache": "^2.10 || ^3.0", + "friendsofsymfony/http-cache-bundle": "^2.10.1 || ^3.0", "friendsofsymfony/jsrouting-bundle": "^2.7 || ^3.0", "friendsofsymfony/rest-bundle": "^3.1", "gedmo/doctrine-extensions": "^3.0.4", diff --git a/src/Sulu/Bundle/HttpCacheBundle/DependencyInjection/SuluHttpCacheExtension.php b/src/Sulu/Bundle/HttpCacheBundle/DependencyInjection/SuluHttpCacheExtension.php index b1f50cc502c..b8f87abc0f4 100644 --- a/src/Sulu/Bundle/HttpCacheBundle/DependencyInjection/SuluHttpCacheExtension.php +++ b/src/Sulu/Bundle/HttpCacheBundle/DependencyInjection/SuluHttpCacheExtension.php @@ -36,7 +36,9 @@ public function prepend(ContainerBuilder $container) ], ]; - if (!$container->hasExtension('sensio_framework_extra')) { + if (!$container->hasExtension('sensio_framework_extra') + && \version_compare(\Composer\InstalledVersions::getVersion('friendsofsymfony/http-cache-bundle') ?? '999.999.999', '3.0.0', '<') + ) { $fosHttpCacheConfig['tags'] = [ 'annotations' => [ 'enabled' => false,