1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
include.php
См. документацию.
1<?php
2
4// Never increase caching time here. There were cache clenup problems noticed.
5if (!defined('CACHED_b_cluster_dbnode'))
6{
7 define('CACHED_b_cluster_dbnode', 3600);
8}
9
11
12CModule::AddAutoloadClasses(
13 'cluster', [
14 'CClusterGroup' => 'classes/general/group.php',
15 'CClusterQueue' => 'classes/general/queue.php',
16 'CAllClusterDBNode' => 'classes/general/dbnode.php',
17 'CClusterDBNode' => 'classes/' . $dbType . '/dbnode.php',
18 'CAllClusterDBNodeCheck' => 'classes/general/dbnode_check.php',
19 'CClusterDBNodeCheck' => 'classes/' . $dbType . '/dbnode_check.php',
20 'CClusterSlave' => 'classes/' . $dbType . '/slave.php',
21 'CClusterMemcache' => 'classes/general/memcache.php',
22 'CClusterRedis' => 'classes/general/redis.php',
23 'CClusterWebNode' => 'classes/general/webnode.php',
24 ]
25);
26
27if (defined('BX_CLUSTER_GROUP'))
28{
29 CClusterQueue::Run();
30}
31
33{
34 public static function checkForServers($toBeAddedCount = 0)
35 {
36 $countLimit = (int) \Bitrix\Main\Config\Option::get('main', '~PARAM_MAX_SERVERS', 0);
37 if ($countLimit > 0)
38 {
39 return (self::getServersCount() + $toBeAddedCount) <= $countLimit;
40 }
41 else
42 {
43 return true;
44 }
45 }
46
47 public static function getServersCount()
48 {
49 static $cache = null;
50 if ($cache === null)
51 {
52 $hosts = [];
53 foreach (self::getServerList() as $server)
54 {
55 if ($server['DEDICATED'] == 'Y')
56 {
57 $hosts[] = $server['HOST'];
58 }
59 }
60 $cache = count(array_unique($hosts));
61 }
62 return $cache;
63 }
64
65 public static function getServerList()
66 {
67 $cacheType = COption::GetOptionString('cluster', 'cache_type', 'memcache');
68 if ($cacheType == 'memcache')
69 {
70 $cacheServers = CClusterMemcache::getServerList();
71 }
72 else
73 {
74 $cacheServers = CClusterRedis::getServerList();
75 }
76 $servers = array_merge(
78 ,$cacheServers
80 );
81 if (empty($servers))
82 {
83 $servers[] = [
84 'ID' => 0,
85 'HOST' => '',
86 'DEDICATED' => 'Y',
87 'EDIT_URL' => '',
88 ];
89 }
90 return $servers;
91 }
92}
static getServerList()
Определения clustercache.php:15
static getConnection($name="")
Определения application.php:638
static getServerList()
Определения dbnode.php:451
Определения include.php:33
static getServersCount()
Определения include.php:47
static checkForServers($toBeAddedCount=0)
Определения include.php:34
static getServerList()
Определения include.php:65
static getServerList()
Определения webnode.php:300
$dbType
Определения autoload.php:6
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Определения tools.php:3778
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936