Public Member Functions | Protected Attributes

Zend_Cache_Backend_Test Class Reference

Inheritance diagram for Zend_Cache_Backend_Test:
Zend_Cache_Backend Zend_Cache_Backend_Interface

Public Member Functions

 __construct ($options=array())
 setDirectives ($directives)
 load ($id, $doNotTestCacheValidity=false)
 test ($id)
 save ($data, $id, $tags=array(), $specificLifetime=false)
 remove ($id)
 clean ($mode=Zend_Cache::CLEANING_MODE_ALL, $tags=array())
 getLastLog ()
 getLogIndex ()
 getAllLogs ()
 isAutomaticCleaningAvailable ()

Protected Attributes

 $_options = array()
 $_directives = array()

Detailed Description

Definition at line 40 of file Test.php.


Constructor & Destructor Documentation

__construct ( options = array() )

Constructor

Parameters:
array$optionsassociative array of options
Returns:
void

Definition at line 76 of file Test.php.


Member Function Documentation

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

Clean some cache records

For this test backend only, if $mode == 'false', then the method will return false (true else)

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)

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

Implements Zend_Cache_Backend_Interface.

Definition at line 205 of file Test.php.

getAllLogs (  )

Get the complete log array

Returns:
array Complete log array

Definition at line 239 of file Test.php.

getLastLog (  )

Get the last log

Returns:
string The last log

Definition at line 219 of file Test.php.

getLogIndex (  )

Get the log index

Returns:
int Log index

Definition at line 229 of file Test.php.

isAutomaticCleaningAvailable (  )

Return true if the automatic cleaning is available for the backend

Returns:
boolean

Reimplemented from Zend_Cache_Backend.

Definition at line 249 of file Test.php.

load ( id,
doNotTestCacheValidity = false 
)

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

For this test backend only, if $id == 'false', then the method will return false if $id == 'serialized', the method will return a serialized array ('foo' else)

Parameters:
string$idCache id
boolean$doNotTestCacheValidityIf set to true, the cache validity won't be tested
Returns:
string Cached datas (or false)

Implements Zend_Cache_Backend_Interface.

Definition at line 103 of file Test.php.

remove ( id )

Remove a cache record

For this test backend only, if $id == 'false', then the method will return false (true else)

Parameters:
string$idCache id
Returns:
boolean True if no problem

Implements Zend_Cache_Backend_Interface.

Definition at line 178 of file Test.php.

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

Save some string datas into a cache record

For this test backend only, if $id == 'false', then the method will return false (true else)

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

Implements Zend_Cache_Backend_Interface.

Definition at line 160 of file Test.php.

setDirectives ( directives )

Set the frontend directives

Parameters:
array$directivesassoc of directives
Returns:
void

Implements Zend_Cache_Backend_Interface.

Definition at line 87 of file Test.php.

test ( id )

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

For this test backend only, if $id == 'false', then the method will return false (123456 else)

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

Implements Zend_Cache_Backend_Interface.

Definition at line 133 of file Test.php.


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