protected function getData($key)
    {
        $filename = $this->file($key);
        if (!file_exists($filename))
            return false;
        else {
            $data = $this->readFile($filename);

            if ($this->isExpired(null, $data))
                return false;
            else {
                 // if going to expire in 10 seconds, extend the cache and let this request refresh it
                $expire   = $data['expires'];
                $value    = $data['value'];
                $duration = $data['duration'];
                $now      = $this->DateFactory->newStorageDate();
                if (!empty($value) && $duration > 0 && $now->toUnix() > ($expire - 10) ) {
                    $this->put($key, $value, $duration);
                    return false;
                }

                return $data;
            }
        }

    }
protected function getData($key)
    {
        $filename = $this->file($key);
        if (!file_exists($filename))
            return false;
        else {
            $data = $this->readFile($filename);

            if ($this->isExpired(null, $data))
                return false;
            else {
                 // if going to expire in 10 seconds, extend the cache and let this request refresh it
                $expire   = $data['expires'];
                $value    = $data['value'];
                $duration = $data['duration'];
                $now      = $this->DateFactory->newStorageDate();
                if (!empty($value) && $duration > 0 && $now->toUnix() > ($expire - 10) ) {
                    $this->put($key, $value, $duration);
                    return false;
                }

                return $data;
            }
        }

    }
protected function getData ( $ key ) { $ filename = $ this -> file ( $ key ) ; if ( ! file_exists ( $ filename ) ) return false ; else { $ data = $ this -> readFile ( $ filename ) ; if ( $ this -> isExpired ( null , $ data ) ) return false ; else { // if going to expire in 10 seconds, extend the cache and let this request refresh it $ expire = $ data [ 'expires' ] ; $ value = $ data [ 'value' ] ; $ duration = $ data [ 'duration' ] ; $ now = $ this -> DateFactory -> newStorageDate ( ) ; if ( ! empty ( $ value ) && $ duration > 0 && $ now -> toUnix ( ) > ( $ expire - 10 ) ) { $ this -> put ( $ key , $ value , $ duration ) ; return false ; } return $ data ; } } }
Performs a fetch of our data from the filecache without logging in the logger.
That allows this method to be used in other locations.

@param string $key The key to fetch

@return mixed Data in this->storageFormat format or FALSE if data is invalid
Performs a fetch of our data from the filecache without logging in the logger . That allows this method to be used in other locations .