Class Zend_Cache_Backend_Test

Description

Implements interfaces:

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Cache/Backend/Test.php (line 40)

Zend_Cache_Backend
   |
   --Zend_Cache_Backend_Test
Variable Summary
 array $_directives
 array $_options
Method Summary
 void __construct ([array $options = array()])
 boolean clean ([string $mode = Zend_Cache::CLEANING_MODE_ALL], [array $tags = array()])
 array getAllLogs ()
 array getCapabilities ()
 array getIds ()
 array getIdsMatchingAnyTags ([array $tags = array()])
 array getIdsMatchingTags ([array $tags = array()])
 array getIdsNotMatchingTags ([array $tags = array()])
 string getLastLog ()
 int getLogIndex ()
 array getMetadatas (string $id)
 array getTags ()
 string load (string $id, [boolean $doNotTestCacheValidity = false])
 boolean remove (string $id)
 boolean save (string $data, string $id, [array $tags = array()], [int $specificLifetime = false])
 void setDirectives (array $directives)
 mixed|false test (string $id)
 boolean touch (string $id, int $extraLifetime)
Variables
array $_directives = array() (line 54)

Frontend or Core directives

  • var: directives
  • access: protected

Redefinition of:
Zend_Cache_Backend::$_directives
Frontend or Core directives
array $_options = array() (line 47)

Available options

  • var: available options
  • access: protected

Redefinition of:
Zend_Cache_Backend::$_options
Available options
Methods
Constructor __construct (line 76)

Constructor

  • access: public
void __construct ([array $options = array()])
  • array $options: associative array of options

Redefinition of:
Zend_Cache_Backend::__construct()
Constructor
clean (line 206)

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)

  • return: True if no problem
  • access: public
boolean clean ([string $mode = Zend_Cache::CLEANING_MODE_ALL], [array $tags = array()])
  • string $mode: Clean mode
  • array $tags: Array of tags

Implementation of:
Zend_Cache_Backend_Interface::clean()
Clean some cache records
getAllLogs (line 240)

Get the complete log array

  • return: Complete log array
  • access: public
array getAllLogs ()
getCapabilities (line 382)

Return an associative array of capabilities (booleans) of the backend

The array must include these keys :

  • automatic_cleaning (is automating cleaning necessary)
  • tags (are tags supported)
  • expired_read (is it possible to read expired cache records (for doNotTestCacheValidity option for example))
  • priority does the backend deal with priority when saving
  • infinite_lifetime (is infinite lifetime can work with this backend)
  • get_list (is it possible to get the list of cache ids and the complete list of tags)

  • return: associative of with capabilities
  • access: public
array getCapabilities ()

Implementation of:
Zend_Cache_Backend_ExtendedInterface::getCapabilities()
Return an associative array of capabilities (booleans) of the backend
getFillingPercentage (line 335)

Return the filling percentage of the backend storage

  • return: integer between 0 and 100
  • access: public
int getFillingPercentage ()

Implementation of:
Zend_Cache_Backend_ExtendedInterface::getFillingPercentage()
Return the filling percentage of the backend storage
getIds (line 260)

Return an array of stored cache ids

  • return: array of stored cache ids (string)
  • access: public
array getIds ()

Implementation of:
Zend_Cache_Backend_ExtendedInterface::getIds()
Return an array of stored cache ids
getIdsMatchingAnyTags (line 321)

Return an array of stored cache ids which match any given tags

In case of multiple tags, a logical AND is made between tags

  • return: array of any matching cache ids (string)
  • access: public
array getIdsMatchingAnyTags ([array $tags = array()])
  • array $tags: array of tags

Implementation of:
Zend_Cache_Backend_ExtendedInterface::getIdsMatchingAnyTags()
Return an array of stored cache ids which match any given tags
getIdsMatchingTags (line 287)

Return an array of stored cache ids which match given tags

In case of multiple tags, a logical AND is made between tags

  • return: array of matching cache ids (string)
  • access: public
array getIdsMatchingTags ([array $tags = array()])
  • array $tags: array of tags

Implementation of:
Zend_Cache_Backend_ExtendedInterface::getIdsMatchingTags()
Return an array of stored cache ids which match given tags
getIdsNotMatchingTags (line 304)

