@param string $key
@param mixed $value
@param int $expiration

@return \chilimatic\lib\Cache\Engine\Cache|null $instance
761904
public static function set(string $key, $value = null, int $expiration = 0): ?Cache
    {
        if (!self::$instance) {
            return null;
        }

        self::$instance->engine->set($key, $value, $expiration);

        return self::$instance;
    }
1267851
public function set($name, $value, $expire) {
        if (is_null($expire)) {
            $expire = $this->options['expire'];
        }
        $filename = $this->setCacheKey($name);

        $data = serialize($value);
        $data = "<?php\n//" . sprintf('%012d', $expire) . $data . "\n?>";
        file_put_contents($filename, $data);
    }
315246
public function set($key,$value,$expired){
		if(DEBUG_MODE){
			BDebug::message('[Memcached]: Set key('.$key.')');
			}
		$mc=$this->getMemcached();
		if(empty($mc))return false;
		$this->queries_set_count++;
		return $mc->set($key,$value,$expired);
		}
586689
public function add($key, $value, $expiration = 0)
    {
        return $this->memcached ? $this->memcached->add($key, $value, $expiration) : false;
    }
1145340
public function setWithExpire($key, $value, $expire)
    {
        if (setcookie($key, $value, time() + $expire, '/', '', false, true)) {
            return true;
        }
        return false;
    }
489211
public function expireAfter($key, $expire = 0)
    {
        $val = $this->mem->get($key);

        if (isset($val)) {
            return $this->set($key, $val, $expire);
        }

        return false;
    }
833157
public function set($key, $value, int $expire = 30) : Cookies
    {
        setcookie($key, $value, time() + $expire);

        return $this;
    }
628150
public function store($key, $value = null, $expiration = 0)
    {
        return $this->set($key, $value, ($expiration ? $expiration : null));
    }
1168384
private function storeValueInCache($key, $value, $expiration = null)
    {
        $this->cache[$key] = new MemcacheObject($key, serialize($value), $this->normalizeExpirationTime($expiration));
    }
1047709
public function update($key, $value, $expire = 0)
    {
        if ($this->type === 1) {
            return $this->memcache->replace($key, $value, $expire);
        } else {
            return $this->memcache->replace($this->conf['prefix'] . $key, json_encode($value, JSON_UNESCAPED_UNICODE), false, $expire);
        }

    }
594413
function set($key, $value, $expire = 0)
    {
        // 如果是对象，需要进行序列号存储
        if (is_array($value) || is_object($value)) {
            $value = serialize($value);
        }

        if ($expire > 0) {
            return $this->connection->setex($key, $expire, $value);
        } else {
            return $this->connection->set($key, $value);
        }
    }
687397
private function setCache(
        string $key, $value, ?int $expires
    ): void {
        $cache = $this->client->getItem($key);
        $cache->set($value);
        $cache->expiresAfter($expires);
        $this->client->save($cache);
    }
224755
public function update($key, $value, $expire = 0)
    {
        $arr = $this->get($key);
        if (!empty($arr)) {
            $arr = array_merge($arr, $value);
            return $this->set($key, $arr, $expire);
        }
        return 0;
    }
1309714
protected function setValue($key, $value, $expiration = 0, $serializer = self::REDIS_SERIALIZER_NONE)
    {
        if (self::REDIS_SERIALIZER_PHP === $serializer) {
            $value = serialize($value);
        }

        return $this->redis->setex($key, $expiration, $value);
    }
1308219
public function set($key, $value, $expire = 600) {
        $this->redis->setex($this->formatKey($key), $expire, $this->formatValue($value));
    }
667477
public function set($key,$value,$expired){
		$mc=$this->getMemcache();
		if(empty($mc))return false;
		$this->queries_set_count++;
		return $mc->set($key,$value,false,$expired);
		}
683428
private function setItem($key, $value, $time, $expire)
    {
        $cache_file = $this->createCacheFile($key);
        if ($cache_file === false) {
            return false;
        }

        $cache_data = array('data' => $value, 'time' => $time, 'expire' => $expire);
        $cache_data = json_encode($cache_data);

        $put_result = file_put_contents($cache_file, $cache_data);
        if ($put_result === false) {
            return false;
        }

        return true;
    }