protected function isCacheFileExpired(string $cacheEntryPathAndFilename, bool $acquireLock = true): bool
    {
        if (is_file($cacheEntryPathAndFilename) === false) {
            return true;
        }

        $expiryTimeOffset = filesize($cacheEntryPathAndFilename) - self::DATASIZE_DIGITS - self::EXPIRYTIME_LENGTH;
        if ($acquireLock) {
            $expiryTime = (integer)$this->readCacheFile($cacheEntryPathAndFilename, $expiryTimeOffset, self::EXPIRYTIME_LENGTH);
        } else {
            $expiryTime = (integer)file_get_contents($cacheEntryPathAndFilename, null, null, $expiryTimeOffset, self::EXPIRYTIME_LENGTH);
        }

        return ($expiryTime !== 0 && $expiryTime < time());
    }
protected function isCacheFileExpired(string $cacheEntryPathAndFilename, bool $acquireLock = true): bool
    {
        if (is_file($cacheEntryPathAndFilename) === false) {
            return true;
        }

        $expiryTimeOffset = filesize($cacheEntryPathAndFilename) - self::DATASIZE_DIGITS - self::EXPIRYTIME_LENGTH;
        if ($acquireLock) {
            $expiryTime = (integer)$this->readCacheFile($cacheEntryPathAndFilename, $expiryTimeOffset, self::EXPIRYTIME_LENGTH);
        } else {
            $expiryTime = (integer)file_get_contents($cacheEntryPathAndFilename, null, null, $expiryTimeOffset, self::EXPIRYTIME_LENGTH);
        }

        return ($expiryTime !== 0 && $expiryTime < time());
    }
protected function isCacheFileExpired ( string $ cacheEntryPathAndFilename , bool $ acquireLock = true ) : bool { if ( is_file ( $ cacheEntryPathAndFilename ) === false ) { return true ; } $ expiryTimeOffset = filesize ( $ cacheEntryPathAndFilename ) - self :: DATASIZE_DIGITS - self :: EXPIRYTIME_LENGTH ; if ( $ acquireLock ) { $ expiryTime = ( integer ) $ this -> readCacheFile ( $ cacheEntryPathAndFilename , $ expiryTimeOffset , self :: EXPIRYTIME_LENGTH ) ; } else { $ expiryTime = ( integer ) file_get_contents ( $ cacheEntryPathAndFilename , null , null , $ expiryTimeOffset , self :: EXPIRYTIME_LENGTH ) ; } return ( $ expiryTime !== 0 && $ expiryTime < time ( ) ) ; }
Checks if the given cache entry files are still valid or if their
lifetime has exceeded.

@param string $cacheEntryPathAndFilename
@param boolean $acquireLock
@return boolean
@api
Checks if the given cache entry files are still valid or if their lifetime has exceeded .