Merge pull request #6672 from andrewandante/FIX/apcu-cache-error

FIX/apcu cache errors
This commit is contained in:
Damian Mooyman 2017-03-03 15:37:50 +13:00 committed by GitHub
commit 58f336928a

View File

@ -63,17 +63,16 @@ class DefaultCacheFactory implements CacheFactory
} }
if ($phpFilesSupported) { if ($phpFilesSupported) {
$opcache = Injector::inst()->create(PhpFilesCache::class, false, [$namespace, $defaultLifetime, $directory]); $opcache = Injector::inst()->create(PhpFilesCache::class, $namespace, $defaultLifetime, $directory);
return $opcache; return $opcache;
} }
$fs = Injector::inst()->create(FilesystemCache::class, false, [$namespace, $defaultLifetime, $directory]); $fs = Injector::inst()->create(FilesystemCache::class, $namespace, $defaultLifetime, $directory);
if (!$apcuSupported) { if (!$apcuSupported) {
return $fs; return $fs;
} }
$apcu = Injector::inst()->create(ApcuCache::class, $namespace, (int) $defaultLifetime / 5, $version);
$apcu = Injector::inst()->create(ApcuCache::class, false, [$namespace, (int) $defaultLifetime / 5, $version]); return Injector::inst()->create(ChainCache::class, [$apcu, $fs]);
return Injector::inst()->create(ChainCache::class, false, [[$apcu, $fs]]);
} }
} }