Class yii\caching\MemCacheServer

继承yii\caching\MemCacheServer » yii\base\BaseObject
实现yii\base\Configurable
可用自版本2.0
源代码 https://github.com/yiisoft/yii2/blob/master/framework/caching/MemCacheServer.php

MemCacheServer represents the configuration data for a single memcache or memcached server.

See PHP manual for detailed explanation of each configuration property.

For more details and usage information on Cache, see the guide article on caching.

公共属性

隐藏继承的属性

属性类型描述定义在
$failureCallback Closure This callback function will run upon encountering an error. yii\caching\MemCacheServer
$host string Memcache server hostname or IP address yii\caching\MemCacheServer
$persistent boolean Whether to use a persistent connection. yii\caching\MemCacheServer
$port integer Memcache server port yii\caching\MemCacheServer
$retryInterval integer How often a failed server will be retried (in seconds). yii\caching\MemCacheServer
$status boolean If the server should be flagged as online upon a failure. yii\caching\MemCacheServer
$timeout integer Timeout in milliseconds which will be used for connecting to the server. yii\caching\MemCacheServer
$weight integer Probability of using this server among all servers. yii\caching\MemCacheServer

公共方法

隐藏继承的方法

方法描述定义在
__call() 调用不是类方法的已命名方法. yii\base\BaseObject
__construct() 构造函数. yii\base\BaseObject
__get() 返回对象属性的值. yii\base\BaseObject
__isset() 检查属性是否已设置, 即已定义且不为null. yii\base\BaseObject
__set() 设置对象属性的值. yii\base\BaseObject
__unset() 将对象属性设置为null. yii\base\BaseObject
canGetProperty() 返回一个值, 指示属性是否可读. yii\base\BaseObject
canSetProperty() 返回一个值, 指示属性是否可写. yii\base\BaseObject
className() 返回此类的完全限定名称. yii\base\BaseObject
hasMethod() 返回一个值, 指示方法是否已定义. yii\base\BaseObject
hasProperty() 返回一个值, 指示属性是否已定义. yii\base\BaseObject
init() 初始化对象. yii\base\BaseObject

属性详情

$failureCallback public 属性

This callback function will run upon encountering an error. The callback is run before fail over is attempted. The function takes two parameters, the $host and the $port of the failed server. This is used by memcache only.

public Closure $failureCallback null
$host public 属性

Memcache server hostname or IP address

public string $host null
$persistent public 属性

Whether to use a persistent connection. This is used by memcache only.

public boolean $persistent true
$port public 属性

Memcache server port

public integer $port 11211
$retryInterval public 属性

How often a failed server will be retried (in seconds). This is used by memcache only.

public integer $retryInterval 15
$status public 属性

If the server should be flagged as online upon a failure. This is used by memcache only.

public boolean $status true
$timeout public 属性

Timeout in milliseconds which will be used for connecting to the server. This is used by memcache only. For old versions of memcache that only support specifying timeout in seconds this will be rounded up to full seconds.

public integer $timeout 1000
$weight public 属性

Probability of using this server among all servers.

public integer $weight 1