public function set(string $key, $value) : bool
{
// We will NOT use unserialize here.
$value = \json_encode($value);
if (!$value) {
return false;
}
if ($this->authKey) {
// We're authenticating this value:
$mac = Symmetric::authenticate($value, $this->authKey, true);
$value = $mac . $value;
}
$shmKey = $this->getSHMKey($key);
return \apcu_add($shmKey, $value);
}