Cache/Core.php
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Cache
- Version
- $Id$
\Zend_Cache_Core
- Children
- \Zend_Cache_Frontend_Class
- \Zend_Cache_Frontend_File
- \Zend_Cache_Frontend_Capture
- \Zend_Cache_Frontend_Page
- \Zend_Cache_Frontend_Output
- \Zend_Cache_Frontend_Function
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties
array $_backendCapabilities = array()
array()
Details- Type
- array
array $_directivesList = array('lifetime', 'logging', 'logger')
array('lifetime', 'logging', 'logger')
Details- Type
- array
boolean $_extendedBackend = false
false
Details- Type
- boolean
array $_options = 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)
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)
Details- Type
- array
Methods
__construct(array | \Zend_Config $options = array()) : void
Constructor
Name | Type | Description |
---|---|---|
$options | array | \Zend_Config | Associative array of options or Zend_Config instance |
Exception | Description |
---|---|
\Zend_Cache_Exception |
_id(string $id) : string
Make and return a cache id
Name | Type | Description |
---|---|---|
$id | string | Cache id |
Type | Description |
---|---|
string | Cache id (with or without prefix) |
_log(string $message, $priority = 4) : void
Log a message at the WARN (4) priority.
Name | Type | Description |
---|---|---|
$message | string | |
$priority |
Exception | Description |
---|---|
\Zend_Cache_Exception |
_loggerSanity() : void
Make sure if we enable logging that the Zend_Log class is available.
Exception | Description |
---|---|
\Zend_Cache_Exception |
_setOption(string $name, mixed $value) : void
Set an option
Name | Type | Description |
---|---|---|
$name | string | Name of the option |
$value | mixed | Value of the option |
Exception | Description |
---|---|
\Zend_Cache_Exception |
_validateIdOrTag(string $string) : void
Validate a cache id or a tag (security, reliable filenames, reserved prefixes.
Name | Type | Description |
---|---|---|
$string | string | Cache id or tag |
Exception | Description |
---|---|
\Zend_Cache_Exception |
_validateTagsArray(array $tags) : void
Validate a tags array (security, reliable filenames, reserved prefixes.
Name | Type | Description |
---|---|---|
$tags | array | Array of tags |
Exception | Description |
---|---|
\Zend_Cache_Exception |
clean(string $mode = 'all', array | string $tags = array()) : boolean
Clean cache entries
Name | Type | Description |
---|---|---|
$mode | string | |
$tags | array | string |
Type | Description |
---|---|
boolean | True if ok |
Exception | Description |
---|---|
\Zend_Cache_Exception |
getBackend() : \Zend_Cache_Backend
Returns the backend
Type | Description |
---|---|
\Zend_Cache_Backend | backend object |
getFillingPercentage() : int
Return the filling percentage of the backend storage
Type | Description |
---|---|
int | integer between 0 and 100 |
getIds() : array
Return an array of stored cache ids
Type | Description |
---|---|
array | array of stored cache ids (string) |
getIdsMatchingAnyTags(array $tags = array()) : array
Return an array of stored cache ids which match any given tags
Name | Type | Description |
---|---|---|
$tags | array | array of tags |
Type | Description |
---|---|
array | array of matching any cache ids (string) |
getIdsMatchingTags(array $tags = array()) : array
Return an array of stored cache ids which match given tags
Name | Type | Description |
---|---|---|
$tags | array | array of tags |
Type | Description |
---|---|
array | array of matching cache ids (string) |
getIdsNotMatchingTags(array $tags = array()) : array
Return an array of stored cache ids which don't match given tags
Name | Type | Description |
---|---|---|
$tags | array | array of tags |
Type | Description |
---|---|
array | array of not matching cache ids (string) |
getMetadatas(string $id) : array
Return an array of metadatas for the given cache id
Name | Type | Description |
---|---|---|
$id | string | cache id |
Type | Description |
---|---|
array | array of metadatas (false if the cache id is not found) |
getOption(string $name) : mixed
Public frontend to get an option value
Name | Type | Description |
---|---|---|
$name | string | Name of the option |
Type | Description |
---|---|
mixed | option value |
Exception | Description |
---|---|
\Zend_Cache_Exception |
getTags() : array
Return an array of stored tags
Type | Description |
---|---|
array | array of stored tags (string) |
load(string $id, boolean $doNotTestCacheValidity = false, boolean $doNotUnserialize = false) : mixed | false
Test if a cache is available for the given id and (if yes) return it (false else)
Name | Type | Description |
---|---|---|
$id | string | Cache id |
$doNotTestCacheValidity | boolean | If set to true, the cache validity won't be tested |
$doNotUnserialize | boolean | Do not serialize (even if automatic_serialization is true) => for internal use |
Type | Description |
---|---|
mixed | false | Cached datas |
remove(string $id) : boolean
Remove a cache
Name | Type | Description |
---|---|---|
$id | string | Cache id to remove |
Type | Description |
---|---|
boolean | True if ok |
save(mixed $data, string $id = null, array $tags = array(), int $specificLifetime = false, int $priority = 8) : boolean
Save some data in a cache
Name | Type | Description |
---|---|---|
$data | mixed | Data to put in cache (can be another type than string if automatic_serialization is on) |
$id | string | Cache id (if not set, the last cache id will be used) |
$tags | array | Cache tags |
$specificLifetime | int | If != false, set a specific lifetime for this cache record (null => infinite lifetime) |
$priority | int | integer between 0 (very low priority) and 10 (maximum priority) used by some particular backends |
Type | Description |
---|---|
boolean | True if no problem |
Exception | Description |
---|---|
\Zend_Cache_Exception |
setBackend(\Zend_Cache_Backend $backendObject) : void
Set the backend
Name | Type | Description |
---|---|---|
$backendObject | \Zend_Cache_Backend |
Exception | Description |
---|---|
\Zend_Cache_Exception |
setConfig(\Zend_Config $config) : \Zend_Cache_Core
Set options using an instance of type Zend_Config
Name | Type | Description |
---|---|---|
$config | \Zend_Config |
Type | Description |
---|---|
\Zend_Cache_Core |
setLifetime(int $newLifetime) : void
Force a new lifetime
Name | Type | Description |
---|---|---|
$newLifetime | int | New lifetime (in seconds) |
setOption(string $name, mixed $value) : void
Public frontend to set an option
Name | Type | Description |
---|---|---|
$name | string | Name of the option |
$value | mixed | Value of the option |
Exception | Description |
---|---|
\Zend_Cache_Exception |
test(string $id) : int | false
Test if a cache is available for the given id
Name | Type | Description |
---|---|---|
$id | string | Cache id |
Type | Description |
---|---|
int | false | Last modified time of cache entry if it is available, false otherwise |