Class yii\caching\MemCacheServer
Inheritance | yii\caching\MemCacheServer » yii\base\BaseObject |
---|---|
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.
Public Properties
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 |
Public Methods
Method | Description | Defined By |
---|---|---|
__call() | Calls the named method which is not a class method. | yii\base\BaseObject |
__construct() | Constructor. | yii\base\BaseObject |
__get() | Returns the value of an object property. | yii\base\BaseObject |
__isset() | Checks if a property is set, i.e. defined and not null. | yii\base\BaseObject |
__set() | Sets value of an object property. | yii\base\BaseObject |
__unset() | Sets an object property to null. | yii\base\BaseObject |
canGetProperty() | Returns a value indicating whether a property can be read. | yii\base\BaseObject |
canSetProperty() | Returns a value indicating whether a property can be set. | yii\base\BaseObject |
className() | Returns the fully qualified name of this class. | yii\base\BaseObject |
hasMethod() | Returns a value indicating whether a method is defined. | yii\base\BaseObject |
hasProperty() | Returns a value indicating whether a property is defined. | yii\base\BaseObject |
init() | Initializes the object. | yii\base\BaseObject |
Property Details
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.
Memcache server hostname or IP address
Whether to use a persistent connection. This is used by memcache only.
Memcache server port
How often a failed server will be retried (in seconds). This is used by memcache only.
If the server should be flagged as online upon a failure. This is used by memcache only.
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.
Probability of using this server among all servers.