Skip to content

Update GraphqliteCompilserPass to use Symfony cache #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion DependencyInjection/GraphqliteCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down