Class XoopsCacheMemcache
Memcache storage engine for cache
-
XoopsCacheEngine
-
XoopsCacheMemcache
Methods summary
public
boolean
|
#
init( array $settings = array() )
Initialize the Cache Engine
Initialize the Cache Engine
Called automatically by the cache frontend
To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
Parameters
- $settings
- array of setting for the engine
Returns
boolean True if the engine has been successfully initialized, false if not
Overrides
|
public
boolean
|
#
write( string $key, mixed $value, integer $duration = null )
Write data for key into cache
Write data for key into cache
Parameters
- $key
- Identifier for the data
- $value
- Data to be cached
- $duration
- How long to cache the data, in seconds
Returns
boolean True if the data was successfully cached, false on failure
Overrides
|
public
mixed
|
#
read( string $key )
Read a key from the cache
Read a key from the cache
Parameters
- $key
- Identifier for the data
Returns
mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it
Overrides
|
public
boolean
|
#
delete( string $key )
Delete a key from the cache
Delete a key from the cache
Parameters
- $key
- Identifier for the data
Returns
boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed
Overrides
|
public
boolean
|
#
clear( boolean $check = null )
Delete all keys from the cache
Delete all keys from the cache
Parameters
- $check
- if true will check expiration, otherwise delete all
Returns
boolean True if the cache was successfully cleared, false otherwise
Overrides
|
public
boolean
|
#
connect( string $host, integer $port = 11211 )
Connects to a server in connection pool
Connects to a server in connection pool
Parameters
- $host
- host ip address or name
- $port
- Server port
Returns
boolean True if memcache server was connected
|
Properties summary
public
array
|
$settings
settings
servers = string or array of memcache servers, default => 127.0.0.1
compress = boolean, default => false
settings servers = string or array of memcache servers, default => 127.0.0.1 compress = boolean, default => false
|
|