\APICacheEngine

Abstract class for storage engine for caching

Summary

Methods
Properties
Constants
init()
gc()
write()
read()
delete()
clear()
settings()
$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 : 

settings of current engine instance

Type

Methods

init()

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

Iitialize the cache engine

Called automatically by the cache frontend

Parameters

mixed||string|int settings

Associative array of parameters 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 value for a 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) : 

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