获取缓存中的值，相当于 $this->getCache()->get()
@param  string $key
@param  string $cache_mode
@return mixed array|NULL
339012
public function cacheGet($key, $cache_mode = Cache::CACHE_AUTO)
    {
        if ($cache_mode === Cache::CACHE_FLUSH_ONLY ) {
            $this->getCache()->remove($key);
            return null;
        }
        
        return $this->getCache()->get($key);
    }
277783
public function getCachedFile($cacheKey) {

        // Get directory and filename
        list($directory, $filename) = $this->getDirectoryAndFilenameFromKey($cacheKey);

        if (file_exists($directory . "/" . $filename) && !is_dir($directory . "/" . $filename)) {
            return file_get_contents($directory . "/" . $filename);
        }

        return null;


    }
334359
public function get(&$cached) {
		if( static::$APCavailable ) {
			$fc = apc_fetch($this->key, $success);
		} else {
			$fc = false;
			$success = false;
		}
// 		$fc = static::$useAPCu ? apcu_fetch($this->key, $success) : apc_fetch($this->key, $success);
		if( $fc !== false ) {
			$cached = $fc;
		}
		return $success;
	}
972285
public function get($key)
    {
        if (!$this->requireProvider("Getting key " . $key)) return false;

        return $this->cacheProvider->get($key);
    }
4279
public function get($key = null, $cache_cb = null, &$cas_token = null)
    {

        if (isset($this->cacheListing [$key])) {
            return parent::get($key, $cache_cb, $cas_token);
        }

        return false;
    }
31545
public function get($key){
		$mc=$this->getMemcache();
		if(empty($mc))return NULL;
		$this->queries_get_count++;
		return $mc->get($key);
		}
772879
public function get($key, $default_value = null)
        {
            if (!$this->enabled) return $default_value;

            switch ($this->type) {
                case self::TYPE_APC:
                    $success = false;
                    $var = apc_fetch($key, $success);

                    return ($success) ? $var : $default_value;
                case self::TYPE_FILE:
                    $filename = $this->path . $key . '.cache';
                    if (!file_exists($filename)) return $default_value;

                    $value = unserialize(file_get_contents($filename));
                    return $value;
                case self::TYPE_DUMMY:
                default:
                    return $default_value;
            }
        }
852603
public function get($cacheKey)
    {
        // TODO: Refactor for strict types!
        $path = $this->resolvePath($cacheKey, false);
        if (file_exists($path)) {
            return file_get_contents($path);
        }

        return null;
    }
297813
public function get(string $key)
    {
        $key = $this->hashKey($key);
        if (\array_key_exists($key, $this->cache)) {
            $this->hits++;
            return $this->cache[$key];
        }
        $this->misses++;
        return null;
    }
273606
public function get( $key )
    {
        $cache_file = new File($key.self::CACHE_FILE_EXT, $this->config->getCacheRoot());
    
        if (!$cache_file->exists()){
            return false;
        }
        if (!$cache_file->canRead()){
            throw( new CacheFileNotReadableException($cache_file) );
        }
        
        $lines = $cache_file->getContentsAsArray();
        
        static $keywords = [
            'expires', 'type', 'class', 'data'
        ];
        
        $cache_info =[];
        foreach($keywords as $keyword)
        {
            $line = array_shift($lines);
            $kwlen = strlen($keyword);
            
            if (!$line){
                throw( new CacheFileFormatException($cache_file) );
            }
            if (strlen($line) < $kwlen+1 || strpos($line,$keyword.':') !== 0){
                throw( new CacheFileFormatException($cache_file) );
            }
            $cache_info[$keyword] = substr($line,$kwlen+1);
        }
    
        // check expire date
        $expires = $cache_info['expires'] ? intval($cache_info['expires']) : null;
        if ($expires === null){
            throw( new CacheMetaDataException('expires',$expires) );
        }
        $now = time();
        if ($expires > 0 && $expires < $now){
            return null;
        }
        
        // decode data
        $data = $cache_info['data'] ?? null;
        if ($data === null){
            throw( new CacheMetaDataException('data',$data) );
        }
        $data = unserialize(base64_decode($data));
    
        // type check
        $type = $cache_info['type'] ?? null;
        if ($type === null){
            throw( new CacheMetaDataException('type',$type) );
        }
        if ($type !== gettype($data)){
            return null;
        }
    
        // class check
        if ($type === 'object'){
            $class = $cache_info['class'] ?? null;
            if ($class === null){
                throw( new CacheMetaDataException('class',$class) );
            }
            if (!($data instanceof $class)){
                return null;
            }
        }
    
        return $data;
    }
696997
function _get(key){
	var ret = null;

	// Pull from cache or re-read from fs.
	//console.log('key: ' + key)
	//console.log('use_zcache_p: ' + use_zcache_p)
	if( use_zcache_p ){
	    ret = zcache[key];
	}else{
	    ret = afs.read_file(path_cache[key]);
	}

	return ret;
    }
