Methods summary
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
|
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.
|
public
boolean
|
#
setPrefix( string $key = '' )
Overrides the default prefix. If left alone, this will use the default key defined in the class.
Overrides the default prefix. If left alone, this will use the default key defined in the class.
Parameters
Returns
boolean If this was successful or not.
|
public
string
|
#
getPrefix( )
Gets the prefix as defined from set or the default.
Gets the prefix as defined from set or the default.
Returns
string the value of $key.
|
public
boolean
|
#
setDefaultTTL( integer $ttl = 120 )
Sets a default Time To Live, if this isn't specified we let the class define it.
Sets a default Time To Live, if this isn't specified we let the class define it.
Parameters
Returns
boolean If this was successful or not.
|
public
string
|
#
getDefaultTTL( )
Gets the TTL as defined from set or the default.
Gets the TTL as defined from set or the default.
Returns
string the value of $ttl.
|
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.
|
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.
|
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.
|
public
boolean
|
#
invalidateCache( )
Invalidate all cached data.
Invalidate all cached data.
Returns
boolean Whether or not we could invalidate the cache.
|
public
boolean
|
#
quit( )
Closes connections to the cache method.
Closes connections to the cache method.
Returns
boolean Whether or not we could close connections.
|
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.
|
public
string
|
#
getCompatibleVersion( )
Gets the latest version of SMF this is compatible with.
Gets the latest version of SMF this is compatible with.
Returns
string the value of $key.
|
public
string
|
#
getMinimumVersion( )
Gets the min version that we support.
Gets the min version that we support.
Returns
string the value of $key.
|
public
string
|
#
getVersion( )
Gets the Version of the Caching API.
Gets the Version of the Caching API.
Returns
string the value of $key.
|
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
|