1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
redis_cache.php
См. документацию.
1<?php
2
5
7{
8 private bool $bQueue = false;
9 private static null|array $servers = null;
10 private static array $otherCroups = [];
11
12 public function __construct()
13 {
14 $sid = 'bxcluster';
15 require_once Bitrix\Main\Loader::getLocal('modules/cluster/lib/clustercacheconfig.php');
16
17 if (static::$servers === null)
18 {
19 static::$servers = Bitrix\Cluster\ClusterCacheConfig::getInstance('redis')->getConfig(true, static::$otherCroups);
20 }
21
22 if (defined('BX_REDIS_CLUSTER'))
23 {
24 $sid = BX_REDIS_CLUSTER;
25 }
26
27 if (!empty(static::$servers))
28 {
29 parent::__construct([
30 'servers' => static::$servers,
31 'sid' => $sid
32 ]);
33 }
34
35 if (defined('BX_CLUSTER_GROUP'))
36 {
37 $this->bQueue = true;
38 }
39 }
40
41 protected function configure($options = []): array
42 {
43 $config = parent::configure($options);
44
45 $cacheConfig = Configuration::getValue('cache');
46
47 $config['failover'] = $cacheConfig['failover'] ?? RedisCluster::FAILOVER_NONE;
48
49 return $config;
50 }
51
52 public function QueueRun($param1, $param2, $param3): void
53 {
54 $this->bQueue = false;
55 $this->clean($param1, $param2, $param3);
56 }
57
58 public function clean($baseDir, $initDir = false, $filename = false)
59 {
60 if ($this->isAvailable())
61 {
62 if ($this->bQueue && Loader::includeModule('cluster'))
63 {
64 foreach (self::$otherCroups as $group_id => $_)
65 {
66 CClusterQueue::Add($group_id, 'CPHPCacheRedisCluster', $baseDir, $initDir, $filename);
67 }
68 }
69
70 parent::clean($baseDir, $initDir, $filename);
71 }
72 }
73}
Определения loader.php:13
static getLocal($path, $root=null)
Определения loader.php:572
static Add($group_id, $command, $param1, $param2, $param3)
Определения queue.php:6
__construct()
Определения redis_cache.php:12
QueueRun($param1, $param2, $param3)
Определения redis_cache.php:52
clean($baseDir, $initDir=false, $filename=false)
Определения redis_cache.php:58
configure($options=[])
Определения redis_cache.php:41
$options
Определения commerceml2.php:49
$filename
Определения file_edit.php:47
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$config
Определения quickway.php:69