$isRelay =
$redis instanceof Relay;
if ($isRelay || \
defined('Redis::OPT_COMPRESSION'
) && \
in_array($redis::
class,
[\Redis::
class, \RedisArray::
class, \RedisCluster::
class], true
)) { $compression =
$redis->
getOption($isRelay ? Relay::OPT_COMPRESSION : \Redis::OPT_COMPRESSION
);
foreach (\
is_array($compression) ?
$compression :
[$compression] as $c) { if ($isRelay ? Relay::COMPRESSION_NONE : \Redis::COMPRESSION_NONE !==
$c) { throw new InvalidArgumentException(sprintf('redis compression must be disabled when using "%s", use "%s" instead.',
static::
class, DeflateMarshaller::
class));
} } } $this->
init($redis,
$namespace,
$defaultLifetime,
new TagAwareMarshaller($marshaller));
$this->namespace =
$namespace;
} protected function doSave(array
$values, int
$lifetime, array
$addTagData =
[], array
$delTagData =
[]): array
{ $eviction =
$this->
getRedisEvictionPolicy();
if ('noeviction' !==
$eviction && !
str_starts_with($eviction, 'volatile-'
)) { throw new LogicException(sprintf('Redis maxmemory-policy setting "%s" is *not* supported by RedisTagAwareAdapter, use "noeviction" or "volatile-*" eviction policies.',
$eviction));
} // serialize values