Inheritances
Files
Overview
FRAMES
NO FRAMES

Class Zend_Cache_Backend_ZendPlatform

Zend_Cache_Backend
|
Zend_Cache_Backend_ZendPlatform
Zend_Cache
|-Zend_Cache_Zend_Cache_Backend
|- class Zend_Cache_Backend_ZendPlatform extends Zend_Cache_Backend implements Zend_Cache_Backend_Interface
Impementation of Zend Cache Backend using the Zend Platform (Output Content Caching)
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

Class constants
TAGS_PREFIX internal ZP prefix
Instance methods
+ __construct() Constructor
- _clean() Clean a directory and recursivly go over it's subdirectories
- _remove() Remove a file
+ clean() Clean some cache records
+ 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
+ test() Test if a cache is available or not (for the given id)

Details

Class constants

TAGS_PREFIX
const TAGS_PREFIX = "internal_ZPtag:"
internal ZP prefix

Instance methods

__construct()
public function __construct( array $options = array())
Constructor
Validate that the Zend Platform is loaded and licensed
Parameters
array $options
Returns void
_clean()
private function _clean( $dir
$mode
)
Clean a directory and recursivly go over it's subdirectories

Remove all the cached files that need to be cleaned (according to mode and files mtime)
Parameters
string $dir Path of directory ot clean
string $mode The same parameter as in Zend_Cache_Backend_ZendPlatform::clean()
Returns boolean True if ok
_remove()
private function _remove( $file)
Remove a file

If we can't remove the file (because of locks or any problem), we will touch
the file to invalidate it
Parameters
string $file Complete file path
Returns boolean True if ok
clean()
public function clean( $mode = Zend_Cache::CLEANING_MODE_ALL
$tags = array()
)
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)
This mode is not supported in this backend
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 => unsupported
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)
Parameters
string $mode Clean mode
array $tags Array of tags
Returns boolean True if no problem
load()
public function load( $id
$doNotTestCacheValidity = false
)
Test if a cache is available for the given id and (if yes) return it (false else)
Parameters
string $id Cache id
boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
Returns string Cached data (or false)
remove()
public function remove( $id)
Remove a cache record
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

Note : $data is always "string" (serialization is done by the
core not by the backend)
Parameters
string $data Data 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
test()
public function test( $id)
Test if a cache is available or not (for the given id)
Parameters
string $id Cache id
Returns mixed|false false (a cache is not available) or "last modified" timestamp (int) of the available cache record