This plugin enables caching using the Memcached library server. This library is usable by Linux clients
'' ADOdb\addins\cache\plugins\memcached\ADOCacheDefinitions ''
class ADOCacheDefinitions { /* * Debugging for cache */ public bool $debug = false; /* * Service flag. Do not modify value */ public string $service = 'memcached'; /* * Default cache timeout */ public int $cacheSeconds = 3600; /* * Add one or more servers, for use in distributed systems * @example array('192.168.0.78', '192.168.0.79', '192.168.0.80'); */ public array $memCacheHost = array(); /* * Optionally add the server port if it differs from the default * @example 11211 */ public ?int $memCachePort = null; /* * Can now use the servers option for memcached, can specify * host, port and optionally weight for a group of controllers * * 'host'=>192.68.0.85','port'=>'11261','weight'=>66 */ public ?array $memCacheControllers = null; /* * Can optionally be used to set memcached server options */ public ?array $memCacheOptions = null; }
An array of hosts or IP addresses that provide the memcache service. All hosts must use the same port.
A port number for the memcache connection
A boolean that flags whether to use compression
See below for information on using this parameters. If defined, then the hosts and ports are not used.
Allows setting of options
/* * Example Options */ $memcacheClass->memCacheOptions = array(Memcached::OPT_HASH=>Memcached::HASH_MURMUR);
The memcached library supports use of the serverKey option, using the cacheDataObject
$cls = new \stdClass; $cls->ttl = 1800; $cls->serverKey = 'tt-server'; $SQL = "SELECT * FROM departments"; $result = $db->cacheGetAll($SQL,false,$cls);