1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
immune.php
См. документацию.
1<?php
2
3namespace Bitrix\Rest\Marketplace;
4
5use Bitrix\Main\Data\Cache;
6use Bitrix\Main\DB\Exception;
7use Bitrix\Main\SystemException;
8use Bitrix\Rest\Internals\FreeAppTable;
9
14class 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();
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}
static updateFreeAppTable(array $freeAppList)
Определения FreeAppTable.php:50
static getImmuneApp()
Определения client.php:85
static load()
Определения immune.php:73
static getList()
Определения immune.php:23
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$app
Определения proxy.php:8
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393