ZenMagick 0.9.11


org.zenmagick.core.services.cache\ZMCache
core\services\cache\ZMCache.php at line 32

Interface ZMCache

ZMCache

public interface ZMCache

Generic cache interface.

Instances may be obtained by using ZMCaches::instance()->getCache(..).

Author:
DerManoMann

Constant Summary
final static str

PERSISTENT

Cache type persistent.

final static str

TRANSIENT

Cache type transient.

Method Summary
boolean

clear()

Clear the cache.

array

getStats()

Return some stats and info abuot this cache.

void

init(string group, array config)

Init the instance.

boolean

isAvailable()

Check if this cache instance is available.

int

lastModified()

Return the caches last modification time

string

lookup(string id)

Test if a valid cache entry exists and, if it does, return it

void

remove(string id)

Remove the cache entry for the given id.

boolean

save(mixed data, string id)

Save some data in a cache file

Constant Detail

core\services\cache\ZMCache.php at line 34

PERSISTENT

public final static str PERSISTENT = 'org.zenmagick.core.services.cache.type.persistent'

Cache type persistent.


core\services\cache\ZMCache.php at line 36

TRANSIENT

public final static str TRANSIENT = 'org.zenmagick.core.services.cache.type.transient'

Cache type transient.


Method Detail

core\services\cache\ZMCache.php at line 59

clear

public boolean clear()

Clear the cache.

Returns:
true if cache cleared, false if the call failed.

core\services\cache\ZMCache.php at line 97

getStats

public array getStats()

Return some stats and info abuot this cache.

Returns:
Map of stuff.

core\services\cache\ZMCache.php at line 45

init

public void init(string group, array config)

Init the instance.

Parameters:
group - The cache group/class.
config - Configuration.

core\services\cache\ZMCache.php at line 52

isAvailable

public boolean isAvailable()

Check if this cache instance is available.

Returns:
true if this cache is ready to be used.

core\services\cache\ZMCache.php at line 90

lastModified

public int lastModified()

Return the caches last modification time

Returns:
last modification time

core\services\cache\ZMCache.php at line 67

lookup

public string lookup(string id)

Test if a valid cache entry exists and, if it does, return it

Parameters:
id - The cache id.
Returns:
Cache data or false.

core\services\cache\ZMCache.php at line 74

remove

public void remove(string id)

Remove the cache entry for the given id.

Parameters:
id - The cache id.

core\services\cache\ZMCache.php at line 83

save

public boolean save(mixed data, string id)

Save some data in a cache file

Parameters:
data - The data to be put in cache.
id - The cache id.
Returns:
true if saved, false if not.

ZenMagick 0.9.11