Zend Framework
1.12
|
Public Member Functions | |
__construct (array $options=array()) | |
Constructor. | |
setCacheDir ($value, $trailingSeparator=true) | |
Set the cache_dir (particular case of setOption() method) | |
load ($id, $doNotTestCacheValidity=false) | |
Test if a cache is available for the given id and (if yes) return it (false else) | |
test ($id) | |
Test if a cache is available or not (for the given id) | |
save ($data, $id, $tags=array(), $specificLifetime=false) | |
Save some string datas into a cache record. | |
remove ($id) | |
Remove a cache record. | |
clean ($mode=Zend_Cache::CLEANING_MODE_ALL, $tags=array()) | |
Clean some cache records. | |
getIds () | |
Return an array of stored cache ids. | |
getTags () | |
Return an array of stored tags. | |
getIdsMatchingTags ($tags=array()) | |
Return an array of stored cache ids which match given tags. | |
getIdsNotMatchingTags ($tags=array()) | |
Return an array of stored cache ids which don't match given tags. | |
getIdsMatchingAnyTags ($tags=array()) | |
Return an array of stored cache ids which match any given tags. | |
getFillingPercentage () | |
Return the filling percentage of the backend storage. | |
getMetadatas ($id) | |
Return an array of metadatas for the given cache id. | |
touch ($id, $extraLifetime) | |
Give (if possible) an extra lifetime to the given cache id. | |
getCapabilities () | |
Return an associative array of capabilities (booleans) of the backend. | |
___expire ($id) | |
PUBLIC METHOD FOR UNIT TESTING ONLY ! | |
![]() | |
__construct (array $options=array()) | |
Constructor. | |
setDirectives ($directives) | |
Set the frontend directives. | |
setOption ($name, $value) | |
Set an option. | |
getOption ($name) | |
Returns an option. | |
getLifetime ($specificLifetime) | |
Get the life time. | |
isAutomaticCleaningAvailable () | |
Return true if the automatic cleaning is available for the backend. | |
getTmpDir () | |
Determine system TMP directory and detect if we have read access. | |
Protected Member Functions | |
_getMetadatas ($id) | |
Get a metadatas record. | |
_setMetadatas ($id, $metadatas, $save=true) | |
Set a metadatas record. | |
_delMetadatas ($id) | |
Drop a metadata record. | |
_cleanMetadatas () | |
Clear the metadatas array. | |
_loadMetadatas ($id) | |
Load metadatas from disk. | |
_saveMetadatas ($id, $metadatas) | |
Save metadatas to disk. | |
_metadatasFile ($id) | |
Make and return a file name (with path) for metadatas. | |
_isMetadatasFile ($fileName) | |
Check if the given filename is a metadatas one. | |
_remove ($file) | |
Remove a file. | |
_clean ($dir, $mode=Zend_Cache::CLEANING_MODE_ALL, $tags=array()) | |
Clean some cache records (protected method used for recursive stuff) | |
_get ($dir, $mode, $tags=array()) | |
_expireTime ($lifetime) | |
Compute & return the expire time. | |
_hash ($data, $controlType) | |
Make a control key with the string containing datas. | |
_idToFileName ($id) | |
Transform a cache id into a file name and return it. | |
_file ($id) | |
Make and return a file name (with path) | |
_path ($id, $parts=false) | |
Return the complete directory path of a filename (including hashedDirectoryStructure) | |
_recursiveMkdirAndChmod ($id) | |
Make the directory strucuture for the given id. | |
_test ($id, $doNotTestCacheValidity) | |
Test if the given cache id is available (and still valid as a cache record) | |
_fileGetContents ($file) | |
Return the file content of the given file. | |
_filePutContents ($file, $string) | |
Put the given string into the given file. | |
_fileNameToId ($fileName) | |
Transform a file name into cache id and return it. | |
![]() | |
_isGoodTmpDir ($dir) | |
Verify if the given temporary directory is readable and writable. | |
_loggerSanity () | |
Make sure if we enable logging that the Zend_Log class is available. | |
_log ($message, $priority=4) | |
Log a message at the WARN (4) priority. | |
Protected Attributes | |
$_options | |
$_metadatasArray = array() | |
![]() | |
$_directives | |
$_options = array() | |
__construct | ( | array | $options = array() | ) |
Constructor.
array | $options | associative array of options |
Zend_Cache_Exception |
___expire | ( | $id | ) |
PUBLIC METHOD FOR UNIT TESTING ONLY !
Force a cache record to expire
string | $id | cache id |
|
protected |
Clean some cache records (protected method used for recursive stuff)
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)
string | $dir | Directory to clean |
string | $mode | Clean mode |
array | $tags | Array of tags |
Zend_Cache_Exception |
|
protected |
Clear the metadatas array.
|
protected |
Drop a metadata record.
string | $id | Cache id |
|
protected |
Compute & return the expire time.
|
protected |
Make and return a file name (with path)
string | $id | Cache id |
|
protected |
Return the file content of the given file.
string | $file | File complete path |
|
protected |
Transform a file name into cache id and return it.
string | $fileName | File name |
|
protected |
Put the given string into the given file.
string | $file | File complete path |
string | $string | String to put in file |
|
protected |
|
protected |
Get a metadatas record.
string | $id | Cache id |
|
protected |
Make a control key with the string containing datas.
string | $data | Data |
string | $controlType | Type of control 'md5', 'crc32' or 'strlen' |
Zend_Cache_Exception |
|
protected |
Transform a cache id into a file name and return it.
string | $id | Cache id |
|
protected |
Check if the given filename is a metadatas one.
string | $fileName | File name |
|
protected |
Load metadatas from disk.
string | $id | Cache id |
|
protected |
Make and return a file name (with path) for metadatas.
string | $id | Cache id |
|
protected |
Return the complete directory path of a filename (including hashedDirectoryStructure)
string | $id | Cache id |
boolean | $parts | if true, returns array of directory parts instead of single string |
|
protected |
Make the directory strucuture for the given id.
string | $id | cache id |
|
protected |
Remove a file.
If we can't remove the file (because of locks or any problem), we will touch the file to invalidate it
string | $file | Complete file path |
|
protected |
Save metadatas to disk.
string | $id | Cache id |
array | $metadatas | Associative array |
|
protected |
Set a metadatas record.
string | $id | Cache id |
array | $metadatas | Associative array of metadatas |
boolean | $save | optional pass false to disable saving to file |
|
protected |
Test if the given cache id is available (and still valid as a cache record)
string | $id | Cache id |
boolean | $doNotTestCacheValidity | If set to true, the cache validity won't be tested |
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) 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)
string | $mode | clean mode |
tags | array $tags array of tags |
Implements Zend_Cache_Backend_Interface.
getCapabilities | ( | ) |
Return an associative array of capabilities (booleans) of the backend.
The array must include these keys :
Implements Zend_Cache_Backend_ExtendedInterface.
getFillingPercentage | ( | ) |
Return the filling percentage of the backend storage.
Zend_Cache_Exception |
Implements Zend_Cache_Backend_ExtendedInterface.
getIds | ( | ) |
Return an array of stored cache ids.
Implements Zend_Cache_Backend_ExtendedInterface.
getIdsMatchingAnyTags | ( | $tags = array() | ) |
Return an array of stored cache ids which match any given tags.
In case of multiple tags, a logical AND is made between tags
array | $tags | array of tags |
Implements Zend_Cache_Backend_ExtendedInterface.
getIdsMatchingTags | ( | $tags = array() | ) |
Return an array of stored cache ids which match given tags.
In case of multiple tags, a logical AND is made between tags
array | $tags | array of tags |
Implements Zend_Cache_Backend_ExtendedInterface.
getIdsNotMatchingTags | ( | $tags = array() | ) |
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
array | $tags | array of tags |
Implements Zend_Cache_Backend_ExtendedInterface.
getMetadatas | ( | $id | ) |
Return an array of metadatas for the given cache id.
The array must include these keys :
string | $id | cache id |
Implements Zend_Cache_Backend_ExtendedInterface.
getTags | ( | ) |
Return an array of stored tags.
Implements Zend_Cache_Backend_ExtendedInterface.
load | ( | $id, | |
$doNotTestCacheValidity = false |
|||
) |
Test if a cache is available for the given id and (if yes) return it (false else)
string | $id | cache id |
boolean | $doNotTestCacheValidity | if set to true, the cache validity won't be tested |
Implements Zend_Cache_Backend_Interface.
remove | ( | $id | ) |
Remove a cache record.
string | $id | cache id |
Implements Zend_Cache_Backend_Interface.
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)
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) |
Implements Zend_Cache_Backend_Interface.
setCacheDir | ( | $value, | |
$trailingSeparator = true |
|||
) |
Set the cache_dir (particular case of setOption() method)
string | $value | |
boolean | $trailingSeparator | If true, add a trailing separator is necessary |
Zend_Cache_Exception |
test | ( | $id | ) |
Test if a cache is available or not (for the given id)
string | $id | cache id |
Implements Zend_Cache_Backend_Interface.
touch | ( | $id, | |
$extraLifetime | |||
) |
Give (if possible) an extra lifetime to the given cache id.
string | $id | cache id |
int | $extraLifetime |
Implements Zend_Cache_Backend_ExtendedInterface.
|
protected |
|
protected |