Class flCacheDb
flCacheDb Class
Implementation of database based cache engine.
-
flCache
-
flCacheDb
Package: fusionLib
Copyright:
Copyright (c) 2013 fusionLib. All rights reserved.
Located at system/libs/Cache/flCacheDb.php
Methods summary
public
|
#
__construct( flDb $db, integer $lifetime = 3600, string $prefix = '' )
Construct the cache
Parameters
- $db
- The database object to use.
- $lifetime
- The default lifetime for objects in seconds.
- $prefix
- Prefix for cache keys.
Overrides
|
public
boolean
|
#
store( string $id, mixed $data, integer $lifetime = null )
Store an element in the cache.
Store an element in the cache.
Parameters
- $id
- The id to store the element as.
- $data
- The data to store.
- $lifetime
- The lifetime of the object in seconds, null to use the default or 0 to never expire.
Returns
boolean true if the data is cached or false if it could not be cached.
|
public
mixed
|
#
get( string $id )
Get the element from the cache.
Get the element from the cache.
Parameters
- $id
- The id of the element to get.
Returns
mixed false if the element is not cached or has expired; else the cached data.
|
public
|
#
remove( string $id )
Remove the given element from the cache.
Remove the given element from the cache.
Parameters
- $id
- The id of the element to remove.
|
public
|
|
public
integer
|
#
getServerTime( )
Get the UNIX timestamp according to the server.
Get the UNIX timestamp according to the server.
Returns
integer The timestamp.
Overrides
|