3
* @link https://www.yiiframework.com/
4
* @copyright Copyright (c) 2008 Yii Software LLC
5
* @license https://www.yiiframework.com/license/
11
* MemCacheServer represents the configuration data for a single memcache or memcached server.
13
* See [PHP manual](https://www.php.net/manual/en/memcache.addserver.php) for detailed explanation
14
* of each configuration property.
16
* For more details and usage information on Cache, see the [guide article on caching](guide:caching-overview).
18
* @author Qiang Xue <qiang.xue@gmail.com>
21
class MemCacheServer extends \yii\base\BaseObject
24
* @var string memcache server hostname or IP address
28
* @var int memcache server port
32
* @var int probability of using this server among all servers.
36
* @var bool whether to use a persistent connection. This is used by memcache only.
38
public $persistent = true;
40
* @var int timeout in milliseconds which will be used for connecting to the server.
41
* This is used by memcache only. For old versions of memcache that only support specifying
42
* timeout in seconds this will be rounded up to full seconds.
44
public $timeout = 1000;
46
* @var int how often a failed server will be retried (in seconds). This is used by memcache only.
48
public $retryInterval = 15;
50
* @var bool if the server should be flagged as online upon a failure. This is used by memcache only.
52
public $status = true;
54
* @var \Closure this callback function will run upon encountering an error.
55
* The callback is run before fail over is attempted. The function takes two parameters,
56
* the [[host]] and the [[port]] of the failed server.
57
* This is used by memcache only.
59
public $failureCallback;