eZPublishCommunityProject(LegacyStack)  2013.6
eZExpiryHandler Class Reference

Keeps track of expiry keys and their timestamps. More...

Public Member Functions

 eZExpiryHandler ()
 Constructor. More...
 
 hasTimestamp ($name)
 Checks if an expiry timestamp exist. More...
 
 restore ()
 Load the expiry timestamps from cache. More...
 
 setTimestamp ($name, $value)
 Sets the expiry timestamp for a key. More...
 
 store ()
 Stores the current timestamps values to cache. More...
 
 timestamp ($name)
 Returns the expiry timestamp for a key. More...
 

Static Public Member Functions

static fetchData ($path)
 Includes the expiry file and extracts the $Timestamps variable from it. More...
 
static getTimestamp ($name, $default=false)
 Returns the expiry timestamp for a key, or a default value if it isn't set. More...
 
static hasInstance ()
 Checks if a shared instance of eZExpiryHandler exists. More...
 
static instance ()
 Returns a shared instance of the eZExpiryHandler class. More...
 
static registerShutdownFunction ()
 Registers the shutdown function. More...
 
static shutdown ()
 Called at the end of execution and will store the data if it is modified. More...
 

Public Attributes

 $IsModified
 
 $Timestamps
 

Static Private Attributes

static $isShutdownFunctionRegistered = false
 

Detailed Description

Keeps track of expiry keys and their timestamps.

Member Function Documentation

eZExpiryHandler::eZExpiryHandler ( )

Constructor.

Referenced by hasInstance(), and instance().

static eZExpiryHandler::fetchData (   $path)
static

Includes the expiry file and extracts the $Timestamps variable from it.

Parameters
string$path
static eZExpiryHandler::getTimestamp (   $name,
  $default = false 
)
static

Returns the expiry timestamp for a key, or a default value if it isn't set.

Parameters
string$nameExpiry key name
int$defaultDefault value that will be returned if the key isn't set
Returns
mixed The expiry timestamp, or $default

Referenced by eZTemplateCacheBlock\handle(), and eZTemplateCacheFunction\processCached().

static eZExpiryHandler::hasInstance ( )
static

Checks if a shared instance of eZExpiryHandler exists.

Returns
bool true if an instance exists, false otherwise

Referenced by shutdown().

eZExpiryHandler::hasTimestamp (   $name)

Checks if an expiry timestamp exist.

Parameters
string$nameExpiry key name
Returns
bool true if the timestamp exists, false otherwise
eZExpiryHandler::restore ( )

Load the expiry timestamps from cache.

Returns
void

Referenced by eZExpiryHandler().

eZExpiryHandler::setTimestamp (   $name,
  $value 
)

Sets the expiry timestamp for a key.

Parameters
string$nameExpiry key
int$valueExpiry timestamp value
static eZExpiryHandler::shutdown ( )
static

Called at the end of execution and will store the data if it is modified.

eZExpiryHandler::store ( )

Stores the current timestamps values to cache.

eZExpiryHandler::timestamp (   $name)

Returns the expiry timestamp for a key.

Parameters
string$nameExpiry key
Returns
int|false The timestamp if it exists, false otherwise

Member Data Documentation

eZExpiryHandler::$IsModified
eZExpiryHandler::$isShutdownFunctionRegistered = false
staticprivate
eZExpiryHandler::$Timestamps

Referenced by fetchData(), and restore().


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