PHP Class Cachearium\Backend\CacheRAM

It's a very simple implementation. It's reasonably inneficient because it a 3-level array, but it does invalidation correctly. This is useful for data that is loaded many times in one execution but which may change constantly, or in servers that have no external cache support for a quick speedup.
Inheritance: extends Cachearium\CacheAbstract
Afficher le fichier Open project: corollarium/cachearium Class Usage Examples

Méthodes publiques

Méthode Description
__clone ( ) Prevent users to clone the instance
cleanP ( $base, $id )
clear ( )
delete ( CacheKey $k )
get ( CacheKey $k )
getData ( CacheKey $k ) (non-PHPdoc)
getMemoryLimit ( $memoryLimit )
increment ( $value, CacheKey $k, $default )
limitRAM ( ) : boolean Clears cache if PHP memory usage is above a chosen limit This checks the ENTIRE PHP memory usage, which may be a lot more than what is used by this backend.
prefetch ( $data ) (non-PHPdoc)
report ( )
setMemoryLimit ( integer $memoryLimit ) : CacheRAM
singleton ( ) : CacheRAM Cache constructor (this is a singleton).
store ( $data, CacheKey $k, $lifetime )

Méthodes protégées

Méthode Description
hashKey ( CacheKey $k )

Private Methods

Méthode Description
__construct ( ) Constructor.
checkValidArgs ( CacheKey $k )

Method Details

__clone() public méthode

Prevent users to clone the instance
public __clone ( )

cleanP() public méthode

public cleanP ( $base, $id )

clear() public méthode

public clear ( )

delete() public méthode

public delete ( CacheKey $k )
$k Cachearium\CacheKey

get() public méthode

public get ( CacheKey $k )
$k Cachearium\CacheKey

getData() public méthode

(non-PHPdoc)
public getData ( CacheKey $k )
$k Cachearium\CacheKey

getMemoryLimit() public méthode

public getMemoryLimit ( $memoryLimit )

hashKey() protected méthode

protected hashKey ( CacheKey $k )
$k Cachearium\CacheKey

increment() public méthode

public increment ( $value, CacheKey $k, $default )
$k Cachearium\CacheKey

limitRAM() public méthode

Clears cache if PHP memory usage is above a chosen limit This checks the ENTIRE PHP memory usage, which may be a lot more than what is used by this backend.
public limitRAM ( ) : boolean
Résultat boolean

prefetch() public méthode

(non-PHPdoc)
See also: CacheAbstract::prefetch()
public prefetch ( $data )

report() public méthode

public report ( )

setMemoryLimit() public méthode

public setMemoryLimit ( integer $memoryLimit ) : CacheRAM
$memoryLimit integer
Résultat CacheRAM

singleton() public static méthode

Cache constructor (this is a singleton).
public static singleton ( ) : CacheRAM
Résultat CacheRAM The cache singleton.

store() public méthode

public store ( $data, CacheKey $k, $lifetime )
$k Cachearium\CacheKey