create a new key in a directory with auto generated id

@param string $dir
@param string $value
@param int $ttl
@param array $condition
@return array $body
554961
public function setWithInOrderKey($dir, $value, $ttl = 0, $condition = array())
    {
        $data = array('value' => $value);

        if ($ttl) {
            $data['ttl'] = $ttl;
        }

        $request = $this->guzzleclient->post($this->buildKeyUri($dir), null, $data, array(
            'query' => $condition
        ));
        $response = $request->send();
        $body = $response->json();
        return $body;
    }
313465
public function set($key, $value, $ttl = 0)
    {
        $this->insertToDatabase($key, $value, $ttl);
        $this->setChain($key, $value, $ttl);

        return $this;
    }
242514
public function set($key, $value, $ttl)
    {
        $file = array(
            'key'   => $key,
            'value' => serialize($value),
            'ttl'   => $ttl,
            'ctime' => time(),
        );

        if ($this->isSafe() && !empty($key)) {
            return (bool) file_put_contents($this->getFilename($key), serialize($file));
        }

        return false;
    }
573200
public function append($key, $value, $ttl = null)
	{
	    return $this->_set($key, $value, $ttl, true);
	}
84294
public function set($key, $value, $ttl = null)
    {
        if ($this->enabled()) {
            return $this->cache->save($key, $value, [NetteCache::EXPIRE => $this->makeExpiration($ttl)]);
        }

        return $value;
    }
1345134
public function createNotExists($id, $value, $ttl = null)
    {
        return $this->create($id, $value, $ttl, false);
    }
1069616
public function set($key, $value, $ttl)
    {
        if ($this->safe) {
            return $this->memcache->set($key, $value, false, $ttl);
        }

        return false;
    }
897210
public function set($key, $value, $ttl = null)
    {
        return $this->{$this->adapter}->set($this->keyPrefix . $key, $value, $ttl);
    }
309292
public function store($key, $value, $ttl = self::DEFAULT_TTL) {
        $this->storage[$key]      =   array('value' => $value, 'expires' => ($ttl) ? time() + $ttl : 0);
        return $value;
    }
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;
    }
699245
public function set($key, $value, $ttl = null, $condition = array())
    {
        $data = array('value' => $value);

        if ($ttl) {
            $data['ttl'] = $ttl;
        }

        try {
            $response = $this->guzzleclient->put($this->buildKeyUri($key), array(
                'query' => $condition,
                'form_params' => $data
            ));
        } catch (BadResponseException $e) {
            $response = $e->getResponse();
        }
        $body = json_decode($response->getBody(), true);
        if (JSON_ERROR_NONE !== json_last_error()) {
            throw new RuntimeException('Unable to parse response body into JSON: ' . json_last_error());
        }
        return $body;
    }
1326507
public function append($key, $value, $ttl=null)
    {
        return $this->getStorage()->append($key, $value, $ttl);
    }
1146651
public function set(string $key, $value, int $ttl = null)
    {
        if ($value === null) {
            $this->delete($key);
            return;
        }

        if ($ttl !== null && $ttl <= 0) {
            throw new \Error("The time-to-live must be a positive integer or null");
        }

        $struct = new class {
            use Struct;
            public $data;
            public $expire = 0;
            public $ttl;
        };

        $struct->data = $value;

        if ($ttl !== null) {
            $struct->ttl = $ttl;
            $struct->expire = \time() + $ttl;
            $this->queue->insert([$key, $struct->expire], -$struct->expire);

            Loop::enable($this->timer);
        }

        $this->data[$key] = $struct;
    }
526438
public function update($key, $value, $ttl = 0, $condition = [])
    {
        $extra = ['prevExist' => 'true'];

        if ($condition) {
            $extra = array_merge($extra, $condition);
        }

        return $this->set($key, $value, $ttl, $extra);
    }
173202
public function do_set($key, $value, $ttl)
    {
        $redis = is_object($this->_redis) ? $this->_redis : $this->_getRedis();
        $redis->set($this->_prefix . $key, $value, $ttl);
    }
1192925
public function set($key, $value, $ttl = 2592000)
    {
        if (!self::$instance) {
            self::getInstance();
        }
        $res = self::$Memcache->set(CFG_DOMAIN . $key, $value, MEMCACHE_COMPRESSED, $ttl);

        return $res;
    }
1208366
public function set($key, $value, $ttl = null)
    {
        if ($ttl) {
            $ttl = $ttl->getTimestamp() - (new \DateTime('now', new \DateTimeZone('UTC')))->getTimestamp();
            $this->getRedis()->setex($key, $ttl, $value);
        } else {
            $this->getRedis()->set($key, $value);
        }

        return $this;
    }