Class Zend_Cache_Backend_Memcached

Description

Implements interfaces:

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

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

Zend_Cache_Backend
   |
   --Zend_Cache_Backend_Memcached
Class Constant Summary
 DEFAULT_HOST = '127.0.0.1'
 DEFAULT_PORT = 11211
Variable Summary
 array $_options
Method Summary
 boolean clean ([string $mode = Zend_Cache::CLEANING_MODE_ALL], [tags $tags = array()])
 Zend_Cache_Backend_Memcached __construct ([array $options = array()])
 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)
Variables
array $_options = array(
'servers' => array(array(
'host' => Zend_Cache_Backend_Memcached::DEFAULT_HOST,
'port' => Zend_Cache_Backend_Memcached::DEFAULT_PORT,
'persistent' => Zend_Cache_Backend_Memcached::DEFAULT_PERSISTENT
)),'compression'=>false)
(line 69)

Available options

=====> (array) servers : an array of memcached server ; each memcached server is described by an associative array : 'host' => (string) : the name of the memcached server 'port' => (int) : the port of the memcached server 'persistent' => (bool) : use or not persistent connections to this memcached server

=====> (boolean) compression : true if you want to use on-the-fly compression

  • var: available options
  • access: protected

Redefinition of:
Zend_Cache_Backend::$_options
Available options

Inherited Variables

Inherited from Zend_Cache_Backend

Zend_Cache_Backend::$_backwardCompatibilityArray
Zend_Cache_Backend::$_directives
Methods
clean (line 209)

Clean some cache records

Available modes are : 'all' (default) => remove all cache entries ($tags is not used) 'old' => remove too old cache entries ($tags is not used) 'matchingTag' => remove cache entries matching all given tags ($tags can be an array of strings or a single string) 'notMatchingTag' => 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], [tags $tags = array()])
  • string $mode: clean mode
  • tags $tags: array $tags array of tags

Implementation of:
Zend_Cache_Backend_Interface::clean()
Clean some cache records
Constructor __construct (line 95)

Constructor

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

Redefinition of:
Zend_Cache_Backend::__construct()
Constructor
isAutomaticCleaningAvailable (line 230)

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

Test if a cache is available for the given id and (if yes) return it (false 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 189)

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

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

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)

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::_log()
 Zend_Cache_Backend::_loggerSanity()
Class Constants
DEFAULT_HOST = '127.0.0.1' (line 47)
DEFAULT_PERSISTENT = true (line 49)
DEFAULT_PORT = 11211 (line 48)

Documentation generated on Wed, 28 Nov 2007 15:47:12 -0600 by phpDocumentor 1.4.0