Unless otherwise marked, all options in this class affect all adapters.

package Default
inherited_from \Zend\Cache\Storage\Adapter\AdapterOptions

 Methods

Constructor

__construct(array|\Traversable|null $options = null
Inherited

Parameters

$options

array\Traversablenull

Get a configuration property

__get(string $key) : mixed
Inherited
see
inherited_from \Zend\Stdlib\ParameterObjectInterface::__get()

Parameters

$key

string

Exceptions

\Zend\Stdlib\Exception\BadMethodCallException

Returns

mixed

Test if a configuration property is null

__isset(string $key) : boolean
Inherited
see
inherited_from \Zend\Stdlib\ParameterObjectInterface::__isset()

Parameters

$key

string

Returns

boolean

Set a configuration property

__set(string $key, mixed $value) : void
Inherited
see
inherited_from \Zend\Stdlib\ParameterObjectInterface::__set()

Parameters

$key

string

$value

mixed

Exceptions

\Zend\Stdlib\Exception\BadMethodCallException

Set a configuration property to NULL

__unset(string $key) : void
Inherited
see
inherited_from \Zend\Stdlib\ParameterObjectInterface::__unset()

Parameters

$key

string

Exceptions

\Zend\Stdlib\Exception\InvalidArgumentException

Get resource database number

getDatabase() : integer

Returns

integerDatabase number

Get key pattern

getKeyPattern() : string
Inherited

Returns

string

Get redis options

getLibOptions() : array

Get namespace

getNamespace() : string
Inherited

Returns

string

Get namespace separator

getNamespaceSeparator() : string

Returns

string

Get resource password

getPassword() : string

Returns

string

Get the persistent id

getPersistentId() : string

Returns

string

If reading data from cache enabled.

getReadable() : boolean
Inherited

Returns

boolean

Get the redis resource id

getResourceId() : string

Returns

string

Get the redis resource manager

getResourceManager() : \Zend\Cache\Storage\Adapter\RedisResourceManager

Returns

\Zend\Cache\Storage\Adapter\RedisResourceManager

Get server

getServer() : array

Returns

arrayarray('host' => [, 'port' => [, 'timeout' => ]])

Get time to live.

getTtl() : float
Inherited

Returns

float

If writing data to cache enabled.

getWritable() : boolean
Inherited

Returns

boolean

Adapter using this instance

setAdapter(\Zend\Cache\Storage\StorageInterface|null $adapter = null) : \Zend\Cache\Storage\Adapter\AdapterOptions
Inherited

Parameters

$adapter

\Zend\Cache\Storage\StorageInterfacenull

Returns

\Zend\Cache\Storage\Adapter\AdapterOptions

Set resource database number

setDatabase(integer $database) : \Zend\Cache\Storage\Adapter\RedisOptions

Parameters

$database

integer

Database number

Returns

\Zend\Cache\Storage\Adapter\RedisOptions

Set one or more configuration properties

setFromArray(array|\Traversable|\Zend\Stdlib\AbstractOptions $options) : \Zend\Stdlib\AbstractOptions
Inherited

Parameters

$options

array\Traversable\Zend\Stdlib\AbstractOptions

Exceptions

\Zend\Stdlib\Exception\InvalidArgumentException

Returns

\Zend\Stdlib\AbstractOptionsProvides fluent interface

Set key pattern

setKeyPattern(null|string $keyPattern) : \Zend\Cache\Storage\Adapter\AdapterOptions
Inherited

Parameters

$keyPattern

nullstring

Exceptions

\Zend\Cache\Exception\InvalidArgumentException

Returns

\Zend\Cache\Storage\Adapter\AdapterOptions

Set redis options

setLibOptions(array $libOptions) : \Zend\Cache\Storage\Adapter\RedisOptions
link http://github.com/nicolasff/phpredis#setoption

Parameters

$libOptions

array

Returns

\Zend\Cache\Storage\Adapter\RedisOptions

Set namespace.

setNamespace(string $namespace) : \Zend\Cache\Storage\Adapter\RedisOptions

The option Redis::OPT_PREFIX will be used as the namespace. It can't be longer than 128 characters.

see
see
inherited_from \Zend\Cache\Storage\Adapter\AdapterOptions::setNamespace()

Parameters

$namespace

string

Prefix for each key stored in redis

Returns

\Zend\Cache\Storage\Adapter\RedisOptions

Set namespace.

setNamespace(string $namespace) : \Zend\Cache\Storage\Adapter\AdapterOptions
Inherited

Parameters

$namespace

string

Returns

\Zend\Cache\Storage\Adapter\AdapterOptions

Set namespace separator

setNamespaceSeparator(string $namespaceSeparator) : \Zend\Cache\Storage\Adapter\RedisOptions

Parameters

$namespaceSeparator

string

Returns

\Zend\Cache\Storage\Adapter\RedisOptions

Set resource password

setPassword(string $password) : \Zend\Cache\Storage\Adapter\RedisOptions

Parameters

$password

string

Password

Returns

\Zend\Cache\Storage\Adapter\RedisOptions

Set the persistent id

setPersistentId(string $persistentId) : \Zend\Cache\Storage\Adapter\RedisOptions

Parameters

$persistentId

string

Returns

\Zend\Cache\Storage\Adapter\RedisOptions

Enable/Disable reading data from cache.

setReadable(boolean $readable) : \Zend\Cache\Storage\Adapter\AbstractAdapter
Inherited

Parameters

$readable

boolean

Returns

\Zend\Cache\Storage\Adapter\AbstractAdapter

Set the redis resource id

setResourceId(string $resourceId) : \Zend\Cache\Storage\Adapter\RedisOptions

Parameters

$resourceId

string

Returns

\Zend\Cache\Storage\Adapter\RedisOptions

Set the redis resource manager to use

setResourceManager(null|\Zend\Cache\Storage\Adapter\RedisResourceManager $resourceManager = null) : \Zend\Cache\Storage\Adapter\RedisOptions

Parameters

$resourceManager

null\Zend\Cache\Storage\Adapter\RedisResourceManager

Returns

\Zend\Cache\Storage\Adapter\RedisOptions

Set server

setServer(string|array $server) : \Zend\Cache\Storage\Adapter\RedisOptions

Server can be described as follows:

  • URI: /path/to/sock.sock
  • Assoc: array('host' => [, 'port' => [, 'timeout' => ]])
  • List: array([, , [, ]])

Parameters

$server

stringarray

Returns

\Zend\Cache\Storage\Adapter\RedisOptions

Set time to live.

setTtl(integer|float $ttl) : \Zend\Cache\Storage\Adapter\AdapterOptions
Inherited

Parameters

$ttl

integerfloat

Returns

\Zend\Cache\Storage\Adapter\AdapterOptions

Enable/Disable writing data to cache.

setWritable(boolean $writable) : \Zend\Cache\Storage\Adapter\AdapterOptions
Inherited

Parameters

$writable

boolean

Returns

\Zend\Cache\Storage\Adapter\AdapterOptions

Cast to array

toArray() : array
Inherited

Returns

array

Validates and normalize a TTL.

normalizeTtl(integer|float $ttl) : void
Inherited

Parameters

$ttl

integerfloat

Exceptions

\Zend\Cache\Exception\InvalidArgumentException

Triggers an option event if this options instance has a connection to an adapter implements EventsCapableInterface.

triggerOptionEvent(string $optionName, mixed $optionValue) : void
Inherited

Parameters

$optionName

string

$optionValue

mixed

 Properties

 

We use the __ prefix to avoid collisions with properties in user-implementations.

$__strictMode__ : boolean

Default

true
 

The adapter using these options

$adapter : null | \Zend\Cache\Storage\StorageInterface

Default

 

Validate key against pattern

$keyPattern : string

Default

''
 

Namespace option

$namespace : string

Default

'zfcache'
 

The namespace separator

$namespaceSeparator : string

Default

':'
 

Readable option

$readable : boolean

Default

true
 

The resource id of the resource manager

$resourceId : string

Default

'default'
 

The redis resource manager

$resourceManager : null | \Zend\Cache\Storage\Adapter\RedisResourceManager

Default

 

TTL option

$ttl : integer | float

Default

0
 

Writable option

$writable : boolean

Default

true