diff --git a/source/Internal/Framework/Cache/Pool/FilesystemCacheItemPoolFactory.php b/source/Internal/Framework/Cache/Adapter/FilesystemTagAwareAdapterFactory.php similarity index 80% rename from source/Internal/Framework/Cache/Pool/FilesystemCacheItemPoolFactory.php rename to source/Internal/Framework/Cache/Adapter/FilesystemTagAwareAdapterFactory.php index 804fc1ec2f..eafd564f06 100644 --- a/source/Internal/Framework/Cache/Pool/FilesystemCacheItemPoolFactory.php +++ b/source/Internal/Framework/Cache/Adapter/FilesystemTagAwareAdapterFactory.php @@ -7,14 +7,14 @@ declare(strict_types=1); -namespace OxidEsales\EshopCommunity\Internal\Framework\Cache\Pool; +namespace OxidEsales\EshopCommunity\Internal\Framework\Cache\Adapter; use OxidEsales\EshopCommunity\Internal\Transition\Utility\ContextInterface; use Symfony\Component\Cache\Adapter\FilesystemTagAwareAdapter; use Symfony\Component\Cache\Adapter\TagAwareAdapterInterface; use Symfony\Component\Filesystem\Path; -class FilesystemCacheItemPoolFactory implements CacheItemPoolFactoryInterface +class FilesystemTagAwareAdapterFactory implements TagAwareAdapterFactoryInterface { public function __construct(private readonly ContextInterface $context) { @@ -24,7 +24,7 @@ public function create(int $shopId): TagAwareAdapterInterface { return new FilesystemTagAwareAdapter( namespace: "cache_items_shop_$shopId", - directory: Path::join($this->context->getCacheDirectory(), 'pool') + directory: Path::join($this->context->getCacheDirectory(), 'adapter') ); } } diff --git a/source/Internal/Framework/Cache/Adapter/TagAwareAdapterFactoryInterface.php b/source/Internal/Framework/Cache/Adapter/TagAwareAdapterFactoryInterface.php new file mode 100644 index 0000000000..8bc411db78 --- /dev/null +++ b/source/Internal/Framework/Cache/Adapter/TagAwareAdapterFactoryInterface.php @@ -0,0 +1,15 @@ +shopAdapter->invalidateModulesCache(); $this->templateCacheService->invalidateCache($shopId); - $this->cacheItemPoolFactory->create($shopId)->clear(); + $this->tagAwareAdapterFactory->create($shopId)->clear(); } public function clearAll(): void @@ -36,7 +36,7 @@ public function clearAll(): void $this->shopAdapter->invalidateModulesCache(); $this->templateCacheService->invalidateAllShopsCache(); foreach ($this->context->getAllShopIds() as $shopId) { - $this->cacheItemPoolFactory->create($shopId)->clear(); + $this->tagAwareAdapterFactory->create($shopId)->clear(); } } } diff --git a/source/Internal/Framework/Cache/services.yaml b/source/Internal/Framework/Cache/services.yaml index f364560720..c143db591b 100644 --- a/source/Internal/Framework/Cache/services.yaml +++ b/source/Internal/Framework/Cache/services.yaml @@ -1,5 +1,5 @@ imports: - - { resource: Pool/services.yaml } + - { resource: Adapter/services.yaml } - { resource: Command/services.yaml } services: