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.

__construct(
array|\Zend_Config $options
=
array
)
:
void
Constructor
Inherited from: \Zend_Cache_Core::__construct()Name | Type | Description |
---|---|---|
$options | array|\Zend_Config | Associative array of options or Zend_Config instance |
Exception | Description |
---|---|
\Zend_Cache_Exception |

_flush(
string $data
)
:
string
callback for output buffering (shouldn't really be called manually)
Name | Type | Description |
---|---|---|
$data | string | Buffered output |
Type | Description |
---|---|
string | Data to send to browser |

_id(
string $id
)
:
string
Make and return a cache id
Inherited from: \Zend_Cache_Core::_id()Checks 'cache_id_prefix' and returns new id with prefix or simply the id if null
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.
Inherited from: \Zend_Cache_Core::_log()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.
Inherited from: \Zend_Cache_Core::_loggerSanity()Create a default log object if none is set.
Exception | Description |
---|---|
\Zend_Cache_Exception |

_setOption(
string $name, mixed $value
)
:
void
Set an option
Inherited from: \Zend_Cache_Core::_setOption()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...)
Inherited from: \Zend_Cache_Core::_validateIdOrTag()Throw an exception if a problem is found
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...)
Inherited from: \Zend_Cache_Core::_validateTagsArray()Throw an exception if a problem is found
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
Inherited from: \Zend_Cache_Core::clean()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)
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
Inherited from: \Zend_Cache_Core::getBackend()Type | Description |
---|---|
\Zend_Cache_Backend | backend object |

getFillingPercentage(
)
:
int
Return the filling percentage of the backend storage
Inherited from: \Zend_Cache_Core::getFillingPercentage()Type | Description |
---|---|
int | integer between 0 and 100 |

getIds(
)
:
array
Return an array of stored cache ids
Inherited from: \Zend_Cache_Core::getIds()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
Inherited from: \Zend_Cache_Core::getIdsMatchingAnyTags()In case of multiple tags, a logical OR is made between 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
Inherited from: \Zend_Cache_Core::getIdsMatchingTags()In case of multiple tags, a logical AND is made between 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
Inherited from: \Zend_Cache_Core::getIdsNotMatchingTags()In case of multiple tags, a logical OR is made between 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
Inherited from: \Zend_Cache_Core::getMetadatas()The array will include these keys : - expire : the expire timestamp - tags : a string array of tags - mtime : timestamp of last modification time
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
Inherited from: \Zend_Cache_Core::getOption()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
Inherited from: \Zend_Cache_Core::getTags()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)
Inherited from: \Zend_Cache_Core::load()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 |
---|---|
mixedfalse | Cached datas |

remove(
string $id
)
:
boolean
Remove a cache
Inherited from: \Zend_Cache_Core::remove()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
Inherited from: \Zend_Cache_Core::save()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
Inherited from: \Zend_Cache_Core::setBackend()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
Inherited from: \Zend_Cache_Core::setConfig()
setLifetime(
int $newLifetime
)
:
void
Force a new lifetime
Inherited from: \Zend_Cache_Core::setLifetime()The new value is set for the core/frontend but for the backend too (directive)
Name | Type | Description |
---|---|---|
$newLifetime | int | New lifetime (in seconds) |

setOption(
string $name, mixed $value
)
:
void
Public frontend to set an option
Inherited from: \Zend_Cache_Core::setOption()There is an additional validation (relatively to the protected _setOption method)
Name | Type | Description |
---|---|---|
$name | string | Name of the option |
$value | mixed | Value of the option |
Exception | Description |
---|---|
\Zend_Cache_Exception |

start(
string $id, $tags, $extension
=
null
)
:
mixed
Start the cache
Name | Type | Description |
---|---|---|
$id | string | Cache id |
$tags | ||
$extension |
Type | Description |
---|---|
mixed | True if the cache is hit (false else) with $echoData=true (default) ; string else (datas) |

test(
string $id
)
:
int|false
Test if a cache is available for the given id
Inherited from: \Zend_Cache_Core::test()Name | Type | Description |
---|---|---|
$id | string | Cache id |
Type | Description |
---|---|
intfalse | Last modified time of cache entry if it is available, false otherwise |

touch(
string $id, int $extraLifetime
)
:
boolean
Give (if possible) an extra lifetime to the given cache id
Inherited from: \Zend_Cache_Core::touch()Name | Type | Description |
---|---|---|
$id | string | cache id |
$extraLifetime | int |
Type | Description |
---|---|
boolean | true if ok |