558963
public static function findByCache($key, $array = true, $forceDb = false) {
        if (static::$pk) {
            if ($forceDb) {
                if (!$array) {
                    return parent::findOne([static::$pk=>$key]);
                } else {
                    return parent::find()->where([static::$pk=>$key])->asArray()->one();
                }
            } else {
                if (self::enableCache()) {
                    $cacheInstantce = static::getCache();
                    if (!$array) {
                        return parent::findOne([static::$pk=>$key]);
                    } else {
                        $cache_key = self::getCacheKey($key, $array);
                        Yii::trace('from cache array:'.$cache_key, __METHOD__);
                        $row =  $cacheInstantce->get($cache_key);
                        if ($row) {
                            return $row;
                        }

                        $row = parent::find()->where([static::$pk=>$key])->asArray()->one();
                        if ($row) {
                            if ($cacheInstantce->exists($cache_key)) {
                                $cacheInstantce->set($cache_key, $row, isset(Yii::$app->params['ttl']) ? Yii::$app->params['ttl']:2592000);
                            } else {
                                $cacheInstantce->add($cache_key, $row, isset(Yii::$app->params['ttl']) ? Yii::$app->params['ttl']:2592000);
                            }

                        }
                        return $row;
                    }

                } else {
                    throw new Exception('cache undefined');
                }
            }
        } else {
            throw new Exception('primary key undefined');
        }
    }
1106133
public function getTreeCache($table, $key): ?array
    {
        $filename = $table.'_'.$key.'.php';

        if (file_exists($this->cacheDir.'/'.$filename)) {
            self::$cache[$table.'_'.$key] = (include $this->cacheDir.'/'.$filename);
        }

        return self::$cache[$table.'_'.$key] ?? null;
    }
1147758
public function getCache($key)
    {
        if ($this->sqlInitialized()) {
            if ($this->sql) {
                $_key = $this->sql->real_escape_string($key);
                if ($this->lifetime == self::IMMORTAL_LIFETIME) {
                    if ($response = $this->sql->query("
                        SELECT *
                            FROM `{$this->table}`
                            WHERE
                                `{$this->key}` = '$_key' AND
                                `expire` IS NULL
                    ")) {
                        if ($cache = $response->fetch_assoc()) {
                            return unserialize($cache[$this->cache]);
                        }
                    }
                } else {
                    $liveCache = date('Y-m-d H:i:s', time() - $this->lifetime);
                    if ($response = $this->sql->query("
                        SELECT *
                            FROM `{$this->table}`
                            WHERE
                                `{$this->key}` = '$_key' AND (
                                    (
                                        `timestamp` > '{$liveCache}' AND
                                        `expire` IS NULL
                                    ) OR (
                                        `expire` > NOW()
                                    )
                                )
                    ")) {
                        if ($cache = $response->fetch_assoc()) {
                            return unserialize($cache[$this->cache]);
                        }
                    }
                }
            }
            return false;
        }
    }
515097
public function get($key) {
		$filename = $this->getFileName($key);

		if ( ! is_file($filename)) {
			if ($this->log) {
				if ($this->log instanceof LoggerInterface) {
					$this->log->info("Retrieving key '{key}' from file cache: cache miss.", array('key'=>$key));
				} else {
					$this->log->trace("Retrieving key '$key' from file cache: cache miss.");
				}
			}
			return null;
		}
		$value = include $filename;

		if ($value['lifetime'] !== 0 && $value['lifetime'] < time()) {
			if ($this->log) {
				if ($this->log instanceof LoggerInterface) {
					$this->log->info("Retrieving key '{key}' from file cache: key outdated, cache miss.", array('key'=>$key));
				} else {
					$this->log->trace("Retrieving key '$key' from file cache: key outdated, cache miss.");
				}
			}
			return null;
		}

		if ($this->log) {
			if ($this->log instanceof LoggerInterface) {
				$this->log->info("Retrieving key '{key}' from file cache.", array('key'=>$key));
			} else {
				$this->log->trace("Retrieving key '$key' from file cache.");
			}
		}

		return $value['data'];
	}
398760
public function fetch($key)
    {
        if(extension_loaded('apcu') && function_exists('apcu_fetch')) {
            $cached = apcu_fetch($key);
            if (!$cached) {
                return null;
            }

            return $cached;

        }else{
            return null;
        }
    }
720619
public function get($key, $cache_cb = null, $cas_token = null)
    {
        $keyString = $this->getKey($key);
        $this->writeSocket("get $keyString");

        $s = $this->readSocket();

        if (is_null($s) || 'VALUE' != substr($s, 0, 5)) {
            $this->resultCode = Memcached::RES_FAILURE;
            $this->resultMessage = 'Get fail.';
            return false;

        } else {
            $s_result = '';
            $s = $this->readSocket();
            while ('END' != $s) {
                $s_result .= $s;
                $s = $this->readSocket();
            }
            $this->resultCode = Memcached::RES_SUCCESS;
            $this->resultMessage = '';

            return unserialize($s_result);
        }
    }