Airship\Engine\Cache\SharedMemory::set PHP Метод

set() публичный Метод

Set a cache entry
public set ( string $key, $value ) : boolean
$key string
$value
Результат boolean
    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);
    }