Inheritance | yii\caching\MemCacheServer » yii\base\Object |
---|---|
Implements | yii\base\Configurable |
Available since version | 2.0 |
Source Code | 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.
Property | Type | Description | Defined By |
---|---|---|---|
$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 |
Method | Description | Defined By |
---|---|---|
__call() | Calls the named method which is not a class method. | yii\base\Object |
__construct() | Constructor. | yii\base\Object |
__get() | Returns the value of an object property. | yii\base\Object |
__isset() | Checks if a property is set, i.e. defined and not null. | yii\base\Object |
__set() | Sets value of an object property. | yii\base\Object |
__unset() | Sets an object property to null. | yii\base\Object |
canGetProperty() | Returns a value indicating whether a property can be read. | yii\base\Object |
canSetProperty() | Returns a value indicating whether a property can be set. | yii\base\Object |
className() | Returns the fully qualified name of this class. | yii\base\Object |
hasMethod() | Returns a value indicating whether a method is defined. | yii\base\Object |
hasProperty() | Returns a value indicating whether a property is defined. | yii\base\Object |
init() | Initializes the object. | yii\base\Object |
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
Memcache server hostname or IP address
public string $host = null
Whether to use a persistent connection. This is used by memcache only.
public boolean $persistent = true
Memcache server port
public integer $port = 11211
How often a failed server will be retried (in seconds). This is used by memcache only.
public integer $retryInterval = 15
If the server should be flagged as online upon a failure. This is used by memcache only.
public boolean $status = true
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
Probability of using this server among all servers.
public integer $weight = 1
© 2008–2017 by Yii Software LLC
Licensed under the three clause BSD license.
http://www.yiiframework.com/doc-2.0/yii-caching-memcacheserver.html