Class sqlite_cache
-
cache_api
implements
cache_api_interface
-
sqlite_cache
Package: cacheAPI
Copyright:
2020 Simple Machines and individual contributors
License:
BSD
Author:
Simple Machines https://www.simplemachines.org
Located at Sources/CacheAPI-sqlite.php
Methods summary
public
|
#
__construct( )
Does basic setup of a cache method when we create the object but before we call connect.
Does basic setup of a cache method when we create the object but before we call connect.
Overrides
|
public
boolean
|
#
connect( )
Connects to the cache method. This defines our $key. If this fails, we return false, otherwise we return true.
Connects to the cache method. This defines our $key. If this fails, we return false, otherwise we return true.
Returns
boolean Whether or not the cache method was connected to.
Overrides
|
public
boolean
|
#
isSupported( boolean $test = false )
Checks whether we can use the cache method performed by this API.
Checks whether we can use the cache method performed by this API.
Parameters
- $test
- Test if this is supported or enabled.
Returns
boolean Whether or not the cache is supported
Overrides
|
public
mixed
|
#
getData( string $key, string $ttl = null )
Gets data from the cache.
Gets data from the cache.
Parameters
- $key
- The key to use, the prefix is applied to the key name.
- $ttl
- Overrides the default TTL.
Returns
mixed The result from the cache, if there is no data or it is invalid, we return null.
Overrides
|
public
boolean
|
#
putData( string $key, mixed $value, string $ttl = null )
Saves to data the cache.
Parameters
- $key
- The key to use, the prefix is applied to the key name.
- $value
- The data we wish to save.
- $ttl
- Overrides the default TTL.
Returns
boolean Whether or not we could save this to the cache.
Overrides
|
public
boolean
|
#
cleanCache( string $type = '' )
Clean out the cache.
Parameters
- $type
- If supported, the type of cache to clear, blank/data or user.
Returns
boolean Whether or not we could clean the cache.
Overrides
|
public
|
#
cacheSettings( array & $config_vars )
Specify custom settings that the cache API supports.
Specify custom settings that the cache API supports.
Parameters
- $config_vars
- Additional config_vars, see ManageSettings.php for usage.
Returns
No return is needed.
Overrides
|
public
boolean
|
#
setCachedir( string $dir = null )
Sets the $cachedir or uses the SMF default $cachedir..
Sets the $cachedir or uses the SMF default $cachedir..
Parameters
Returns
boolean If this was successful or not.
|
public
string
|
#
getVersion( )
Gets the Version of the Caching API.
Gets the Version of the Caching API.
Returns
string the value of $key.
Overrides
|
public
|
#
housekeeping( )
Run housekeeping of this cache
exp. clean up old data or do optimization
Run housekeeping of this cache
exp. clean up old data or do optimization
Overrides
|