Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
cache.php
1
<?php
2
namespace
Bitrix\Landing\Block
;
3
4
use \Bitrix\Landing\Manager;
5
6
class
Cache
7
{
11
const
TAG_PREFIX
=
'landing_block_'
;
12
13
protected
static
$cacheDisabled
=
false
;
14
19
public
static
function
disableCache
(): void
20
{
21
self::$cacheDisabled =
true
;
22
}
23
28
public
static
function
enableCache
(): void
29
{
30
self::$cacheDisabled =
false
;
31
}
32
37
public
static
function
isCaching
(): bool
38
{
39
if
(self::$cacheDisabled)
40
{
41
return
false
;
42
}
43
return
defined(
'BX_COMP_MANAGED_CACHE'
) &&
44
BX_COMP_MANAGED_CACHE ===
true
;
45
}
46
52
public
static
function
register
($id): void
53
{
54
$id = intval($id);
55
56
if
($id > 0 && self::isCaching())
57
{
58
Manager::getCacheManager
()->registerTag(
59
self::TAG_PREFIX . $id
60
);
61
}
62
}
63
69
public
static
function
clear
($id): void
70
{
71
$id = intval($id);
72
73
if
($id > 0 && self::isCaching())
74
{
75
Manager::getCacheManager
()->clearByTag(
76
self::TAG_PREFIX . $id
77
);
78
}
79
}
80
}
Bitrix\Landing\Block\Cache
Definition
cache.php:7
Bitrix\Landing\Block\Cache\TAG_PREFIX
const TAG_PREFIX
Definition
cache.php:11
Bitrix\Landing\Block\Cache\enableCache
static enableCache()
Definition
cache.php:28
Bitrix\Landing\Block\Cache\clear
static clear($id)
Definition
cache.php:69
Bitrix\Landing\Block\Cache\$cacheDisabled
static $cacheDisabled
Definition
cache.php:13
Bitrix\Landing\Block\Cache\isCaching
static isCaching()
Definition
cache.php:37
Bitrix\Landing\Block\Cache\disableCache
static disableCache()
Definition
cache.php:19
Bitrix\Landing\Manager\getCacheManager
static getCacheManager()
Definition
manager.php:89
Bitrix\Landing\Block
Definition
cache.php:2
modules
landing
lib
block
cache.php
Создано системой
1.10.0