Class TEACache
TEACache class
TEACache implements a cache application module based on eAccelerator.
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 TApplication
as the
cache module. It can be accessed via TApplication::getCache()
.
TEACache may be configured in application configuration file as follows
<module id="cache" class="System.Caching.TEACache" />
- TComponent
-
TApplicationComponent
-
TModule implements IModule
-
TCache implements ICache, ArrayAccess
-
TEACache
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Dario Rigolin <drigolin@e-portaltech.it>
Since: 3.2.2
Located at Caching/TEACache.php
public
|
#
init(
Initializes this module. This method is required by the IModule interface. |
protected
string
|
#
getValue( string $key )
Retrieves a value from cache with a specified key. This is the implementation of the method declared in the parent class. |
protected
boolean
|
#
setValue( string $key, string $value, integer $expire )
Stores a value identified by a key in cache. This is the implementation of the method declared in the parent class. |
protected
boolean
|
#
addValue( string $key, string $value, integer $expire )
Stores a value identified by a key into cache if the cache does not contain this key. This is the implementation of the method declared in the parent class. |
protected
boolean
|
#
deleteValue( string $key )
Deletes a value with the specified key from cache This is the implementation of the method declared in the parent class. |
public
|
#
flush( )
Deletes all values from cache. Be careful of performing this operation if the cache is shared by multiple applications. |
add(),
delete(),
generateUniqueKey(),
get(),
getKeyPrefix(),
getPrimaryCache(),
offsetExists(),
offsetGet(),
offsetSet(),
offsetUnset(),
set(),
setKeyPrefix(),
setPrimaryCache()
|
getID(),
setID()
|
getApplication(),
getRequest(),
getResponse(),
getService(),
getSession(),
getUser(),
publishAsset(),
publishFilePath()
|
GLOBAL_RAISE_EVENT_LISTENER
|