Skip to content

Commit bbb4dbf

Browse files
committed
Reuse more accurate check for APCu availability
1 parent b7682aa commit bbb4dbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

DependencyInjection/GraphQLiteCompilerPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ private function getAnnotationReader(): AnnotationReader
416416

417417
$doctrineAnnotationReader = new DoctrineAnnotationReader();
418418

419-
if (function_exists('apcu_fetch')) {
419+
if (ApcuAdapter::isSupported()) {
420420
$doctrineAnnotationReader = new PsrCachedReader($doctrineAnnotationReader, new ApcuAdapter('graphqlite'), true);
421421
}
422422

@@ -433,7 +433,7 @@ private function getAnnotationReader(): AnnotationReader
433433
private function getPsr16Cache(): CacheInterface
434434
{
435435
if ($this->cache === null) {
436-
if (function_exists('apcu_fetch')) {
436+
if (ApcuAdapter::isSupported()) {
437437
$this->cache = new Psr16Cache(new ApcuAdapter('graphqlite_bundle'));
438438
} else {
439439
$this->cache = new Psr16Cache(new PhpFilesAdapter('graphqlite_bundle', 0, $this->cacheDir));

0 commit comments

Comments
 (0)