Cache Interface Reference

Detailed Description

Cache defines the interface for cache implementations.

Caches are divided into different sections, which store key value pairs.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 21 of file Cache.php.

+ Inheritance diagram for Cache:

Public Member Functions

 exists ($section, $key)
 
 getDate ($section, $key)
 
 get ($section, $key)
 
 put ($section, $key, $value, $lifetime=null)
 
 clear ($section)
 
 clearAll ()
 

Member Function Documentation

◆ exists()

exists (   $section,
  $key 
)

Check if a cache entry exists.

Parameters
$sectionThe cache section
$keyThe cache key
Returns
boolean

Implemented in FileCache, and NullCache.

◆ getDate()

getDate (   $section,
  $key 
)

Get the date of the specified cache entry.

Parameters
$sectionThe cache section
$keyThe cache key
Returns
DateTime or null, if not cached

Implemented in FileCache.

◆ get()

get (   $section,
  $key 
)

Get the value of the specified cache entry.

Parameters
$sectionThe cache section
$keyThe cache key
Returns
Mixed

Implemented in FileCache, and NullCache.

◆ put()

put (   $section,
  $key,
  $value,
  $lifetime = null 
)

Store the value of the specified cache entry with an optional lifetime.

Parameters
$sectionThe cache section
$keyThe key
$valueThe value
$lifetimeThe lifetime in seconds (optional)

Implemented in FileCache, and NullCache.

◆ clear()

clear (   $section)

Clear the given cache section.

The wildcard char '*' may be added to the section name in order to clear all matching sections.

Parameters
$sectionThe cache section

Implemented in FileCache, and NullCache.

◆ clearAll()

clearAll ( )

Clear all cache sections.

Implemented in FileCache, and NullCache.