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_ZendServer

 Methods

Constructor

__construct(array $options = array()

Parameters

$options

array

associative array of options

Exceptions

\Zend_Cache_Exception

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
Inherited

Available modes are : 'all' (default) => remove all cache entries ($tags is not used) 'old' => unsupported 'matchingTag' => unsupported 'notMatchingTag' => unsupported 'matchingAnyTag' => unsupported

inherited_from \Zend_Cache_Backend_Interface::clean()

Parameters

$mode

string

clean mode

$tags

array

array of tags

Exceptions

\Zend_Cache_Exception

Returns

booleantrue if no problem

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

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
Inherited

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

stringcached datas (or false)

Remove a cache record

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

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
Inherited

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 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) : mixed
Inherited
inherited_from \Zend_Cache_Backend_Interface::test()

Parameters

$id

string

cache id

Exceptions

\Zend_Cache_Exception

Returns

mixedfalse (a cache is not available) or "last modified" timestamp (int) of the available cache record

Clear cache

_clear() 
inherited_from \Zend_Cache_Backend_ZendServer::_clear()

Clear cache

_clear() 
Inherited

Fetch data

_fetch(string $id) : mixed | null
inherited_from \Zend_Cache_Backend_ZendServer::_fetch()

Parameters

$id

string

Cache id

Returns

mixednull

Fetch data

_fetch(string $id) 
Inherited

Parameters

$id

string

Cache id

Exceptions

\Zend_Cache_Exception

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

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

Store data

_store(mixed $data, string $id, integer $timeToLive) : boolean
inherited_from \Zend_Cache_Backend_ZendServer::_store()

Parameters

$data

mixed

Object to store

$id

string

Cache id

$timeToLive

integer

Time to live in seconds

Returns

booleantrue if no problem

Store data

_store(mixed $data, string $id, integer $timeToLive) 
Inherited

Parameters

$data

mixed

Object to store

$id

string

Cache id

$timeToLive

integer

Time to live in seconds

Exceptions

\Zend_Cache_Exception

Unset data

_unset(string $id) : boolean
inherited_from \Zend_Cache_Backend_ZendServer::_unset()

Parameters

$id

string

Cache id

Returns

booleantrue if no problem

Unset data

_unset(string $id) 
Inherited

Parameters

$id

string

Cache id

Compute & return the expire time

_expireTime($lifetime) : integer
Inherited

Parameters

$lifetime

Returns

integerexpire time (unix timestamp)

 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
 

Available options

$_options : array

Default

array()