\APICacheFile

File Storage engine for cache

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 : mixed||string|int

settings path = absolute path to cache directory, default => CACHE prefix = string prefix for filename, default => api_ lock = enable file locking on write, default => false serialize = serialize the data, 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

Permanently remove all expired and deleted data

Returns

True if garbage collection was successful, false on failure

write()

write(  key,   data = null,   duration = null) : 

Write data for key into cache

Parameters

key

Identifier for the data

data

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 = true) : 

Delete all values from the cache

Parameters

check

Optional - only delete expired cache items

Returns

True if the cache was successfully cleared, false otherwise

settings()

settings() : mixed||string|int

Cache Engine settings

Returns

mixed||string|int —

settings