Returns the last modified time.

@param string $key

@return int|bool An UNIX like timestamp or false
552774
public function mtime($key)
    {
        if ($object = $this->tryGetObject($key)) {
            return (new \DateTime($object->getLastModified()))->format('U');
        }

        return false;
    }
1356874
public function read($key)
    {
        $key = $this->_key($key);

        if (!$this->_init || $this->_setKey($key) === false) {
            return false;
        }

        if ($this->_config['lock']) {
            $this->_File->flock(LOCK_SH);
        }

        $this->_File->rewind();
        $time = time();
        $cachetime = (int)$this->_File->current();

        if ($cachetime < $time) {
            if ($this->_config['lock']) {
                $this->_File->flock(LOCK_UN);
            }

            return false;
        }

        $data = '';
        $this->_File->next();
        while ($this->_File->valid()) {
            $data .= $this->_File->current();
            $this->_File->next();
        }

        if ($this->_config['lock']) {
            $this->_File->flock(LOCK_UN);
        }

        $data = trim($data);

        if ($data !== '' && !empty($this->_config['serialize'])) {
            if ($this->_config['isWindows']) {
                $data = str_replace('\\\\\\\\', '\\', $data);
            }
            $data = unserialize((string)$data);
        }

        return $data;
    }
67114
public function expiration($key)
    {
        if ($this->exists($name)) {
            $data = Query::from($this->table)
                        ->where('name', '=', $name)
                        ->first();

            if ($data->lifetime >= time()) {
                return $data->lifetime;
            }
        }
    }
1004850
public function getItemTtl($key)
    {
        $data = $this->memcached->get($key);

        if ($data['ttl'] === 0 || (time() - $data['start'] <= $data['ttl'])) {
            $ttl = $data['ttl'];
        } else {
            $this->deleteItem($key);
        }

        return (isset($ttl)) ? $ttl : false;
    }
824677
public function getUsingFileTimestamps($key)
    {
        $value = $this->get($this->cacheKey($key));
        $timestamps = $this->get($this->cachetskey($key));

        if ($value !== false && $timestamps !== false) {

            foreach ($timestamps as $file => $timestamp) {

                if (filemtime($file) !== $timestamp)
                    return false;
            }

            return $value;
        }

        return false;
    }
1362107
public function read(string $key)
    {
        $file = $this->cacheFile($key);

        if (is_file($file)) {
            // Cache exists
            $data = include $file;
            $expire = (int)$data['ttl'];
            if ($expire === 0 || time() < $expire) {
                return unserialize($data['data']);
            }
            unlink($file);
        }

        return false;
    }
1034619
private function searchServeVal($key)
    {
        $ex = ServerVal::where('var_name', $key)->first();
        if(count($ex)){
            $expire = $ex->expire;
            $rec = ServerVal::where('var_name', $key)
                            ->where('var_up_time', '>', (time() - $expire))
                            ->first();
            if(count($rec)){
                return $rec->var_value;
            }else{
                return $rec;
            }
            
        }else{
            return $ex;
        }

    }
23199
protected function retrieve($key)
    {
        $value = dba_fetch($key, $this->dba);

        if (false === $value) {
            return null;
        }

        // compare the timestamp to the current time when we read the value.
        if (time() >= substr($value, 0, 10)) {
            $this->forget($key);
            return null;
        }

        return unserialize(substr($value, 10));
    }
188633
public function exists($key)
	{
		return isset($this->data[$key]) && ($this->data[$key][1] > time());
	}
293120
public function get($key)
    {
        $path = $this->filename($key);
        $file = @fopen($path, 'r');
        if (!$file) {
            return false;
        }
        $timestamp = fgets($file, 11);
        fclose($file);
        if ($timestamp > time() || $timestamp == "00000000000") {
            return substr(file_get_contents($path), 11);
        }
        return false;
    }
391906
public function get($key)
	{
		$path = $this->path($key);

		// If the file doesn't exists, we obviously can't return the cache so we will
		// just return null. Otherwise, we'll get the contents of the file and get
		// the expiration UNIX timestamps from the start of the file's contents.
		if ( ! $this->files->exists($path))
		{
			return null;
		}

		try
		{
			$expire = substr($contents = $this->files->get($path), 0, 10);
		}
		catch (\Exception $e)
		{
			return null;
		}

		// If the current time is greater than expiration timestamps we will delete
		// the file and return null. This helps clean up the old files and keeps
		// this directory much cleaner for us as old files aren't hanging out.
		if (time() >= $expire)
		{
			return $this->forget($key);
		}

		return unserialize(substr($contents, 10));
	}
611243
public function get($key)
    {
        $getResult = $this->getValue($key);
        $unserialized = @unserialize($getResult);

        if (Util::hasInternalExpireTime($unserialized)) {
            $getResult = $unserialized['v'];
        }

        return $getResult;
    }
731814
public function expired(string $key)
    {
        $path = $this->path($key);

        return $this->files->exists($path)
            ? \Carbon\Carbon::createFromTimestamp(
                substr($this->files->get($path), 0, 10)
            ) : null;
    }
472044
protected function retrieve($key)
    {
        if (!$this->has($key)) {
            return null;
        }

        $cache = file_get_contents($this->path . $key);

        // compare the timestamp to the current time when we read the file.
        if (time() >= substr($cache, 0, 10)) {
            $this->forget($key);
            return null;
        }

        return unserialize(substr($cache, 10));
    }
464747
public static function getStatusFromKey($key)
    {
        if (array_key_exists($key, self::$statusList)) {
            return self::$statusList[$key];
        }
        return false;
    }
973978
public function expired(string $key): bool
    {
        try {
            return $this->storage->expired($key);
        } catch (BadPacketException $e) {
            return true;
        }
    }
1083013
public function last(?string $key = null)
    {
        $value = $this->get($key);

        if (is_array($value)) {
            return end($value);
        }

        return $value;
    }