PHP Interface Prado\Caching\ICache

This interface must be implemented by cache managers.
Since: 3.0
Author: Qiang Xue ([email protected])
Mostra file Open project: pradosoft/prado

Public Methods

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

Method Details

add() public method

Nothing will be done if the cache already contains the key.
public add ( $id, $value, $expire, $dependency = null ) : boolean
return boolean true if the value is successfully stored into cache, false otherwise

delete() public method

Deletes a value with the specified key from cache
public delete ( $id ) : boolean
return boolean if no error happens during deletion

flush() public method

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

get() public method

Retrieves a value from cache with a specified key.
public get ( $id ) : mixed
return mixed the value stored in cache, false if the value is not in the cache or expired.

set() public method

If the cache already contains such a key, the existing value and expiration time will be replaced with the new ones.
public set ( $id, $value, $expire, $dependency = null ) : boolean
return boolean true if the value is successfully stored into cache, false otherwise