Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml


Classes:
Keyword

Interface ICache


ICache interface.

This interface must be implemented by cache managers.

Since: 3.0
Author: Qiang Xue <qiang.xue@gmail.com>

Method Summary
boolean
add ( string $id, mixed $value, integer $expire, ICacheDependency $dependency)
Stores a value identified by a key into cache if the cache does not contain this key.
boolean
delete ( string $id)
Deletes a value with the specified key from cache
void
flush ()
Deletes all values from cache.
mixed
get ( string $id)
Retrieves a value from cache with a specified key.
boolean
set ( string $id, mixed $value, integer $expire, ICacheDependency $dependency)
Stores a value identified by a key into cache.

Method Details

add

public boolean add (string $id , mixed $value , integer $expire , ICacheDependency $dependency )

Stores a value identified by a key into cache if the cache does not contain this key.

Nothing will be done if the cache already contains the key.

Input
string$idthe key identifying the value to be cached
mixed$valuethe value to be cached
integer$expirethe number of seconds in which the cached value will expire. 0 means never expire.
ICacheDependency$dependencydependency of the cached item. If the dependency changes, the item is labelled invalid.
Output
boolean true if the value is successfully stored into cache, false otherwise
Exception

delete

public boolean delete (string $id )

Deletes a value with the specified key from cache

Input
string$idthe key of the value to be deleted
Output
boolean if no error happens during deletion
Exception

flush

public void flush ()

Deletes all values from cache.

Be careful of performing this operation if the cache is shared by multiple applications.

Output
Exception

get

public mixed get (string $id )

Retrieves a value from cache with a specified key.

Input
string$ida key identifying the cached value
Output
mixed the value stored in cache, false if the value is not in the cache or expired.
Exception

set

public boolean set (string $id , mixed $value , integer $expire , ICacheDependency $dependency )

Stores a value identified by a key into cache.

If the cache already contains such a key, the existing value and expiration time will be replaced with the new ones.

Input
string$idthe key identifying the value to be cached
mixed$valuethe value to be cached
integer$expirethe number of seconds in which the cached value will expire. 0 means never expire.
ICacheDependency$dependencydependency of the cached item. If the dependency changes, the item is labelled invalid.
Output
boolean true if the value is successfully stored into cache, false otherwise
Exception