예제 #1
0
파일: RedisData.php 프로젝트: ig-hit/redis
 /**
  * @param $key
  * @return array|mixed
  * @throws \Exception
  */
 public function get($key)
 {
     $type = $this->client->type($key);
     switch ($type) {
         case Redis::REDIS_STRING:
             $v = $this->getStringType()->get($key);
             $ret = $this->parseReply($v);
             return $ret;
         case Redis::REDIS_LIST:
             return $this->getListType()->get($key);
         case Redis::REDIS_SET:
             return $this->getSetType()->get($key);
         case Redis::REDIS_ZSET:
             return $this->getSortedSetType()->get($key);
         case Redis::REDIS_HASH:
             return $this->getHashType()->get($key);
         case Redis::REDIS_NOT_FOUND:
         default:
             return false;
     }
 }