PHP Класс Prado\Caching\TEACache

* * By definition, cache does not ensure the existence of a value * even if it never expires. Cache is not meant to be an persistent storage. * * To use this module, the eAccelerator PHP extension must be loaded and enabled * * Please note that as of v0.9.6, eAccelerator no longer supports data caching. * This means if you still want to use this component, your eAccelerator should be of 0.9.5.x or lower version. * * Some usage examples of TEACache are as follows, * * $cache=new TEACache; // TEACache may also be loaded as a Prado application module * $cache->init(null); * $cache->add('object',$object); * $object2=$cache->get('object'); * * * If loaded, TEACache will register itself with {@link TApplication} as the * cache module. It can be accessed via {@link TApplication::getCache()}. * * TEACache may be configured in application configuration file as follows * * * * * @author Dario Rigolin * @package Prado\Caching * @since 3.2.2
Наследование: extends TCache
Показать файл Открыть проект

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

Метод Описание
flush ( ) * Deletes all values from cache.
init ( $config ) * Initializes this module.

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

Метод Описание
addValue ( $key, $value, $expire ) : boolean * Stores a value identified by a key into cache if the cache does not contain this key.
deleteValue ( $key ) : boolean * Deletes a value with the specified key from cache * This is the implementation of the method declared in the parent class.
getValue ( $key ) : string * Retrieves a value from cache with a specified key.
setValue ( $key, $value, $expire ) : boolean * Stores a value identified by a key in cache.

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

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

* This is the implementation of the method declared in the parent class. * * @param string the key identifying the value to be cached * @param string the value to be cached * @param integer the number of seconds in which the cached value will expire. 0 means never expire. * @return boolean true if the value is successfully stored into cache, false otherwise
protected addValue ( $key, $value, $expire ) : boolean
Результат boolean

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

* @param string the key of the value to be deleted * @return boolean if no error happens during deletion
protected deleteValue ( $key ) : boolean
Результат boolean

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

* Be careful of performing this operation if the cache is shared by multiple applications.
public flush ( )

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

* This is the implementation of the method declared in the parent class. * @param string a unique key identifying the cached value * @return string the value stored in cache, false if the value is not in the cache or expired.
protected getValue ( $key ) : string
Результат string

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

* This method is required by the IModule interface. * @param TXmlElement configuration for this module, can be null * @throws TConfigurationException if eaccelerator extension is not installed or not started, check your php.ini
public init ( $config )

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

* This is the implementation of the method declared in the parent class. * * @param string the key identifying the value to be cached * @param string the value to be cached * @param integer the number of seconds in which the cached value will expire. 0 means never expire. * @return boolean true if the value is successfully stored into cache, false otherwise
protected setValue ( $key, $value, $expire ) : boolean
Результат boolean