Attempt to retrieve an entry from the cache.

The value will be unserialized before it is returned.

@return mixed Returns the value stored for the given key, or false on failure.
183610
public function get($key)
    {
        try {
            $stmt = $this->getStatement(__METHOD__, self::GET_SQL);
            $stmt->execute(array($key));
        } catch (\PDOException $e) {
            return false;
        }
        $result = $stmt->fetchColumn();
        return empty($result) ? false : unserialize($result);
    }
763138
protected function retrieve($key)
    {
        if (!is_null($cache = $this->redis->get($key))) {
            return unserialize($cache);
        }

        return null;
    }
854925
public function read($key)
    {
        try {
            $cache = $this->db->from($this->table)
                ->where($this->columns['key'])->eq($this->prefix . $key)
                ->select()
                ->fetchAssoc()
                ->first();
        } catch (PDOException $e) {
            return false;
        }

        if ($cache !== false) {
            $expire = (int) $cache[$this->columns['ttl']];

            if ($expire === 0 || time() < $expire) {
                return unserialize($cache[$this->columns['data']]);
            }

            $this->delete($key);
        }

        return false;
    }
594696
def __retrieve(self, key):
        ''' 
        '''
        with self.get_conn() as conn:
            try:
                c = conn.cursor()
                if key is None:
                    c.execute("SELECT value FROM cache_entries WHERE key IS NULL")
                else:
                    c.execute("SELECT value FROM cache_entries WHERE key = ?", (key,))
                result = c.fetchone()
                if result is None or len(result) != 1:
                    getLogger().info("There's no entry with key={key}".format(key=key))
                    return None
                else:
                    return result[0]
            except:
                getLogger().exception("Cannot retrieve")
                return None
249237
public function get($key)
    {
        $filePath = $this->getFilePathFromKey($key);

        if (!file_exists($filePath)) {
            return false;
        }

        if (!is_readable($filePath)) {
            return false;
        }

        $cacheFileData = file_get_contents($filePath);

        if ($this->config['gzipCompression']) {
            $cacheFileData = gzuncompress($cacheFileData);
        }

        $cacheObj = json_decode($cacheFileData);

        // Unable to decode JSON (could happen if compression was turned off while compressed caches still exist)
        if ($cacheObj === null) {
            return false;
        }

        if (!function_exists('sys_getloadavg')) {
            throw new Exception('Your PHP installation does not support `sys_getloadavg` (Windows?). Please set `unixLoadUpperThreshold` to `-1` in your RWFileCache config.');
        }

        if ($this->config['unixLoadUpperThreshold'] == -1) {
            $unixLoad = [0 => PHP_INT_MAX, 1 => PHP_INT_MAX, 2 => PHP_INT_MAX];
        } else {
            $unixLoad = sys_getloadavg();
        }

        if ($cacheObj->expiryTimestamp > time() || $unixLoad[0] >= $this->config['unixLoadUpperThreshold']) {
            // Cache item has not yet expired or system load is too high
            $content = $cacheObj->content;

            if (($unserializedContent = @unserialize($content)) !== false) {
                // Normal unserialization
                $content = $unserializedContent;
            } elseif ($content == serialize(false)) {
                // Edge case to handle boolean false being stored
                $content = false;
            }

            return $content;
        } else {
            // Cache item has expired
            return false;
        }
    }
905196
public function get($key)
    {
        $key = $this->salted($key, $this->suffix);

        $raw = $this->predis->get($key);

        // every response should be a php serialized string.
        // values not matching this pattern will explode.
        // missing data should return null, which is not unserialized.

        if (is_string($raw)) {
            return unserialize($raw);
        }

        return $raw;
    }
1096629
public function get($key)
    {
        $file = $this->makePath($key);
        if (!($data = @file_get_contents($file))) {
            return false;
        }

        if (!($data = @unserialize($data))) {
            $this->delete($key); /* Delete corrupted. */
            return false;
        }

        list($expiry, $value) = $data;
        if ($expiry !== false && ($expiry < microtime(true))) {
            $this->delete($key);
            return false;
        }

        return $value;
    }
467465
public function get($key) {
        $value = null;

        // If the key already exists in the attribute list, return it immediately
        if ($this->has($key)) {
            $value = $this->_attributes[$key];
        }

        // If the key being accessed points to a relation, either lazy load the data or return the cached data
        if (!$value && $this->hasRelation($key)) {
            $value = $this->getRelation($key)->fetchRelation();

            $this->set($key, $value);

        // If an accessor has been defined, run the value through the accessor before returning
        } else if ($method = $this->hasAccessor($key)) {
            $value = $this->{$method}($value);
        }

        return $value;
    }
563088
public static function get($key)
    {
        if (isset($_SESSION[$key]) === false) {
            return null;
        }

        return unserialize($_SESSION[$key]);
    }
1346137
public function get($key)
    {
        $valTO = $this->evaluate($key);
        if ($valTO->fails()) {
            return false;
        }

        return $valTO->getValidValue();
    }
655638
protected function retrieve($key)
    {
        if (array_key_exists($key, $this->storage)) {
            return $this->storage[$key];
        }

        return null;
    }
948351
public function get($key)
    {
        $value = $this->connection()->get($this->prefix.$key);

        return ! is_null($value) ? $this->unserialize($value) : null;
    }
546994
public function get($key) {
        if (!is_array($key)) {
            $key = array('key' => $key);
        }

        $key = $key['key'];
        if (isset($this->store[$key])) {
            if ($this->store[$key]['serialized']) {
                return $this->unserialize($this->store[$key]['data']);
            } else {
                return $this->store[$key]['data'];
            }
        }
        return false;
    }
337863
protected function retrieve($key)
    {
        if (($cache = $this->memcache->get($this->key . $key)) !== false) {
            return $cache;
        }

        return null;
    }
982739
public function get($entry)
    {
        $value = false;

        foreach ($this->caches as $cache) {
            $value = $cache->get($entry);
            if ($value !== false) {
                return $value;
            }
        }
        return $value;
    }
454643
function get( $key, $default = null ) {
            $this->_logger->entrance( 'key = ' . $key );

            $cache_entry = $this->_options->get_option( $key, false );

            if ( is_object( $cache_entry ) &&
                 isset( $cache_entry->timestamp ) &&
                 is_numeric( $cache_entry->timestamp )
            ) {
                return $cache_entry->result;
            }

            return is_object( $default ) ? clone $default : $default;
        }
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);
        }
    }