Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
Kevinrob\GuzzleCache\CacheEntry Class Reference
Inheritance diagram for Kevinrob\GuzzleCache\CacheEntry:

Public Member Functions

 __construct (RequestInterface $request, ResponseInterface $response, DateTime $staleAt, DateTime $staleIfErrorTo=null, DateTime $staleWhileRevalidateTo=null)
 
 __serialize ()
 
 __unserialize (array $data)
 
 getAge ()
 
 getOriginalRequest ()
 
 getOriginalResponse ()
 
 getResponse ()
 
 getStaleAge ()
 
 getStaleAt ()
 
 getTTL ()
 Time in seconds how long the entry should be kept in the cache.
 
 getVaryHeaders ()
 Get the vary headers that should be honoured by the cache.
 
 hasValidationInformation ()
 
 isFresh ()
 
 isStale ()
 
 isVaryEquals (RequestInterface $request)
 
 serialize ()
 
 serveStaleIfError ()
 
 staleWhileValidate ()
 
 unserialize ($data)
 

Protected Attributes

DateTime $dateCreated
 
RequestInterface $request
 
ResponseInterface $response
 
DateTime $staleAt
 
DateTime $staleIfErrorTo
 
DateTime $staleWhileRevalidateTo
 
int $timestampStale
 Cached timestamp of staleAt variable.
 

Constructor & Destructor Documentation

◆ __construct()

Kevinrob\GuzzleCache\CacheEntry::__construct ( RequestInterface $request,
ResponseInterface $response,
DateTime $staleAt,
DateTime $staleIfErrorTo = null,
DateTime $staleWhileRevalidateTo = null )
Parameters
RequestInterface$request
ResponseInterface$response
DateTime$staleAt
DateTime | null$staleIfErrorToif null, detected with the headers (RFC 5861)
DateTime | null$staleWhileRevalidateTo

Member Function Documentation

◆ getAge()

Kevinrob\GuzzleCache\CacheEntry::getAge ( )
Return values
intAge in seconds

◆ getOriginalRequest()

Kevinrob\GuzzleCache\CacheEntry::getOriginalRequest ( )
Return values
RequestInterface

◆ getOriginalResponse()

Kevinrob\GuzzleCache\CacheEntry::getOriginalResponse ( )
Return values
ResponseInterface

◆ getResponse()

Kevinrob\GuzzleCache\CacheEntry::getResponse ( )
Return values
ResponseInterface

◆ getStaleAge()

Kevinrob\GuzzleCache\CacheEntry::getStaleAge ( )
Return values
intpositive value equal staled

◆ getStaleAt()

Kevinrob\GuzzleCache\CacheEntry::getStaleAt ( )
Return values
DateTime

◆ getTTL()

Kevinrob\GuzzleCache\CacheEntry::getTTL ( )

Time in seconds how long the entry should be kept in the cache.

This will not give the time (in seconds) that the response will still be fresh for from the HTTP point of view, but an upper bound on how long it is necessary and reasonable to keep the response in a cache (to re-use it or re-validate it later on).

Return values
intTTL in seconds (0 = infinite)

◆ getVaryHeaders()

Kevinrob\GuzzleCache\CacheEntry::getVaryHeaders ( )

Get the vary headers that should be honoured by the cache.

Return values
KeyValueHttpHeader

◆ hasValidationInformation()

Kevinrob\GuzzleCache\CacheEntry::hasValidationInformation ( )
Return values
bool

◆ isFresh()

Kevinrob\GuzzleCache\CacheEntry::isFresh ( )
Return values
bool

◆ isStale()

Kevinrob\GuzzleCache\CacheEntry::isStale ( )
Return values
bool

◆ isVaryEquals()

Kevinrob\GuzzleCache\CacheEntry::isVaryEquals ( RequestInterface $request)
Parameters
RequestInterface$request
Return values
bool

◆ serveStaleIfError()

Kevinrob\GuzzleCache\CacheEntry::serveStaleIfError ( )
Return values
bool

◆ staleWhileValidate()

Kevinrob\GuzzleCache\CacheEntry::staleWhileValidate ( )
Return values
bool

The documentation for this class was generated from the following file: