1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
immune.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Rest\Marketplace;
4
5
use Bitrix\Main\Data\Cache;
6
use Bitrix\Main\DB\Exception;
7
use Bitrix\Main\SystemException;
8
use Bitrix\Rest\Internals\FreeAppTable;
9
14
class
Immune
15
{
16
private
const
CACHE_TTL_TIMEOUT = 86400;
17
private
const
CACHE_DIR =
'/rest/'
;
18
private
static
$immuneAppList;
19
23
public
static
function
getList
():
array
24
{
25
if
(!is_array(static::$immuneAppList))
26
{
27
static::$immuneAppList = [];
28
$cache = Cache::createInstance();
29
30
if
($cache->initCache(static::CACHE_TTL_TIMEOUT,
'immuneAppList'
, static::CACHE_DIR))
31
{
32
$result
= $cache->getVars();
33
static::$immuneAppList = is_array(
$result
) ?
$result
: [];
34
}
35
elseif
($cache->startDataCache())
36
{
37
try
38
{
39
$appList =
FreeAppTable::query
()
40
->setSelect([
'APP_CODE'
])
41
->fetchAll();
42
43
static::$immuneAppList = $appList;
44
}
45
catch
(\
Exception
$exception)
46
{
47
static::$immuneAppList = [];
48
}
49
50
$cache->endDataCache(is_array(static::$immuneAppList) ? static::$immuneAppList : []);
51
}
52
53
static::$immuneAppList = array_map(fn(
$app
) =>
$app
[
'APP_CODE'
], static::$immuneAppList);
54
}
55
56
return
static::$immuneAppList;
57
}
58
59
private
static
function
getExternal():
array
60
{
61
$immuneAppList =
Client::getImmuneApp
();
62
FreeAppTable::updateFreeAppTable
($immuneAppList);
63
$cache = Cache::createInstance();
64
$cache->clean(
'immuneAppList'
, static::CACHE_DIR);
65
66
return
$immuneAppList;
67
}
68
73
public
static
function
load
() : string
74
{
75
static::getExternal();
76
77
return
'\Bitrix\Rest\Marketplace\Immune::load();'
;
78
}
79
}
Bitrix\Main\ORM\Data\DataManager\query
static query()
Определения
datamanager.php:549
Bitrix\Rest\Internals\FreeAppTable\updateFreeAppTable
static updateFreeAppTable(array $freeAppList)
Определения
FreeAppTable.php:50
Bitrix\Rest\Marketplace\Client\getImmuneApp
static getImmuneApp()
Определения
client.php:85
Bitrix\Rest\Marketplace\Immune
Определения
immune.php:15
Bitrix\Rest\Marketplace\Immune\load
static load()
Определения
immune.php:73
Bitrix\Rest\Marketplace\Immune\getList
static getList()
Определения
immune.php:23
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
$app
$app
Определения
proxy.php:8
Bitrix\Main\DI\Exception
Определения
circulardependencyexception.php:3
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
bitrix
modules
rest
lib
marketplace
immune.php
Создано системой
1.14.0