PHP Class Kevinrob\GuzzleCache\CacheEntry

Mostra file Open project: kevinrob/guzzle-cache-middleware Class Usage Examples

Protected Properties

Property Type Description
$dateCreated DateTime
$request Psr\Http\Message\RequestInterface
$response Psr\Http\Message\ResponseInterface
$responseBody string Response::body is a stream and can't be serialized.
$staleAt DateTime
$staleIfErrorTo DateTime
$staleWhileRevalidateTo DateTime
$timestampStale integer Cached timestamp of staleAt variable.

Public Methods

Method Description
__construct ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, DateTime $staleAt, DateTime $staleIfErrorTo = null, DateTime $staleWhileRevalidateTo = null )
__sleep ( )
__wakeup ( )
getAge ( ) : integer
getOriginalRequest ( ) : Psr\Http\Message\RequestInterface
getResponse ( ) : Psr\Http\Message\ResponseInterface
getStaleAge ( ) : integer
getStaleAt ( ) : DateTime
getTTL ( ) : integer
hasValidationInformation ( ) : boolean
isFresh ( ) : boolean
isStale ( ) : boolean
isVaryEquals ( Psr\Http\Message\RequestInterface $request ) : boolean
serveStaleIfError ( ) : boolean
staleWhileValidate ( ) : boolean

Method Details

__construct() public method

public __construct ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, DateTime $staleAt, DateTime $staleIfErrorTo = null, DateTime $staleWhileRevalidateTo = null )
$request Psr\Http\Message\RequestInterface
$response Psr\Http\Message\ResponseInterface
$staleAt DateTime
$staleIfErrorTo DateTime if null, detected with the headers (RFC 5861)
$staleWhileRevalidateTo DateTime

__sleep() public method

public __sleep ( )

__wakeup() public method

public __wakeup ( )

getAge() public method

public getAge ( ) : integer
return integer Age in seconds

getOriginalRequest() public method

public getOriginalRequest ( ) : Psr\Http\Message\RequestInterface
return Psr\Http\Message\RequestInterface

getResponse() public method

public getResponse ( ) : Psr\Http\Message\ResponseInterface
return Psr\Http\Message\ResponseInterface

getStaleAge() public method

public getStaleAge ( ) : integer
return integer positive value equal staled

getStaleAt() public method

public getStaleAt ( ) : DateTime
return DateTime

getTTL() public method

public getTTL ( ) : integer
return integer TTL in seconds (0 = infinite)

hasValidationInformation() public method

isFresh() public method

public isFresh ( ) : boolean
return boolean

isStale() public method

public isStale ( ) : boolean
return boolean

isVaryEquals() public method

public isVaryEquals ( Psr\Http\Message\RequestInterface $request ) : boolean
$request Psr\Http\Message\RequestInterface
return boolean

serveStaleIfError() public method

public serveStaleIfError ( ) : boolean
return boolean

staleWhileValidate() public method

public staleWhileValidate ( ) : boolean
return boolean

Property Details

$dateCreated protected_oe property

protected DateTime $dateCreated
return DateTime

$request protected_oe property

protected RequestInterface,Psr\Http\Message $request
return Psr\Http\Message\RequestInterface

$response protected_oe property

protected ResponseInterface,Psr\Http\Message $response
return Psr\Http\Message\ResponseInterface

$responseBody protected_oe property

Response::body is a stream and can't be serialized.
protected string $responseBody
return string

$staleAt protected_oe property

protected DateTime $staleAt
return DateTime

$staleIfErrorTo protected_oe property

protected DateTime $staleIfErrorTo
return DateTime

$staleWhileRevalidateTo protected_oe property

protected DateTime $staleWhileRevalidateTo
return DateTime

$timestampStale protected_oe property

Cached timestamp of staleAt variable.
protected int $timestampStale
return integer