yii2

Форк
1
/
MemCacheServer.php 
60 строк · 1.9 Кб
1
<?php
2
/**
3
 * @link https://www.yiiframework.com/
4
 * @copyright Copyright (c) 2008 Yii Software LLC
5
 * @license https://www.yiiframework.com/license/
6
 */
7

8
namespace yii\caching;
9

10
/**
11
 * MemCacheServer represents the configuration data for a single memcache or memcached server.
12
 *
13
 * See [PHP manual](https://www.php.net/manual/en/memcache.addserver.php) for detailed explanation
14
 * of each configuration property.
15
 *
16
 * For more details and usage information on Cache, see the [guide article on caching](guide:caching-overview).
17
 *
18
 * @author Qiang Xue <qiang.xue@gmail.com>
19
 * @since 2.0
20
 */
21
class MemCacheServer extends \yii\base\BaseObject
22
{
23
    /**
24
     * @var string memcache server hostname or IP address
25
     */
26
    public $host;
27
    /**
28
     * @var int memcache server port
29
     */
30
    public $port = 11211;
31
    /**
32
     * @var int probability of using this server among all servers.
33
     */
34
    public $weight = 1;
35
    /**
36
     * @var bool whether to use a persistent connection. This is used by memcache only.
37
     */
38
    public $persistent = true;
39
    /**
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.
43
     */
44
    public $timeout = 1000;
45
    /**
46
     * @var int how often a failed server will be retried (in seconds). This is used by memcache only.
47
     */
48
    public $retryInterval = 15;
49
    /**
50
     * @var bool if the server should be flagged as online upon a failure. This is used by memcache only.
51
     */
52
    public $status = true;
53
    /**
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.
58
     */
59
    public $failureCallback;
60
}
61

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.