Class Zend_Cache_Backend_Apc

Description

Implements interfaces:

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

Located in /Cache/Backend/Apc.php (line 41)

Zend_Cache_Backend
   |
   --Zend_Cache_Backend_Apc
Class Constant Summary
 TAGS_UNSUPPORTED_BY_CLEAN_OF_APC_BACKEND = 'Zend_Cache_Backend_Apc::clean() : tags are unsupported by the Apc backend'
 TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND = 'Zend_Cache_Backend_Apc::save() : tags are unsupported by the Apc backend'
Method Summary
 void __construct ([ $options = array()])
 boolean clean ([string $mode = Zend_Cache::CLEANING_MODE_ALL], [array $tags = array()])
 array getCapabilities ()
 array getIds ()
 array getIdsMatchingAnyTags ([array $tags = array()])
 array getIdsMatchingTags ([array $tags = array()])
 array getIdsNotMatchingTags ([array $tags = array()])
 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])
 mixed test (string $id)
 boolean touch (string $id, int $extraLifetime)
Variables
Methods
Constructor __construct (line 56)

Constructor

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

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

Clean some cache records

Available modes are : 'all' (default) => remove all cache entries ($tags is not used) 'old' => unsupported 'matchingTag' => unsupported 'notMatchingTag' => unsupported 'matchingAnyTag' => unsupported

  • return: true if no problem
  • throws: Zend_Cache_Exception
  • 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
getCapabilities (line 343)

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 184)

Return the filling percentage of the backend storage

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

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

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 246)

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 218)

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 232)

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
getMetadatas (line 279)

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 204)

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 173)

Return true if the automatic cleaning is available for the backend

DEPRECATED : use getCapabilities() instead

  • deprecated:
  • access: public
boolean isAutomaticCleaningAvailable ()

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

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

WARNING $doNotTestCacheValidity=true is unsupported by the Apc backend

  • 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 125)

Remove a cache record

  • 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 109)

Save some string datas into a cache record

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

  • 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
test (line 88)

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

  • return: false (a cache is not available) or "last modified" timestamp (int) of the available cache record
  • access: public
mixed 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 307)

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()
Class Constants
TAGS_UNSUPPORTED_BY_CLEAN_OF_APC_BACKEND = 'Zend_Cache_Backend_Apc::clean() : tags are unsupported by the Apc backend' (line 46)

Log message

TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND = 'Zend_Cache_Backend_Apc::save() : tags are unsupported by the Apc backend' (line 47)

Documentation generated on Mon, 21 Jun 2010 15:07:30 -0400 by phpDocumentor 1.4.3