ZenMagick 0.9.2


org.zenmagick.cache.ZMCache

Interface ZMCache

ZMCache

public interface ZMCache

Generic cache interface.

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

Author:
DerManoMann
Version:
$Id: ZMCache.php 1420 2008-08-17 21:44:10Z DerManoMann $

Method Summary
boolean

clear()

Clear the cache.

string

get(string id)

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

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

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

Method Detail

clear

public boolean clear()

Clear the cache.

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

get

public string get(string id)

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

Parameters:
id - The cache id.
Returns:
Data of the cache (else : false)

init

public void init(string group, array config)

Init the instance.

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

isAvailable

public boolean isAvailable()

Check if this cache instance is available.

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

lastModified

public int lastModified()

Return the caches last modification time

Returns:
last modification time

remove

public void remove(string id)

Remove the cache entry for the given id.

Parameters:
id - The cache id.

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.2