Zend Framework  1.12
Public Member Functions | List of all members
Zend_Cache_Backend_Interface Interface Reference

Public Member Functions

 setDirectives ($directives)
 Set the frontend directives.
 
 load ($id, $doNotTestCacheValidity=false)
 Test if a cache is available for the given id and (if yes) return it (false else)
 
 test ($id)
 Test if a cache is available or not (for the given id)
 
 save ($data, $id, $tags=array(), $specificLifetime=false)
 Save some string datas into a cache record.
 
 remove ($id)
 Remove a cache record.
 
 clean ($mode=Zend_Cache::CLEANING_MODE_ALL, $tags=array())
 Clean some cache records.
 

Member Function Documentation

clean (   $mode = Zend_Cache::CLEANING_MODE_ALL,
  $tags = array() 
)

Clean some cache records.

Available modes are : Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used) Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used) Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags ($tags can be an array of strings or a single string) Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags} ($tags can be an array of strings or a single string) Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags ($tags can be an array of strings or a single string)

Parameters
string$modeClean mode
array$tagsArray of tags
Returns
boolean true if no problem

Implemented in Zend_Cache_Backend_Static, Zend_Cache_Backend_File, Zend_Cache_Backend_TwoLevels, Zend_Cache_Backend_Memcached, Zend_Cache_Backend_Libmemcached, Zend_Cache_Backend_Sqlite, Zend_Cache_Backend_Test, Zend_Cache_Backend_ZendServer, Zend_Cache_Backend_ZendPlatform, Zend_Cache_Backend_Xcache, Zend_Cache_Backend_Apc, Zend_Cache_Backend_WinCache, and Zend_Cache_Backend_BlackHole.

load (   $id,
  $doNotTestCacheValidity = false 
)

Test if a cache is available for the given id and (if yes) return it (false else)

Note : return value is always "string" (unserialization is done by the core not by the backend)

Parameters
string$idCache id
boolean$doNotTestCacheValidityIf set to true, the cache validity won't be tested
Returns
string|false cached datas

Implemented in Zend_Cache_Backend_TwoLevels, Zend_Cache_Backend_File, Zend_Cache_Backend_Memcached, Zend_Cache_Backend_Libmemcached, Zend_Cache_Backend_Static, Zend_Cache_Backend_Sqlite, Zend_Cache_Backend_Test, Zend_Cache_Backend_Xcache, Zend_Cache_Backend_ZendServer, Zend_Cache_Backend_ZendPlatform, Zend_Cache_Backend_Apc, Zend_Cache_Backend_WinCache, and Zend_Cache_Backend_BlackHole.

remove (   $id)
save (   $data,
  $id,
  $tags = array(),
  $specificLifetime = false 
)

Save some string datas into a cache record.

Note : $data is always "string" (serialization is done by the core not by the backend)

Parameters
string$dataDatas to cache
string$idCache id
array$tagsArray of strings, the cache record will be tagged by each string entry
int$specificLifetimeIf != false, set a specific lifetime for this cache record (null => infinite lifetime)
Returns
boolean true if no problem

Implemented in Zend_Cache_Backend_File, Zend_Cache_Backend_Static, Zend_Cache_Backend_Memcached, Zend_Cache_Backend_Libmemcached, Zend_Cache_Backend_Test, Zend_Cache_Backend_Sqlite, Zend_Cache_Backend_ZendServer, Zend_Cache_Backend_Xcache, Zend_Cache_Backend_ZendPlatform, Zend_Cache_Backend_Apc, Zend_Cache_Backend_WinCache, and Zend_Cache_Backend_BlackHole.

setDirectives (   $directives)

Set the frontend directives.

Parameters
array$directivesassoc of directives

Implemented in Zend_Cache_Backend_Memcached, Zend_Cache_Backend_Libmemcached, and Zend_Cache_Backend_Test.

test (   $id)

Test if a cache is available or not (for the given id)

Parameters
string$idcache id
Returns
mixed|false (a cache is not available) or "last modified" timestamp (int) of the available cache record

Implemented in Zend_Cache_Backend_File, Zend_Cache_Backend_Memcached, Zend_Cache_Backend_Libmemcached, Zend_Cache_Backend_Static, Zend_Cache_Backend_TwoLevels, Zend_Cache_Backend_Test, Zend_Cache_Backend_Sqlite, Zend_Cache_Backend_ZendPlatform, Zend_Cache_Backend_Xcache, Zend_Cache_Backend_ZendServer, Zend_Cache_Backend_Apc, Zend_Cache_Backend_WinCache, and Zend_Cache_Backend_BlackHole.