Arbit - project tracking

Arbit - project tracking

API documentation :: Docs For Class arbitCache

Core::arbitCache

Class arbitCache

Arbit simple abstract cache handler Provides simple cache handling with support for TTL of cache items.

Arbit simple abstract cache handler Provides simple cache handling with support for TTL of cache items.

Author(s):
Version:   $Revision: 1236 $
License:   GPL

Descendants

Child Class Description
arbitFilesystemCache Arbit simple file based cache handler Provides simple cache handling with support for TTL of cache items.
arbitMemoryCache Arbit simple file based cache handler Provides simple cache handling with support for TTL of cache items.

Constants

INFINITE = -1 Infinite TTL, causes that the cache will never timeout itself.

Infinite TTL, causes that the cache will never timeout itself.

Member Variables

protected array $caches = array(
'dashboard' => array(
'path' => 'dashboard/',
'ttl' => self::INFINITE,
),'model'=>array('path'=>'model/','ttl'=>3600,),'translation'=>array('path'=>'translation/','ttl'=>self::INFINITE,),)

Array with caches and their configurations.

Array with caches and their configurations. Each cache has two directives, the directory it stores its contents in, and the time to live (TTL) in seconds.

Method Summary

public void addCache( $name , $path , [ $ttl = 3600] )
Add a new cache Add a new cache specified by its name. and you may optionally specify a TTL for cache items. to 3600 seconds (which is one hour).
public abstract void cache( $cache , $id , $item )
Cache item Cache item specified with a (hopefully unique) identifier in specified cache.
public abstract void clearCache( $cache )
Clear cache Clear the cache specified by the cache ID completely. be purged.
public abstract mixed get( $cache , $id )
Get cache item from cache by its ID
public array getCacheList( )
Get cache list
public abstract void purge( $cache , $id )
Remove item from cache Remove the item specified by its ID from the specified cache.

Methods

addCache

void addCache( string $name , string $path , [int $ttl = 3600] )

Add a new cache Add a new cache specified by its name. and you may optionally specify a TTL for cache items. to 3600 seconds (which is one hour).

Add a new cache Add a new cache specified by its name. Each cache requires a basepath and you may optionally specify a TTL for cache items. The TTL defaults to 3600 seconds (which is one hour). You may specify arbitCacheRegistry::getCache()->INFINITE as a TTL, so that the cache will never tie out.

Parameters:
Name Type Description
$name string
$path string
$ttl int

cache

void cache( string $cache , string $id , mixed $item )

Cache item Cache item specified with a (hopefully unique) identifier in specified cache.

Cache item Cache item specified with a (hopefully unique) identifier in specified cache. Cacheable are all PHP scalar values, arrays and all object implementing arbitCacheable, which especially means, that all arbitBaseStruct extending objects are cacheable.

Parameters:
Name Type Description
$cache string
$id string
$item mixed
Redefined in descendants as:
Method Description
arbitFilesystemCache::cache() Cache item Cache item specified with a (hopefully unique) identifier in specified cache. 
arbitMemoryCache::cache() Cache item Cache item specified with a (hopefully unique) identifier in specified cache. 

clearCache

void clearCache( string $cache )

Clear cache Clear the cache specified by the cache ID completely. be purged.

Clear cache Clear the cache specified by the cache ID completely. All contents will be purged.

Parameters:
Name Type Description
$cache string
Redefined in descendants as:
Method Description
arbitFilesystemCache::clearCache() Clear cache Clear the cache specified by the cache ID completely. be purged. 
arbitMemoryCache::clearCache() Clear cache Clear the cache specified by the cache ID completely. be purged. 

get

mixed get( string $cache , string $id )

Get cache item from cache by its ID

Get cache item from cache by its ID

Parameters:
Name Type Description
$cache string
$id string
Redefined in descendants as:
Method Description
arbitFilesystemCache::get() Get cache item from cache by its ID 
arbitMemoryCache::get() Get cache item from cache by its ID 

getCacheList

array getCacheList( )

Get cache list

Get cache list Get list of registered caches

purge

void purge( string $cache , string $id )

Remove item from cache Remove the item specified by its ID from the specified cache.

Remove item from cache Remove the item specified by its ID from the specified cache.

Parameters:
Name Type Description
$cache string
$id string
Redefined in descendants as:
Method Description
arbitFilesystemCache::purge() Remove item from cache Remove the item specified by its ID from the specified cache. 
arbitMemoryCache::purge() Remove item from cache Remove the item specified by its ID from the specified cache. 
Documentation generated on Mon, 05 Apr 2010 14:01:38 +0200 by phpDocumentor 1.4.3