Skip to content

Commit

Permalink
Merge pull request #127 from andrew-demb/accurate-check-apcu
Browse files Browse the repository at this point in the history
Reuse more accurate check for APCu availability
  • Loading branch information
mistraloz authored Jun 2, 2022
2 parents 30b688e + bbb4dbf commit 3ae908c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DependencyInjection/GraphQLiteCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ private function getAnnotationReader(): AnnotationReader

$doctrineAnnotationReader = new DoctrineAnnotationReader();

if (function_exists('apcu_fetch')) {
if (ApcuAdapter::isSupported()) {
$doctrineAnnotationReader = new PsrCachedReader($doctrineAnnotationReader, new ApcuAdapter('graphqlite'), true);
}

Expand All @@ -432,7 +432,7 @@ private function getAnnotationReader(): AnnotationReader
private function getPsr16Cache(): CacheInterface
{
if ($this->cache === null) {
if (function_exists('apcu_fetch')) {
if (ApcuAdapter::isSupported()) {
$this->cache = new Psr16Cache(new ApcuAdapter('graphqlite_bundle'));
} else {
$this->cache = new Psr16Cache(new PhpFilesAdapter('graphqlite_bundle', 0, $this->cacheDir));
Expand Down

0 comments on commit 3ae908c

Please sign in to comment.