Skip to content

Commit 7f7b8fe

Browse files
authored
Merge pull request #79 from MattBred/patch-2
Update GraphqliteCompilserPass to use Symfony cache
2 parents 23973f5 + 9f22eca commit 7f7b8fe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

DependencyInjection/GraphqliteCompilerPass.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,18 @@ class GraphqliteCompilerPass implements CompilerPassInterface
9191
*/
9292
private $annotationReader;
9393

94+
/**
95+
* @var string
96+
*/
97+
private $cacheDir;
98+
9499
/**
95100
* You can modify the container here before it is dumped to PHP code.
96101
*/
97102
public function process(ContainerBuilder $container): void
98103
{
99104
$reader = $this->getAnnotationReader();
105+
$this->cacheDir = $container->getParameter('kernel.cache_dir');
100106
//$inputTypeUtils = new InputTypeUtils($reader, $namingStrategy);
101107

102108
// 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
442448
if (function_exists('apcu_fetch')) {
443449
$this->cache = new Psr16Cache(new ApcuAdapter('graphqlite_bundle'));
444450
} else {
445-
$this->cache = new Psr16Cache(new PhpFilesAdapter('graphqlite_bundle'));
451+
$this->cache = new Psr16Cache(new PhpFilesAdapter('graphqlite_bundle', 0, $this->cacheDir));
446452
}
447453
}
448454
return $this->cache;

0 commit comments

Comments
 (0)