File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,11 +117,12 @@ services:
117117 OxidEsales\GraphQL\Base\Event\Subscriber\BeforeTokenCreationSubscriber :
118118 tags : [ 'kernel.event_subscriber' ]
119119
120+ OxidEsales\GraphQL\Base\Framework\FilesystemAdapterFactory :
121+ class : OxidEsales\GraphQL\Base\Framework\FilesystemAdapterFactory
122+
120123 oxidesales.graphqlbase.cacheadapter :
121124 class : Symfony\Component\Cache\Adapter\FilesystemAdapter
122- arguments :
123- $namespace : ' oe_graphql_base-schema'
124- $directory : ' @=service("OxidEsales\\EshopCommunity\\Internal\\Transition\\Utility\\ContextInterface").getCacheDirectory()'
125+ factory : ['@OxidEsales\GraphQL\Base\Framework\FilesystemAdapterFactory', 'create']
125126
126127 oxidesales.graphqlbase.cache :
127128 class : Symfony\Component\Cache\Psr16Cache
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * Copyright © OXID eSales AG. All rights reserved.
5+ * See LICENSE file for license details.
6+ */
7+
8+ declare (strict_types=1 );
9+
10+ namespace OxidEsales \GraphQL \Base \Framework ;
11+
12+ use OxidEsales \EshopCommunity \Internal \Transition \Utility \ContextInterface ;
13+ use Symfony \Component \Cache \Adapter \FilesystemAdapter ;
14+ use Symfony \Component \Filesystem \Path ;
15+
16+ readonly class FilesystemAdapterFactory
17+ {
18+ public function __construct (private ContextInterface $ context )
19+ {
20+ }
21+
22+ /** @SuppressWarnings(PHPMD.StaticAccess) */
23+ public function create (): FilesystemAdapter
24+ {
25+ $ path = Path::join (
26+ $ this ->context ->getCacheDirectory (),
27+ 'oe_graphql_base-schema ' ,
28+ (string )$ this ->context ->getCurrentShopId ()
29+ );
30+ return new FilesystemAdapter (directory: $ path );
31+ }
32+ }
You can’t perform that action at this time.
0 commit comments