Similar to setxx
@param $id
@param $value
@param null $ttl
@return bool
424608
public function createExists($id, $value, $ttl = null)
    {
        return $this->create($id, $value, $ttl, true);
    }
1105002
public function set($key, $value, $ttl)
    {
        if ($value === false) {
            throw new InvalidValueException(['`:key` key cache value can not `false` bool value', 'key' => $key]);
        } elseif (is_scalar($value) || $value === null) {
            if (is_string($value) && $value !== '' && $value[0] !== '{' && $value[0] !== '[') {
                $data = $value;
            } else {
                $data = json_encode(['_wrapper_' => $value], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
            }
        } elseif (is_array($value) && isset($value['_wrapper_'])) {
            $data = json_encode(['_wrapper_' => $value], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
        } else {
            $data = json_encode($value, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
        }

        if ($data === false) {
            throw new InvalidValueException([
                '`:key` key cache value json_encode failed: `:code` `:message`',
                'key' => $key,
                'code' => json_last_error(),
                'message' => json_last_error_msg()
            ]);
        }

        $this->do_set($key, $data, $ttl);
    }
141021
public function store($key, $value, $ttl = self::DEFAULT_TTL) {
        apc_store($key, $value, (int) $ttl);
        return $value;
    }
897210
public function set($key, $value, $ttl = null)
    {
        return $this->{$this->adapter}->set($this->keyPrefix . $key, $value, $ttl);
    }
884839
public function set($key, $value, $ttl = null, array $tags = []): bool
    {
        return $this->setMultiple([$key => $value], $ttl, $tags);
    }
458834
public function setItem(string $key, $value, $ttl = 0): bool
    {
        if (
            !$this->adapter instanceof iAdapter
            ||
            !$this->serializer instanceof iSerializer
        ) {
            return false;
        }

        $storeKey = $this->calculateStoreKey($key);
        $serialized = $this->serializer->serialize($value);

        // update static-cache, if it's exists
        if (\array_key_exists($storeKey, self::$STATIC_CACHE)) {
            self::$STATIC_CACHE[$storeKey] = $value;
        }

        if ($ttl) {
            if ($ttl instanceof \DateInterval) {
                // Converting to a TTL in seconds
                /** @noinspection PhpUnhandledExceptionInspection */
                $ttl = (new \DateTimeImmutable('now'))->add($ttl)->getTimestamp() - \time();
            }

            // always cache the TTL time, maybe we need this later ...
            self::$STATIC_CACHE_EXPIRE[$storeKey] = ($ttl ? (int) $ttl + \time() : 0);

            return $this->adapter->setExpired($storeKey, $serialized, $ttl);
        }

        return $this->adapter->set($storeKey, $serialized);
    }
1206537
public function set($key, $val, $ttl = null)
    {
        $this->throwInvalidStringArgumentException($key);

        $this->cache[$key] = $val;

        return true;
    }
1121168
public function set($key, $value, $ttl = null)
    {
        $item = new Item($key, $value);
        if ($ttl !== null) {
            $item->expiresAfter($ttl);
        }
        return $this->save($item);
    }
929287
public function set($key, $value, $ttl)
    {
        $curlHandler = $this->curlHandler($key . '?ttl=' . $ttl . 's');

        \curl_setopt($curlHandler, CURLOPT_RETURNTRANSFER, true);
        \curl_setopt($curlHandler, CURLOPT_POST, true);
        \curl_setopt($curlHandler, CURLOPT_POSTFIELDS, $value);

        $response = \curl_exec($curlHandler);
        \curl_close($curlHandler);
        return $response;
    }
814053
public function set($key, $value, $ttl = 0)
    {
        $this->cache[$key] = new Item($value);
        return true;
    }
298430
public function set($key, $value, $ttl = 0)
    {
        $key = $this->salted($key, $this->suffix);

        // handle deletions
        if ($value === null) {
            $this->cache->delete($key);
            return true;
        }

        // Resolve the TTL to use
        $ttl = $this->determineTTL($ttl);

        $this->cache->set($key, $value, $ttl);
        $code = $this->cache->getResultCode();

        if ($code === Memcached::RES_SUCCESS) {
            return true;
        }

        $this->sendAlert('set', $key, $code);
        return false;
    }
621782
public function set($key, $value, $ttl = null)
    {
        $this->values[$key] = [];

        $this->values[$key][static::VALUE] = $value;
        $this->values[$key][static::TTL] = $ttl;
        $this->values[$key][static::CREATE_TIME] = time();

        return true;
    }
1074948
public function write($key, $value, $ttl = 0)
    {
        $this->redis->set($this->prefix . $key, is_numeric($value) ? $value : serialize($value));
        if ($ttl != 0) {
            $this->redis->expire($this->prefix . $key, $ttl);
        }
        return true;
    }
677625
public function write($key, $value, $ttl = 0)
    {
        $ttl = ((int) $ttl <= 0) ? 0 : ((int) $ttl + time());

        try {
            $this->delete($key);

            return $this->db
                    ->insert(array(
                        $this->columns['key'] => $this->prefix . $key,
                        $this->columns['data'] => serialize($value),
                        $this->columns['ttl'] => $ttl,
                    ))
                    ->into($this->table);
        } catch (PDOException $e) {
            return false;
        }
    }
1268037
public function set($key, $value, $ttl)
    {
        if (!$this->safe) {
            return false;
        }

        return apc_store($key, $value, $ttl);
    }
24433
public function set($name, $value, $ttl = 86400 /* 1 day */, $path = '/', $domain = '', $secure = false, $http_only = false) {
        $this->_cookies[$name] = $value;
        $result = \setcookie($name, $value, time() + $ttl, $path, $domain, $secure, $http_only);

        if (isset($this->_deleted_cookies[$name])) {
            unset($this->_deleted_cookies[$name]);
        }

        return $result;
    }
904949
public function set($id, $value = null)
    {
        if ($this->locked) {
            return false;
        }

        if (is_array($id)) {
            foreach ($id as $k => $v) {
                $this->set($k, $v);
            }
        } elseif (is_string($id)) {
            return $this->setItem($id, $value);
        } else {
            return false;
        }
    }