\APICacheMemcache

Memcache storage engine for cache

Summary

Methods
Properties
Constants
init()
gc()
write()
read()
delete()
clear()
settings()
connect()
$settings
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$settings

$settings : mixed||string|int

settings servers = string or array of memcache servers, default => 127.0.0.1 compress = boolean, default => false

Type

mixed||string|int —

Methods

init()

init(mixed||string|int  settings = array()) : 

Initialize the Cache Engine

Called automatically by the cache frontend To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());

Parameters

mixed||string|int settings

array of setting for the engine

Returns

True if the engine has been successfully initialized, false if not

gc()

gc() : 

Garbage collection

Permanently remove all expired and deleted data

Returns

write()

write(  key,   value,   duration = null) : 

Write data for key into cache

Parameters

key

Identifier for the data

value

Data to be cached

duration

How long to cache the data, in seconds

Returns

True if the data was successfully cached, false on failure

read()

read(  key) : 

Read a key from the cache

Parameters

key

Identifier for the data

Returns

The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it

delete()

delete(  key) : 

Delete a key from the cache

Parameters

key

Identifier for the data

Returns

True if the value was successfully deleted, false if it didn't exist or couldn't be removed

clear()

clear(  check = null) : 

Delete all keys from the cache

Parameters

check

if true will check expiration, otherwise delete all

Returns

True if the cache was successfully cleared, false otherwise

settings()

settings() : mixed||string|int

Cache Engine settings

Returns

mixed||string|int —

settings

connect()

connect(  host,   port = 11211) : 

Connects to a server in connection pool

Parameters

host

host ip address or name

port

Server port

Returns

True if memcache server was connected