@param string $key
@param string $value
@param int    $ttl

@return void
194925
public function do_set($key, $value, $ttl)
    {
        /** @var \ManaPHP\DbInterface $db */
        $db = $this->_di->getShared($this->_db);

        $hash = md5($key);

        if ($db->query($this->_source)->whereEq('hash', $hash)->exists()) {
            $db->update($this->_source, ['value' => $value, 'ttl' => $ttl, 'expired_time' => time() + $ttl], ['hash' => $hash]);
        } else {
            $db->insert($this->_source, ['hash' => $hash, 'key' => $key, 'value' => $value, 'ttl' => $ttl, 'expired_time' => time() + $ttl]);
        }
    }
983718
public function set($key, $value, $ttl)
    {
        $filename = $this->_hash(array($key));

        return (bool) $this->_write($filename, $value, null, $ttl);
    }
1257091
public function set($key, $value, $ttl = null)
    {
        return $this->_instance->set($key, $value, $ttl);
    }
818596
protected function save($key, $value, $ttl) {
        $this->doctrineCacheInstance->save($key, $value, $ttl);
    }
66227
public function set($key, $value, $ttl = null)
    {
        $ttl = is_null($ttl) ? $this->ttl : $ttl;

        return $this->client->set($this->getKey($key), $value, $ttl);
    }
930714
protected function save($key, $value, $ttl) {
        try {
            $this->memcached->set($key, $value, $ttl);
        } catch (\Exception $e) {
            throw new StorageException("Failed to save memcached key: $key", 1, $e);
        }
    }
1033766
public function set($key, $value)
    {
        if ($this->ttl === null) {
            $this->client->set($key, $this->serializer->serialize($value));
        } else {
            $this->client->set($key, $this->serializer->serialize($value), 'ex', $this->ttl);
        }
    }
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;
    }
1124363
public function mk($key, $value, $ttl = 0)
    {
        $body = $request = $this->set(
            $key,
            $value,
            $ttl,
            array('prevExist' => 'false')
        );

        if (isset($body['errorCode'])) {
            throw new KeyExistsException($body['message'], $body['errorCode']);
        }

        return $body;
    }
387274
public function put($key, $value, $ttl = null)
    {
        if ($ttl === null) {
            return $this->forever($key, $value);
        }

        $this->pushStandardKeys($this->tags->getNamespace(), $key);

        return parent::put($key, $value, $ttl);
    }
2710
protected function doSet(string $key, $value, int $ttl = 0)
    {
        if ($ttl > 0) {
            $ttl = \time() + $ttl;
        }

        $filename = $this->getFilename($key);
        $content = '<?php /* ' . Serialize::encode([
                'value' => $value,
                'expire' => $ttl,
            ]) . ' */';

        return $this->storage->put($filename, $content);
    }
521794
public function set($entry, $value, $ttl = false)
    {
        $setCallback = function ($setSuccess, $cache) use ($entry, $value, $ttl) {
            return $setSuccess || $cache->set($entry, $value, $ttl);
        };
        return array_reduce($this->caches, $setCallback, false);
    }
69626
public function set($key, $value, $ttl = 0)
    {
        $key = (string)$key;
        $ttl = $this->fromDefaultTtl($ttl);

        if ($ttl >= 0) {
            $calculatedTtl = $this->getCalculatedTtl($ttl);

            self::$registry[$key] = [
                'value'   => $this->storageDataStructure($value),
                'expires' => new DateTime(\date('Y-m-d H:i:s', $calculatedTtl))
            ];
        }
        return $this;
    }
562982
public function set($key, $value, $ttl = 0)
    {
        $ttl = $this->fromDefaultTtl($ttl);

        if ($ttl >= 0) {
            $response = $this->curl->set($key, $this->storageDataStructure($value), $ttl);

            if (false !== $response) {
                $response = \json_decode($response, true);

                if (\array_key_exists('ok', $response) && true === $response['ok']) {
                    $this->setChain($key, $value, $ttl);
                }
            }
        }

        return $this;
    }
515579
public function saveItem($key, $value, $ttl = null)
    {
        $_SESSION['__CACHE__'][$key] = json_encode([
            'start' => time(),
            'ttl'   => ($ttl !== null) ? (int) $ttl : $this->ttl,
            'value' => $value,
        ]);

        return $this;
    }
782251
protected function pack($key, $value, $ttl = 0)
    {
        $content = array(
            'key' => $key,
            'time' => time(),
            'ttl' => $ttl,
            'value' => $value
        );

        return $content;
    }
1292307
public function set($key, array $nodes, $ttl)
    {
        $this->read();
        parent::set($key, $nodes, $ttl);

        return $this->write();
    }