Inheritances
Files
Overview
FRAMES
NO FRAMES

Class Zend_Cache_Backend_Test

Zend_Cache_Backend
|
Zend_Cache_Backend_Test
Defined in line 40 of file Cache/Backend/Test.php.
PackageZend_Cache
SubpackageZend_Cache_Backend
CopyrightCopyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
Licensehttp://framework.zend.com/license/new-bsd New BSD License

Summary

Instance fields
# $_directives Frontend or Core directives
- $_index Current index for log array
- $_log Array to log actions
# $_options Available options
Instance methods
+ __construct() Constructor
- _addLog() Add an event to the log array
+ clean() Clean some cache records
+ getAllLogs() Get the complete log array
+ getLastLog() Get the last log
+ getLogIndex() Get the log index
+ isAutomaticCleaningAvailable() Return true if the automatic cleaning is available for the backend
+ load() Test if a cache is available for the given id and (if yes) return it (false else)
+ remove() Remove a cache record
+ save() Save some string datas into a cache record
+ setDirectives() Set the frontend directives
+ test() Test if a cache is available or not (for the given id)

Details

Instance fields

$_directives
protected $_directives = array()
Frontend or Core directives
Var array directives
$_index
private $_index = 0
Current index for log array
Var int $_index
$_log
private $_log = array()
Array to log actions
Var array $_log
$_options
protected $_options = array()
Available options
Var array available options

Instance methods

__construct()
public function __construct( $options = array())
Constructor
Parameters
array $options associative array of options
Returns void
_addLog()
private function _addLog( $methodName
$args
)
Add an event to the log array
Parameters
string $methodName MethodName
array $args Arguments
Returns void
clean()
public function 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 $mode Clean mode
array $tags Array of tags
Returns boolean True if no problem
getAllLogs()
public function getAllLogs( )
Get the complete log array
Returns array Complete log array
getLastLog()
public function getLastLog( )
Get the last log
Returns string The last log
getLogIndex()
public function getLogIndex( )
Get the log index
Returns int Log index
isAutomaticCleaningAvailable()
public function isAutomaticCleaningAvailable( )
Return true if the automatic cleaning is available for the backend
Returns boolean
load()
public function 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 $id Cache id
boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
Returns string Cached datas (or false)
remove()
public function remove( $id)
Remove a cache record

For this test backend only, if $id == 'false', then the method will return false
(true else)
Parameters
string $id Cache id
Returns boolean True if no problem
save()
public function 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 $data Datas to cache
string $id Cache id
array $tags Array of strings, the cache record will be tagged by each string entry
int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
Returns boolean True if no problem
setDirectives()
public function setDirectives( $directives)
Set the frontend directives
Parameters
array $directives assoc of directives
Returns void
test()
public function 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 $id Cache id
Returns mixed|false false (a cache is not available) or "last modified" timestamp (int) of the available cache record