\Pop\Cache\AdapterRedis

Redis cache adapter class

Summary

Methods
Properties
Constants
__construct()
setTtl()
getTtl()
getItemTtl()
saveItem()
getItem()
hasItem()
deleteItem()
clear()
destroy()
redis()
getVersion()
No public properties found
No constants found
No protected methods found
$ttl
$redis
N/A
No private methods found
No private properties found
N/A

Properties

$ttl

$ttl : integer

Global time-to-live

Type

integer

$redis

$redis : \Redis

Redis object

Type

\Redis

Methods

__construct()

__construct(integer  $ttl, string  $host = 'localhost', integer  $port = 6379) 

Constructor

Instantiate the memcache cache object

Parameters

integer $ttl
string $host
integer $port

Throws

\Pop\Cache\Adapter\Exception

setTtl()

setTtl(integer  $ttl) : \Pop\Cache\Adapter\AbstractAdapter

Set the global time-to-live for the cache adapter

Parameters

integer $ttl

Returns

\Pop\Cache\Adapter\AbstractAdapter

getTtl()

getTtl() : integer

Get the global time-to-live for the cache object

Returns

integer

getItemTtl()

getItemTtl(string  $id) : integer

Get the time-to-live for an item in cache

Parameters

string $id

Returns

integer

saveItem()

saveItem(string  $id, mixed  $value, integer  $ttl = null) : \Pop\Cache\Adapter\Redis

Save an item to cache

Parameters

string $id
mixed $value
integer $ttl

Returns

\Pop\Cache\Adapter\Redis

getItem()

getItem(string  $id) : mixed

Get an item from cache

Parameters

string $id

Returns

mixed

hasItem()

hasItem(string  $id) : boolean

Determine if the item exist in cache

Parameters

string $id

Returns

boolean

deleteItem()

deleteItem(string  $id) : \Pop\Cache\Adapter\Redis

Delete a value in cache

Parameters

string $id

Returns

\Pop\Cache\Adapter\Redis

redis()

redis() : \Redis

Get the redis object.

Returns

\Redis

getVersion()

getVersion() : string

Get the current version of redis.

Returns

string