Return an array of stored cache ids which don't match given tags

In case of multiple tags, a logical OR is made between tags

  • return: array of not matching cache ids (string)
  • access: public
array getIdsNotMatchingTags ([array $tags = array()])
  • array $tags: array of tags

Implementation of:
Zend_Cache_Backend_ExtendedInterface::getIdsNotMatchingTags()
Return an array of stored cache ids which don't match given tags
getLastLog (line 220)

Get the last log

  • return: The last log
  • access: public
string getLastLog ()
getLogIndex (line 230)

Get the log index

  • return: Log index
  • access: public
int getLogIndex ()
getMetadatas (line 351)

Return an array of metadatas for the given cache id

The array must include these keys :

  • expire : the expire timestamp
  • tags : a string array of tags
  • mtime : timestamp of last modification time

  • return: array of metadatas (false if the cache id is not found)
  • access: public
array getMetadatas (string $id)
  • string $id: cache id

Implementation of:
Zend_Cache_Backend_ExtendedInterface::getMetadatas()
Return an array of metadatas for the given cache id
getTags (line 272)

Return an array of stored tags

  • return: array of stored tags (string)
  • access: public
array getTags ()

Implementation of:
Zend_Cache_Backend_ExtendedInterface::getTags()
Return an array of stored tags
isAutomaticCleaningAvailable (line 250)

Return true if the automatic cleaning is available for the backend

  • access: public
boolean isAutomaticCleaningAvailable ()

Redefinition of:
Zend_Cache_Backend::isAutomaticCleaningAvailable()
Return true if the automatic cleaning is available for the backend
load (line 103)

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)

  • return: Cached datas (or false)
  • access: public
string load (string $id, [boolean $doNotTestCacheValidity = false])
  • string $id: Cache id
  • boolean $doNotTestCacheValidity: If set to true, the cache validity won't be tested

Implementation of:
Zend_Cache_Backend_Interface::load()
Test if a cache is available for the given id and (if yes) return it (false else)
remove (line 179)

Remove a cache record

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

  • return: True if no problem
  • access: public
boolean remove (string $id)
  • string $id: Cache id

Implementation of:
Zend_Cache_Backend_Interface::remove()
Remove a cache record
save (line 161)

Save some string datas into a cache record

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

  • return: True if no problem
  • access: public
boolean save (string $data, string $id, [array $tags = array()], [int $specificLifetime = false])
  • 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)

Implementation of:
Zend_Cache_Backend_Interface::save()
Save some string datas into a cache record
setDirectives (line 87)

Set the frontend directives

  • access: public
void setDirectives (array $directives)
  • array $directives: assoc of directives

Redefinition of:
Zend_Cache_Backend::setDirectives()
Set the frontend directives

Implementation of:
Zend_Cache_Backend_Interface::setDirectives()
Set the frontend directives
test (line 137)

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)

  • return: false (a cache is not available) or "last modified" timestamp (int) of the available cache record
  • access: public
mixed|false test (string $id)
  • string $id: Cache id

Implementation of:
Zend_Cache_Backend_Interface::test()
Test if a cache is available or not (for the given id)
touch (line 363)

Give (if possible) an extra lifetime to the given cache id

  • return: true if ok
  • access: public
boolean touch (string $id, int $extraLifetime)
  • string $id: cache id
  • int $extraLifetime

Implementation of:
Zend_Cache_Backend_ExtendedInterface::touch()
Give (if possible) an extra lifetime to the given cache id

Inherited Methods

Inherited From Zend_Cache_Backend

 Zend_Cache_Backend::__construct()
 Zend_Cache_Backend::getLifetime()
 Zend_Cache_Backend::getTmpDir()
 Zend_Cache_Backend::isAutomaticCleaningAvailable()
 Zend_Cache_Backend::setDirectives()
 Zend_Cache_Backend::setOption()
 Zend_Cache_Backend::_isGoodTmpDir()
 Zend_Cache_Backend::_log()
 Zend_Cache_Backend::_loggerSanity()

Documentation generated on Mon, 21 Jun 2010 15:48:34 -0400 by phpDocumentor 1.4.3