Interface SimpleCacheInterface
Interface for cache drivers.
Methods summary
public
boolean
|
#
clear( )
Clear all cache data.
Returns
boolean Return true if cleared successfully. Return false for otherwise.
|
public
boolean
|
#
delete( string $id )
Delete a cache entry.
Parameters
Returns
boolean Return true if cleared successfully. Return false for otherwise.
|
public
mixed
|
#
get( string $id )
Get a cache entry.
Parameters
- $id
- The id of the cache entry to get.
Returns
mixed Return the cached data or return false if that cache id is not exists.
|
public
boolean
|
#
save( string $id, mixed $data, integer $lifetime = 60 )
Save data into the cache.
Save data into the cache.
Parameters
- $id
- The cache id.
- $data
- The cache data.
- $lifetime
- The life time in seconds for this cache. If set to anything else less than 1, it will be automatically set to 60 by default.
Returns
boolean Return true on successfully saved data to the cache, return false for otherwise.
|