ZenMagick 0.9.6


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 1966 2009-02-14 10:52:50Z dermanomann $

Field Summary
final mixed

PERSISTENT

final mixed

TRANSIENT

Method Summary
boolean

clear()

Clear the 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

Field Detail

PERSISTENT

public final mixed PERSISTENT = 'persistent'

TRANSIENT

public final mixed TRANSIENT = 'transient'

Method Detail

clear

public boolean clear()

Clear the cache.

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

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

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.

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