diff --git a/DependencyInjection/GraphqliteCompilerPass.php b/DependencyInjection/GraphqliteCompilerPass.php index 3d03c26..2e7ebdd 100644 --- a/DependencyInjection/GraphqliteCompilerPass.php +++ b/DependencyInjection/GraphqliteCompilerPass.php @@ -91,12 +91,18 @@ class GraphqliteCompilerPass implements CompilerPassInterface */ private $annotationReader; + /** + * @var string + */ + private $cacheDir; + /** * You can modify the container here before it is dumped to PHP code. */ public function process(ContainerBuilder $container): void { $reader = $this->getAnnotationReader(); + $this->cacheDir = $container->getParameter('kernel.cache_dir'); //$inputTypeUtils = new InputTypeUtils($reader, $namingStrategy); // Let's scan the whole container and tag the services that belong to the namespace we want to inspect. @@ -442,7 +448,7 @@ private function getPsr16Cache(): CacheInterface if (function_exists('apcu_fetch')) { $this->cache = new Psr16Cache(new ApcuAdapter('graphqlite_bundle')); } else { - $this->cache = new Psr16Cache(new PhpFilesAdapter('graphqlite_bundle')); + $this->cache = new Psr16Cache(new PhpFilesAdapter('graphqlite_bundle', 0, $this->cacheDir)); } } return $this->cache;