Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
env.php
1
<?php
9
namespace
Bitrix\Sender\Runtime
;
10
11
use
Bitrix\Main\Config\Option
;
12
use
Bitrix\Sender\Integration\Bitrix24\Service
;
13
use
Bitrix\Sender\Posting\ThreadStrategy\IThreadStrategy
;
14
use
Bitrix\Sender\Posting\ThreadStrategy\ThreadStrategyContext
;
15
use
Bitrix\Sender\Posting\SegmentThreadStrategy
;
16
21
class
Env
22
{
28
public
static
function
isSenderJobCron
()
29
{
30
return
Option::get(
"sender"
,
"auto_method"
) ===
'cron'
;
31
}
32
38
public
static
function
isReiteratedJobCron
()
39
{
40
return
Option::get(
"sender"
,
"reiterate_method"
) ===
'cron'
;
41
}
42
48
public
static
function
getJobExecutionTimeout
()
49
{
50
return
self::isSenderJobCron
() ? 0 : (int) Option::get(
'sender'
,
'interval'
);
51
}
52
58
public
static
function
getJobExecutionItemLimit
()
59
{
60
if
(self::isSenderJobCron())
61
{
62
return
(
int
) Option::get(
'sender'
,
'max_emails_per_cron'
);
63
}
64
else
65
{
66
return
(
int
) Option::get(
'sender'
,
'max_emails_per_hit'
);
67
}
68
}
69
70
public
static
function
isTransportNeedConsent
(
string
$code) : bool
71
{
72
return
Option::get(
'sender'
,
"{$code}_consent"
) ===
'Y'
;
73
}
74
75
public
static
function
getMaxConsentRequests
(
string
$code) : bool
76
{
77
return
(
int
) Option::get(
'sender'
,
'~'
. $code .
'_max_consent_requests'
,0);
78
}
79
85
public
static
function
getThreadContext
()
86
{
87
return
ThreadStrategyContext::buildStrategy(Option::get(
'sender'
,
'thread_type'
));
88
}
89
95
public
static
function
getGroupThreadContext
()
96
{
97
return
SegmentThreadStrategy\ThreadStrategyContext::buildStrategy(Option::get(
'sender'
,
'thread_type'
));
98
}
99
}
Bitrix\Main\Config\Option
Definition
option.php:15
Bitrix\Sender\Integration\Bitrix24\Service
Definition
service.php:30
Bitrix\Sender\Posting\ThreadStrategy\ThreadStrategyContext
Definition
threadstrategycontext.php:6
Bitrix\Sender\Runtime\Env
Definition
env.php:22
Bitrix\Sender\Runtime\Env\getGroupThreadContext
static getGroupThreadContext()
Definition
env.php:95
Bitrix\Sender\Runtime\Env\getThreadContext
static getThreadContext()
Definition
env.php:85
Bitrix\Sender\Runtime\Env\getMaxConsentRequests
static getMaxConsentRequests(string $code)
Definition
env.php:75
Bitrix\Sender\Runtime\Env\isSenderJobCron
static isSenderJobCron()
Definition
env.php:28
Bitrix\Sender\Runtime\Env\isTransportNeedConsent
static isTransportNeedConsent(string $code)
Definition
env.php:70
Bitrix\Sender\Runtime\Env\getJobExecutionTimeout
static getJobExecutionTimeout()
Definition
env.php:48
Bitrix\Sender\Runtime\Env\isReiteratedJobCron
static isReiteratedJobCron()
Definition
env.php:38
Bitrix\Sender\Runtime\Env\getJobExecutionItemLimit
static getJobExecutionItemLimit()
Definition
env.php:58
Bitrix\Sender\Posting\ThreadStrategy\IThreadStrategy
Definition
ithreadstrategy.php:8
Bitrix\Sender\Posting\SegmentThreadStrategy
Definition
abstractthreadstrategy.php:3
Bitrix\Sender\Runtime
Definition
env.php:9
modules
sender
lib
runtime
env.php
Создано системой
1.10.0