Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
BACKEND_NOT_SUPPORTS_TAG = 'tags are not supported by the current backend'
Messages
Details BACKEND_NOT_IMPLEMENTS_EXTENDED_IF = 'Current backend doesn\'t implement the Zend_Cache_Backend_ExtendedInterface, so this method is not available'
DetailsZend_Cache_Backend_Interface $_backend = 'null'Backend Object
Detailsarray $_backendCapabilities = 'array'Array of capabilities of the backend (only if it implements Zend_Cache_Backend_ExtendedInterface)
Detailsarray $_directivesList = 'array'Array of options which have to be transfered to backend
Detailsboolean $_extendedBackend = 'false'True if the backend implements Zend_Cache_Backend_ExtendedInterface
Detailsstring $_lastId = 'null'Last used cache id
Detailsarray $_options = 'array'Available options
====> (boolean) write_control : - Enable / disable write control (the cache is read just after writing to detect corrupt entries) - Enable write control will lightly slow the cache writing but not the cache reading Write control can detect some corrupt cache files but maybe it's not a perfect control
====> (boolean) caching : - Enable / disable caching (can be very useful for the debug of cached scripts)
=====> (string) cache_id_prefix : - prefix for cache ids (namespace)
====> (boolean) automatic_serialization : - Enable / disable automatic serialization - It can be used to save directly datas which aren't strings (but it's slower)
====> (int) automatic_cleaning_factor : - Disable / Tune the automatic cleaning process - The automatic cleaning process destroy too old (for the given life time) cache files when a new cache file is written : 0 => no automatic cache cleaning 1 => systematic cache cleaning x (integer) > 1 => automatic cleaning randomly 1 times on x cache write
====> (int) lifetime : - Cache lifetime (in seconds) - If null, the cache is valid forever.
====> (boolean) logging : - If set to true, logging is activated (but the system is slower)
====> (boolean) ignore_user_abort - If set to true, the core will set the ignore_user_abort PHP flag inside the save() method to avoid cache corruptions in some cases (default false)
Detailsarray $_specificOptions = 'array'Not used for the core, just a sort a hint to get a common setOption() method (for the core and for frontends)
Details__construct(
array|Zend_Config $options
=
array
)
:
voidConstructor
Details_id(
string $id
)
:
stringMake and return a cache id
Checks 'cache_id_prefix' and returns new id with prefix or simply the id if null
Details_log(
string $message, $priority
=
4
)
:
voidLog a message at the WARN (4) priority.
Details_loggerSanity(
)
:
voidMake sure if we enable logging that the Zend_Log class is available.
Create a default log object if none is set.
Details_setOption(
string $name, mixed $value
)
:
voidSet an option
Details_validateIdOrTag(
string $string
)
:
voidValidate a cache id or a tag (security, reliable filenames, reserved prefixes...)
Throw an exception if a problem is found
Details_validateTagsArray(
array $tags
)
:
voidValidate a tags array (security, reliable filenames, reserved prefixes...)
Throw an exception if a problem is found
Detailsclean(
string $mode
=
all, array|string $tags
=
array
)
:
booleanClean 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)
DetailsgetBackend(
)
:
Zend_Cache_BackendReturns the backend
DetailsgetFillingPercentage(
)
:
intReturn the filling percentage of the backend storage
DetailsgetIds(
)
:
arrayReturn an array of stored cache ids
DetailsgetIdsMatchingAnyTags(
array $tags
=
array
)
:
arrayReturn an array of stored cache ids which match any given tags
In case of multiple tags, a logical OR is made between tags
DetailsgetIdsMatchingTags(
array $tags
=
array
)
:
arrayReturn an array of stored cache ids which match given tags
In case of multiple tags, a logical AND is made between tags
DetailsgetIdsNotMatchingTags(
array $tags
=
array
)
:
arrayReturn an array of stored cache ids which don't match given tags
In case of multiple tags, a logical OR is made between tags
DetailsgetMetadatas(
string $id
)
:
arrayReturn 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
DetailsgetOption(
string $name
)
:
mixedPublic frontend to get an option value
DetailsgetTags(
)
:
arrayReturn an array of stored tags
Detailsload(
string $id, boolean $doNotTestCacheValidity
=
false, boolean $doNotUnserialize
=
false
)
:
mixed|falseTest if a cache is available for the given id and (if yes) return it (false else)
Detailsremove(
string $id
)
:
booleanRemove a cache
Detailssave(
mixed $data, string $id
=
null, array $tags
=
array, int $specificLifetime
=
false, int $priority
=
8
)
:
booleanSave some data in a cache
DetailssetBackend(
Zend_Cache_Backend $backendObject
)
:
voidSet the backend
DetailssetConfig(
Zend_Config $config
)
:
Zend_Cache_CoreSet options using an instance of type Zend_Config
DetailssetLifetime(
int $newLifetime
)
:
voidForce a new lifetime
The new value is set for the core/frontend but for the backend too (directive)
DetailssetOption(
string $name, mixed $value
)
:
voidPublic frontend to set an option
There is an additional validation (relatively to the protected _setOption method)
Detailstest(
string $id
)
:
int|falseTest if a cache is available for the given id
Detailstouch(
string $id, int $extraLifetime
)
:
booleanGive (if possible) an extra lifetime to the given cache id
Details