ZenMagick 0.9.8


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

Interface ZMCache

ZMCache

public interface ZMCache

Generic cache interface.

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

Author:
DerManoMann
Version:
$Id: ZMCache.php 2610 2009-11-20 02:45:25Z dermanomann $

Field Summary
final str

PERSISTENT

Cache type persistent.

final str

TRANSIENT

Cache type 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

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

PERSISTENT

public final str PERSISTENT = 'persistent'

Cache type persistent.


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

TRANSIENT

public final str TRANSIENT = 'transient'

Cache type transient.


Method Detail

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

clear

public boolean clear()

Clear the cache.

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

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

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 53

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 91

lastModified

public int lastModified()

Return the caches last modification time

Returns:
last modification time

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

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 75

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 84

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