PHP Класс 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.
Наследование: extends Cachearium\CacheAbstract
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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 )

Защищенные методы

Метод Описание
hashKey ( CacheKey $k )

Приватные методы

Метод Описание
__construct ( ) Constructor.
checkValidArgs ( CacheKey $k )

Описание методов

__clone() публичный Метод

Prevent users to clone the instance
public __clone ( )

cleanP() публичный Метод

public cleanP ( $base, $id )

clear() публичный Метод

public clear ( )

delete() публичный Метод

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

get() публичный Метод

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

getData() публичный Метод

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

getMemoryLimit() публичный Метод

public getMemoryLimit ( $memoryLimit )

hashKey() защищенный Метод

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

increment() публичный Метод

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

limitRAM() публичный Метод

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
Результат boolean

prefetch() публичный Метод

(non-PHPdoc)
См. также: CacheAbstract::prefetch()
public prefetch ( $data )

report() публичный Метод

public report ( )

setMemoryLimit() публичный Метод

public setMemoryLimit ( integer $memoryLimit ) : CacheRAM
$memoryLimit integer
Результат CacheRAM

singleton() публичный статический Метод

Cache constructor (this is a singleton).
public static singleton ( ) : CacheRAM
Результат CacheRAM The cache singleton.

store() публичный Метод

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