获取上传凭证
@param string|null $bucket
@param string|null $key
@param int $expires
@param array|null $policy
@return mixed
434211
public function uploadToken(
        $bucket = null,
        $key = null,
        $expires = 3600,
        $policy = null)
    {
        // 默认使用当前配置的bucket
        if ($bucket === null) {
            $bucket = $this->bucket;
        }
        return $this->auth->uploadToken(
            $bucket,
            $key,
            $expires,
            $policy,
            true
        );
    }
1208476
public function uploadByUrl($url, $key = null, $bucket = '')
    {
        $filePath = tempnam(sys_get_temp_dir(), 'QN');
        copy($url, $filePath);
        $result = $this->uploadFile($filePath, $key, $bucket);
        unlink($filePath);
        return $result;
    }
313601
public function set($key, $value, $expire = 0)
    {
        ($expire == 0) && $expire = null;
        return apc_store($this->conf['prefix'] . $key, $value, $expire);
    }
260179
public function batchChangeType($bucket, $keys, $type){
        if(!in_array($type, [0, 1])){
            return $this->error('文件存储类型错误', ['errorCode'=>-1]);
        }
        $keyTypePairs = array();
        foreach ($keys as $key) {
            $keyTypePairs[$key] = 1;
        }
        $ops = $this->bucketManager->buildBatchChangeType($bucket, $keyTypePairs);
        list($ret, $err) = $this->bucketManager->batch($ops);
        if($err){
            return $this->error($err->message(), ['errorCode'=>$err->code()]);
        }
        return $this->success('操作成功', $ret);
    }
111151
public function add($key, $value, $expiration = null)
    {

        return $this->set($key, $value, $expiration);
    }
808528
public function doesObjectExist($bucket, $key, array $params = [])
    {
        return $this->instance->doesObjectExist($bucket, $key, $params);
    }
1282990
public function getObjectUrl($key, $expires = null)
	{
		return $this->s3Client->getObjectUrl($this->getBucket(), $key, $expires);
	}
619639
public function fetch($bucket, $url, $key = null){
        list($ret, $err) = $this->bucketManager->fetch($url, $bucket, $key);
        if($err){
            return $this->error($err->message(), ['errorCode'=>$err->code()]);
        }
        return $this->success('操作成功', $ret);
    }
508987
public function prefetch($bucket, $key){
        $err = $this->bucketManager->prefetch($bucket, $key);
        if($err){
            return $this->error($err->message(), ['errorCode'=>$err->code()]);
        }
        return $this->success('操作成功');
    }
42730
public function set($key, $value, $expire = null)
    {
        return $this->_master()->set($key, json_encode($value), $expire);
    }
25207
public function set($key, $val, $expire = 0)
    {
        return $this->mem->set($key, $val, $expire);
    }
941800
public function doSet(string $key, $data, int $expire = self::EXPIRE): bool
    {
        //我们不关注返回值
        Redis::string(self::PREFIX . $key, json($data),  $expire);
        return true;
    }
1028145
protected function rememberEverythingWithKey(string $key, $value, int $expire = null) {
		return ($content = $this->driver->get($key)) !== false ? $this->unserialize($content) :
			($this->set($key, $value, $expire) ? $this->get($key) : null);
	}
1161893
public function set(string $field, string $key, $data, int $expire = self::EXPIRE): bool
    {
        // 缓存数据
        $this->doSet($key, $data, $expire);

        //记录调试信息
        self::debugSet($field . ':' . $key, $data);

        // 取出此表已经缓存的所有键
        $keys = $this->get(self::PREFIX_FIELD . $field);
        if (!$keys or $keys == CacheFactory::NOT_FOUND) {
            $keys = [];
        }

        // 增加一个键,并保存回去,以便以后统一清除
        $keys[] = $key;
        return $this->doSet(self::PREFIX_FIELD . $field, $keys, $expire);
    }
1367166
public function storageLogin($key, $data, $expire = 0)
    {
        $key = $this->getKey($key);
        Session::set($key, $data);
    }
1292657
public function batchDelete($bucket, $keys){
        $ops = $this->bucketManager->buildBatchDelete($bucket, $keys);
        list($ret, $err) = $this->bucketManager->batch($ops);
        if($err){
            return $this->error($err->message(), ['errorCode'=>$err->code()]);
        }
        return $this->success('操作成功', $ret);
    }
11963
public function expire($key, $seconds) {
        return $this->getHandler($this->judge(__FUNCTION__))->expire($key, $seconds);
    }