think\cache\driver\Memcached::set PHP Method

set() public method

写入缓存
public set ( string $name, mixed $value, integer $expire = null ) : boolean
$name string 缓存变量名
$value mixed 存储数据
$expire integer 有效时间(秒)
return boolean
    public function set($name, $value, $expire = null)
    {
        if (is_null($expire)) {
            $expire = $this->options['expire'];
        }
        if ($this->tag && !$this->has($name)) {
            $first = true;
        }
        $key = $this->getCacheKey($name);
        $expire = 0 == $expire ? 0 : $_SERVER['REQUEST_TIME'] + $expire;
        if ($this->handler->set($key, $value, $expire)) {
            isset($first) && $this->setTagItem($key);
            return true;
        }
        return false;
    }