package Zend_Cache
subpackage Zend_Cache_Backend
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Cache_Backend

 Methods

Constructor

__construct(array $options = array()
Inherited

Parameters

$options

array

Associative array of options

Clean some cache records

clean(string $mode = \Zend_Cache::CLEANING_MODE_ALL, array $tags = array()) : boolean

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)

inherited_from \Zend_Cache_Backend_Interface::clean()

Parameters

$mode

string

Clean mode

$tags

array

Array of tags

Exceptions

\Zend_Exception

Returns

booleantrue if no problem

Get the Inner Cache if set

getInnerCache() : \Zend_Cache_Core

Returns

\Zend_Cache_Core

Get the life time

getLifetime(integer $specificLifetime) : integer
Inherited

if $specificLifetime is not false, the given specific life time is used else, the global lifetime is used

Parameters

$specificLifetime

integer

Returns

integerCache life time

Retrieve any option via interception of the parent's statically held options including the local option for a tag cache.

getOption(string $name) : mixed
inherited_from \Zend_Cache_Backend::getOption()

Parameters

$name

string

Returns

mixed

Returns an option

getOption(string $name) : mixed
Inherited

Parameters

$name

string

Optional, the options name to return

Exceptions

\Zend_Cache_Exceptions

Returns

mixed

Determine system TMP directory and detect if we have read access

getTmpDir() : string
Inherited

inspired from Zend_File_Transfer_Adapter_Abstract

Exceptions

\Zend_Cache_Exception if unable to determine directory

Returns

string

Return true if the automatic cleaning is available for the backend

isAutomaticCleaningAvailable() : boolean
Inherited

DEPRECATED : use getCapabilities() instead

deprecated

Returns

boolean

Test if a cache is available for the given id and (if yes) return it (false else)

load(string $id, boolean $doNotTestCacheValidity = false) : string | false

Note : return value is always "string" (unserialization is done by the core not by the backend)

inherited_from \Zend_Cache_Backend_Interface::load()

Parameters

$id

string

Cache id

$doNotTestCacheValidity

boolean

If set to true, the cache validity won't be tested

Returns

stringfalsecached datas

Remove a cache record

remove(string $id) : boolean
inherited_from \Zend_Cache_Backend_Interface::remove()

Parameters

$id

string

Cache id

Returns

booleanTrue if no problem

Remove a cache record recursively for the given directory matching a REQUEST_URI based relative path (deletes the actual file matching this in addition to the matching directory)

removeRecursively(string $id) : boolean

Parameters

$id

string

Cache id

Returns

booleanTrue if no problem

Save some string datas into a cache record

save(string $data, string $id, array $tags = array(), integer $specificLifetime = false) : boolean

Note : $data is always "string" (serialization is done by the core not by the backend)

inherited_from \Zend_Cache_Backend_Interface::save()

Parameters

$data

string

Datas to cache

$id

string

Cache id

$tags

array

Array of strings, the cache record will be tagged by each string entry

$specificLifetime

integer

If != false, set a specific lifetime for this cache record (null => infinite lifetime)

Returns

booleantrue if no problem

Set the frontend directives

setDirectives(array $directives) : void
Inherited

Parameters

$directives

array

Assoc of directives

Exceptions

\Zend_Cache_Exception

Set an Inner Cache, used here primarily to store Tags associated with caches created by this backend. Note: If Tags are lost, the cache should be completely cleaned as the mapping of tags to caches will have been irrevocably lost.

setInnerCache(\Zend_Cache_Core $cache) : void

Parameters

$cache

Interceptor child method to handle the case where an Inner Cache object is being set since it's not supported by the standard backend interface

setOption(string $name, mixed $value) : \Zend_Cache_Backend_Static
inherited_from \Zend_Cache_Backend::setOption()

Parameters

$name

string

$value

mixed

Returns

\Zend_Cache_Backend_Static

Set an option

setOption(string $name, mixed $value) : void
Inherited

Parameters

$name

string

$value

mixed

Exceptions

\Zend_Cache_Exception

Test if a cache is available or not (for the given id)

test(string $id) : boolean
inherited_from \Zend_Cache_Backend_Interface::test()

Parameters

$id

string

cache id

Returns

boolean

Recursively create the directories needed to write the static file

_createDirectoriesFor($path) 

Parameters

$path

Decode a request URI from the provided ID

_decodeId(string $id) : string

Parameters

$id

string

Returns

string

Determine the page to save from the request

_detectId() : string

Returns

string

Verify if the given temporary directory is readable and writable

_isGoodTmpDir(string $dir) : boolean
Inherited

Parameters

$dir

string

temporary directory

Returns

booleantrue if the directory is ok

Detect serialization of data (cannot predict since this is the only way to obey the interface yet pass in another parameter).

_isSerialized($data) 

In future, ZF 2.0, check if we can just avoid the interface restraints.

This format is the only valid one possible for the class, so it's simple to just run a regular expression for the starting serialized format.

Parameters

$data

Log a message at the WARN (4) priority.

_log(string $message, integer $priority = 4) : void
Inherited

Parameters

$message

string

$priority

integer

Make sure if we enable logging that the Zend_Log class is available.

_loggerSanity() : void
Inherited

Create a default log object if none is set.

Exceptions

\Zend_Cache_Exception

Detect an octal string and return its octal value for file permission ops otherwise return the non-string (assumed octal or decimal int already)

_octdec(string $val) : integer

Parameters

$val

string

The potential octal in need of conversion

Returns

integer

Validate a cache id or a tag (security, reliable filenames, reserved prefixes.

_validateIdOrTag(string $string) : void
Static

..)

Throw an exception if a problem is found

deprecated Not usable until perhaps ZF 2.0

Parameters

$string

string

Cache id or tag

Exceptions

\Zend_Cache_Exception

Verify path exists and is non-empty

_verifyPath(string $path) : boolean

Parameters

$path

string

Returns

boolean

 Properties

 

Frontend or Core directives

$_directives : array

Default

array('lifetime' => 3600, 'logging' => false, 'logger' => null)

=====> (int) lifetime :

  • Cache lifetime (in seconds)
  • If null, the cache is valid forever

=====> (int) logging :

  • if set to true, a logging is activated throw Zend_Log
 

Static backend options

$_options : array

Default

array('public_dir' => null, 'sub_dir' => 'html', 'file_extension' => '.html', 'index_filename' => 'index', 'file_locking' => true, 'cache_file_perm' => 384, 'cache_directory_perm' => 448, 'debug_header' => false, 'tag_cache' => null, 'disable_caching' => false)
inherited_from \Zend_Cache_Backend::_options
 

Available options

$_options : array

Default

array()
 

Cache for handling tags

$_tagCache : \Zend_Cache_Core

Default

null
 

Tagged items

$_tagged : array

Default

null

 Constants

 

INNER_CACHE_NAME

INNER_CACHE_NAME = 'zend_cache_backend_static_tagcache'