Public Member Functions |
| __construct ($options=array()) |
| setConfig (Zend_Config $config) |
| setBackend (Zend_Cache_Backend $backendObject) |
| getBackend () |
| setOption ($name, $value) |
| getOption ($name) |
| setLifetime ($newLifetime) |
| load ($id, $doNotTestCacheValidity=false, $doNotUnserialize=false) |
| test ($id) |
| save ($data, $id=null, $tags=array(), $specificLifetime=false, $priority=8) |
| remove ($id) |
| clean ($mode= 'all', $tags=array()) |
| getIdsMatchingTags ($tags=array()) |
| getIdsNotMatchingTags ($tags=array()) |
| getIds () |
| getTags () |
| getFillingPercentage () |
| getMetadatas ($id) |
| touch ($id, $extraLifetime) |
Protected Member Functions |
| _loggerSanity () |
| _log ($message, $priority=4) |
| _id ($id) |
Static Protected Member Functions |
static | _validateIdOrTag ($string) |
static | _validateTagsArray ($tags) |
Protected Attributes |
| $_backend = null |
| $_options |
| $_specificOptions = array() |
| $_extendedBackend = false |
| $_backendCapabilities = array() |
Static Protected Attributes |
static | $_directivesList = array('lifetime', 'logging', 'logger') |
Detailed Description
Definition at line 28 of file Core.php.
Constructor & Destructor Documentation
__construct |
( |
$ |
options = array() ) |
|
Constructor
- Parameters:
-
- Exceptions:
-
- Returns:
- void
Definition at line 131 of file Core.php.
Member Function Documentation
Make and return a cache id
Checks 'cache_id_prefix' and returns new id with prefix or simply the id if null
- Parameters:
-
- Returns:
- string Cache id (with or without prefix)
Definition at line 675 of file Core.php.
_log |
( |
$ |
message, |
|
|
$ |
priority = 4 |
|
) |
| [protected] |
Log a message at the WARN (4) priority.
- Parameters:
-
- Exceptions:
-
- Returns:
- void
Definition at line 655 of file Core.php.
_loggerSanity |
( |
) |
[protected] |
Make sure if we enable logging that the Zend_Log class is available. Create a default log object if none is set.
- Exceptions:
-
- Returns:
- void
Definition at line 632 of file Core.php.
static _validateIdOrTag |
( |
$ |
string ) |
[static, protected] |
Validate a cache id or a tag (security, reliable filenames, reserved prefixes...)
Throw an exception if a problem is found
- Parameters:
-
string | $string | Cache id or tag |
- Exceptions:
-
- Returns:
- void
Definition at line 591 of file Core.php.
static _validateTagsArray |
( |
$ |
tags ) |
[static, protected] |
Validate a tags array (security, reliable filenames, reserved prefixes...)
Throw an exception if a problem is found
- Parameters:
-
- Exceptions:
-
- Returns:
- void
Definition at line 613 of file Core.php.
clean |
( |
$ |
mode = 'all' , |
|
|
$ |
tags = array() |
|
) |
| |
Clean cache entries
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) 'matchingAnyTag' => remove cache entries matching any given tags ($tags can be an array of strings or a single string)
- Parameters:
-
string | $mode | |
array | string | $tags | |
- Exceptions:
-
- Returns:
- boolean True if ok
Definition at line 439 of file Core.php.
Returns the backend
- Returns:
- object backend object
Definition at line 190 of file Core.php.
Return the filling percentage of the backend storage
- Returns:
- int integer between 0 and 100
Definition at line 538 of file Core.php.
Return an array of stored cache ids
- Returns:
- array array of stored cache ids (string)
Definition at line 498 of file Core.php.
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
- Parameters:
-
- Returns:
- array array of matching cache ids (string)
Definition at line 463 of file Core.php.
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
- Parameters:
-
- Returns:
- array array of not matching cache ids (string)
Definition at line 482 of file Core.php.
Return an array of metadatas for the given cache id
The array will include these keys :
- expire : the expire timestamp
- tags : a string array of tags
- mtime : timestamp of last modification time
- Parameters:
-
- Returns:
- array array of metadatas (false if the cache id is not found)
Definition at line 557 of file Core.php.
Public frontend to get an option value
- Parameters:
-
string | $name | Name of the option |
- Exceptions:
-
- Returns:
- mixed option value
Definition at line 230 of file Core.php.
Return an array of stored tags
- Returns:
- array array of stored tags (string)
Definition at line 522 of file Core.php.
load |
( |
$ |
id, |
|
|
$ |
doNotTestCacheValidity = false , |
|
|
$ |
doNotUnserialize = 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 |
boolean | $doNotUnserialize | Do not serialize (even if automatic_serialization is true) => for internal use |
- Returns:
- mixed|false Cached datas
Reimplemented in Zend_Cache_Frontend_File.
Definition at line 286 of file Core.php.
Remove a cache
- Parameters:
-
string | $id | Cache id to remove |
- Returns:
- boolean True if ok
Definition at line 411 of file Core.php.
save |
( |
$ |
data, |
|
|
$ |
id = null , |
|
|
$ |
tags = array() , |
|
|
$ |
specificLifetime = false , |
|
|
$ |
priority = 8 |
|
) |
| |
Save some data in a cache
- Parameters:
-
mixed | $data | Data to put in cache (can be another type than string if automatic_serialization is on) |
string | $id | Cache id (if not set, the last cache id will be used) |
array | $tags | Cache tags |
int | $specificLifetime | If != false, set a specific lifetime for this cache record (null => infinite lifetime) |
int | $priority | integer between 0 (very low priority) and 10 (maximum priority) used by some particular backends |
- Exceptions:
-
- Returns:
- boolean True if no problem
Definition at line 334 of file Core.php.
Set the backend
- Parameters:
-
- Exceptions:
-
- Returns:
- void
Definition at line 168 of file Core.php.
setLifetime |
( |
$ |
newLifetime ) |
|
Force a new lifetime
The new value is set for the core/frontend but for the backend too (directive)
- Parameters:
-
int | $newLifetime | New lifetime (in seconds) |
- Returns:
- void
Definition at line 270 of file Core.php.
setOption |
( |
$ |
name, |
|
|
$ |
value |
|
) |
| |
Public frontend to set an option
There is an additional validation (relatively to the protected _setOption method)
- Parameters:
-
string | $name | Name of the option |
mixed | $value | Value of the option |
- Exceptions:
-
- Returns:
- void
Reimplemented in Zend_Cache_Frontend_Class, and Zend_Cache_Frontend_File.
Definition at line 205 of file Core.php.
Test if a cache is available for the given id
- Parameters:
-
- Returns:
- int|false Last modified time of cache entry if it is available, false otherwise
Reimplemented in Zend_Cache_Frontend_File.
Definition at line 312 of file Core.php.
touch |
( |
$ |
id, |
|
|
$ |
extraLifetime |
|
) |
| |
Give (if possible) an extra lifetime to the given cache id
- Parameters:
-
string | $id | cache id |
int | $extraLifetime | |
- Returns:
- boolean true if ok
Definition at line 573 of file Core.php.
Field Documentation
object $_backend = null [protected] |
Backend Object
Definition at line 35 of file Core.php.
array $_directivesList = array('lifetime', 'logging', 'logger') [static, protected] |
Array of options which have to be transfered to backend
Definition at line 94 of file Core.php.
boolean $_extendedBackend = false [protected] |
Initial value: array(
'write_control' => true,
'caching' => true,
'cache_id_prefix' => null,
'automatic_serialization' => false,
'automatic_cleaning_factor' => 10,
'lifetime' => 3600,
'logging' => false,
'logger' => null,
'ignore_user_abort' => false
)
Definition at line 77 of file Core.php.
array $_specificOptions = array() [protected] |
The documentation for this class was generated from the following file:
- E:/E/GEAMP/www/openbiz/openbiz/others/Zend/Cache/Core.php