mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fix for APCu cache otherwise you get 'Cache key must be string, "boolean" given'
Also corrects parameter variable name
This commit is contained in:
parent
53cad18fd7
commit
263e747d07
@ -44,7 +44,7 @@ class DefaultCacheFactory implements CacheFactory
|
|||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
public function create($service, array $params = array())
|
public function create($service, array $args = array())
|
||||||
{
|
{
|
||||||
$namespace = (isset($args['namespace'])) ? $args['namespace'] : '';
|
$namespace = (isset($args['namespace'])) ? $args['namespace'] : '';
|
||||||
$defaultLifetime = (isset($args['defaultLifetime'])) ? $args['defaultLifetime'] : 0;
|
$defaultLifetime = (isset($args['defaultLifetime'])) ? $args['defaultLifetime'] : 0;
|
||||||
@ -71,9 +71,8 @@ class DefaultCacheFactory implements CacheFactory
|
|||||||
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]]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user