source/Core/Utils.php
public function fromFileCache($sKey)
    {
        if (!array_key_exists($sKey, $this->_aFileCacheContents)) {
            $sRes = null;

            $aMeta = $this->getCacheMeta($sKey);
            $blInclude = isset($aMeta["include"]) ? $aMeta["include"] : false;
            $sCachePath = isset($aMeta["cachepath"]) ? $aMeta["cachepath"] : $this->getCacheFilePath($sKey);

            // trying to lock
            $this->_lockFile($sCachePath, $sKey, LOCK_SH);

            clearstatcache();
            if (is_readable($sCachePath)) {
                $sRes = $blInclude ? $this->_includeFile($sCachePath) : $this->_readFile($sCachePath);
            }

            if (isset($sRes['ttl']) && $sRes['ttl'] != 0) {
                $iTimestamp = $sRes['timestamp'];
                $iTtl = $sRes['ttl'];

                $iTime = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
                if ($iTime > $iTimestamp + $iTtl) {
                    return null;
                }
            }
            // release lock
            $this->_releaseFile($sKey, LOCK_SH);

            // caching
            $this->_aFileCacheContents[$sKey] = $sRes;
        }

        return $this->_aFileCacheContents[$sKey]['content'];
    }
public function fromFileCache($sKey)
    {
        if (!array_key_exists($sKey, $this->_aFileCacheContents)) {
            $sRes = null;

            $aMeta = $this->getCacheMeta($sKey);
            $blInclude = isset($aMeta["include"]) ? $aMeta["include"] : false;
            $sCachePath = isset($aMeta["cachepath"]) ? $aMeta["cachepath"] : $this->getCacheFilePath($sKey);

            // trying to lock
            $this->_lockFile($sCachePath, $sKey, LOCK_SH);

            clearstatcache();
            if (is_readable($sCachePath)) {
                $sRes = $blInclude ? $this->_includeFile($sCachePath) : $this->_readFile($sCachePath);
            }

            if (isset($sRes['ttl']) && $sRes['ttl'] != 0) {
                $iTimestamp = $sRes['timestamp'];
                $iTtl = $sRes['ttl'];

                $iTime = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
                if ($iTime > $iTimestamp + $iTtl) {
                    return null;
                }
            }
            // release lock
            $this->_releaseFile($sKey, LOCK_SH);

            // caching
            $this->_aFileCacheContents[$sKey] = $sRes;
        }

        return $this->_aFileCacheContents[$sKey]['content'];
    }
public function fromFileCache ( $ sKey ) { if ( ! array_key_exists ( $ sKey , $ this -> _aFileCacheContents ) ) { $ sRes = null ; $ aMeta = $ this -> getCacheMeta ( $ sKey ) ; $ blInclude = isset ( $ aMeta [ "include" ] ) ? $ aMeta [ "include" ] : false ; $ sCachePath = isset ( $ aMeta [ "cachepath" ] ) ? $ aMeta [ "cachepath" ] : $ this -> getCacheFilePath ( $ sKey ) ; // trying to lock $ this -> _lockFile ( $ sCachePath , $ sKey , LOCK_SH ) ; clearstatcache ( ) ; if ( is_readable ( $ sCachePath ) ) { $ sRes = $ blInclude ? $ this -> _includeFile ( $ sCachePath ) : $ this -> _readFile ( $ sCachePath ) ; } if ( isset ( $ sRes [ 'ttl' ] ) && $ sRes [ 'ttl' ] != 0 ) { $ iTimestamp = $ sRes [ 'timestamp' ] ; $ iTtl = $ sRes [ 'ttl' ] ; $ iTime = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> getTime ( ) ; if ( $ iTime > $ iTimestamp + $ iTtl ) { return null ; } } // release lock $ this -> _releaseFile ( $ sKey , LOCK_SH ) ; // caching $ this -> _aFileCacheContents [ $ sKey ] = $ sRes ; } return $ this -> _aFileCacheContents [ $ sKey ] [ 'content' ] ; }
Fetches contents from file cache.

@param string $sKey Cache key

@return mixed
Fetches contents from file cache .