Class Zend_Cache_Backend_Static

Description

Implements interfaces:

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

Located in /Cache/Backend/Static.php (line 39)

Zend_Cache_Backend
   |
   --Zend_Cache_Backend_Static
Class Constant Summary
 INNER_CACHE_NAME = 'zend_cache_backend_static_tagcache'
Variable Summary
Method Summary
 static void _validateIdOrTag (string $string)
 boolean clean ([string $mode = Zend_Cache::CLEANING_MODE_ALL], [array $tags = array()])
 mixed getOption (string $name)
 string|false load (string $id, [boolean $doNotTestCacheValidity = false])
 boolean remove (string $id)
 boolean removeRecursively (string $id)
 boolean save (string $data, string $id, [array $tags = array()], [int $specificLifetime = false])
 Zend_Cache_Backend_Static setOption (string $name, mixed $value)
 bool test (string $id)
 void _createDirectoriesFor ( $path)
 void _decodeId ( $id)
 string _detectId ()
 void _isSerialized ( $data)
 int _octdec ($val $val)
 bool _verifyPath (string $path)
Variables
array $_options = array(
'public_dir' => null,
'sub_dir' => 'html',
'file_extension' => '.html',
'index_filename' => 'index',
'file_locking' => true,
'cache_file_umask' => 0600,
'cache_directory_umask' => 0700,
'debug_header' => false,
'tag_cache' => null,
'disable_caching' => false
)
(line 49)

Static backend options

  • access: protected

Redefinition of:
Zend_Cache_Backend::$_options
Available options
Zend_Cache_Core $_tagCache = null (line 66)

Cache for handling tags

  • access: protected
array $_tagged = null (line 72)

Tagged items

  • access: protected

Inherited Variables

Inherited from Zend_Cache_Backend

Zend_Cache_Backend::$_directives
Methods
static _validateIdOrTag (line 515)

Validate a cache id or a tag (security, reliable filenames, reserved prefixes...)

Throw an exception if a problem is found

  • deprecated: Not usable until perhaps ZF 2.0
  • throws: Zend_Cache_Exception
  • access: protected
static void _validateIdOrTag (string $string)
  • string $string: Cache id or tag
clean (line 380)

Clean some cache records

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) Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any 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
getInnerCache (line 474)

Get the Inner Cache if set

  • access: public
Zend_Cache_Core getInnerCache ()
getOption (line 100)

Retrieve any option via interception of the parent's statically held options including the local option for a tag cache.

  • access: public
mixed getOption (string $name)
  • string $name
load (line 124)

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

Note : return value is always "string" (unserialization is done by the core not by the backend)

  • return: cached datas
  • access: public
string|false 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 294)

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
removeRecursively (line 329)

Remove a cache record recursively for the given directory matching a REQUEST_URI based relative path (deletes the actual file matching this in addition to the matching directory)

  • return: True if no problem
  • access: public
boolean removeRecursively (string $id)
  • string $id: Cache id
save (line 201)

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
setInnerCache (line 463)

Set an Inner Cache, used here primarily to store Tags associated with caches created by this backend. Note: If Tags are lost, the cache should be completely cleaned as the mapping of tags to caches will have been irrevocably lost.

  • access: public
void setInnerCache (Zend_Cache_Core $cache)
setOption (line 83)

Interceptor child method to handle the case where an Inner Cache object is being set since it's not supported by the standard backend interface

  • access: public
Zend_Cache_Backend_Static setOption (string $name, mixed $value)
  • string $name
  • mixed $value

Redefinition of:
Zend_Cache_Backend::setOption()
Set an option
test (line 158)

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

  • access: public
bool 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)
_createDirectoriesFor (line 262)

Recursively create the directories needed to write the static file

  • access: protected
void _createDirectoriesFor ( $path)
  • $path
_decodeId (line 554)

Decode a request URI from the provided ID

  • access: protected
void _decodeId ( $id)
  • $id
_detectId (line 500)

Determine the page to save from the request

  • access: protected
string _detectId ()
_isSerialized (line 283)

Detect serialization of data (cannot predict since this is the only way to obey the interface yet pass in another parameter).

In future, ZF 2.0, check if we can just avoid the interface restraints.

This format is the only valid one possible for the class, so it's simple to just run a regular expression for the starting serialized format.

  • access: protected
void _isSerialized ( $data)
  • $data
_octdec (line 543)

Detect an octal string and return its octal value for file permission ops otherwise return the non-string (assumed octal or decimal int already)

  • access: protected
int _octdec ($val $val)
  • $val $val: The potential octal in need of conversion
_verifyPath (line 488)

Verify path exists and is non-empty

  • access: protected
bool _verifyPath (string $path)
  • string $path

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
INNER_CACHE_NAME = 'zend_cache_backend_static_tagcache' (line 43)

Documentation generated on Mon, 21 Jun 2010 15:46:39 -0400 by phpDocumentor 1.4.3