1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
cache_manager.php
См. документацию.
1<?php
2
9
10
11// The main purpose of the class is:
12// one read - many uses - optional one write
13// of the set of variables
15{
17 private $managedCache;
18
20 private $taggedCache;
21
22 public function __construct()
23 {
25 $this->managedCache = $app->getManagedCache();
26 $this->taggedCache = $app->getTaggedCache();
27 }
28
29 // Tries to read cached variable value from the file
30 // Returns true on success
31 // otherwise returns false
32 public function Read($ttl, $uniqid, $table_id=false)
33 {
34 return $this->managedCache->read($ttl, $uniqid, $table_id);
35 }
36
37 public function GetImmediate($ttl, $uniqid, $table_id=false)
38 {
39 return $this->managedCache->getImmediate($ttl, $uniqid, $table_id);
40 }
41
42 // This method is used to read the variable value
43 // from the cache after successful Read
44 public function Get($uniqid)
45 {
46 return $this->managedCache->get($uniqid);
47 }
48
49 // Sets new value to the variable
50 public function Set($uniqid, $val)
51 {
52 $this->managedCache->set($uniqid, $val);
53 }
54
55 public function SetImmediate($uniqid, $val)
56 {
57 $this->managedCache->setImmediate($uniqid, $val);
58 }
59
60 // Marks cache entry as invalid
61 public function Clean($uniqid, $table_id=false)
62 {
63 $this->managedCache->clean($uniqid, $table_id);
64 }
65
66 // Marks cache entries associated with the table as invalid
67 public function CleanDir($table_id)
68 {
69 $this->managedCache->cleanDir($table_id);
70 }
71
72 // Clears all managed_cache
73 public function CleanAll()
74 {
75 $this->managedCache->cleanAll();
76 }
77
78 // Use it to flush cache to the files.
79 // Caution: only at the end of all operations!
80 public function _Finalize()
81 {
83 }
84
85 function GetCompCachePath($relativePath)
86 {
87 return $this->managedCache->getCompCachePath($relativePath);
88 }
89
90 /*Components managed(tagged) cache*/
91
92 function StartTagCache($relativePath)
93 {
94 if(defined("BX_COMP_MANAGED_CACHE"))
95 {
96 $this->taggedCache->startTagCache($relativePath);
97 }
98 }
99
100 function EndTagCache()
101 {
102 if(defined("BX_COMP_MANAGED_CACHE"))
103 {
104 $this->taggedCache->endTagCache();
105 }
106 }
107
108 function AbortTagCache()
109 {
110 if(defined("BX_COMP_MANAGED_CACHE"))
111 {
112 $this->taggedCache->abortTagCache();
113 }
114 }
115
116 function RegisterTag($tag)
117 {
118 if(defined("BX_COMP_MANAGED_CACHE"))
119 {
120 $this->taggedCache->registerTag($tag);
121 }
122 }
123
124 function ClearByTag($tag)
125 {
126 if(defined("BX_COMP_MANAGED_CACHE"))
127 {
128 $this->taggedCache->clearByTag($tag);
129 }
130 }
131}
static getInstance()
Определения application.php:98
static finalize()
Определения managedcache.php:155
Определения cache_manager.php:15
Clean($uniqid, $table_id=false)
Определения cache_manager.php:61
__construct()
Определения cache_manager.php:22
Set($uniqid, $val)
Определения cache_manager.php:50
Get($uniqid)
Определения cache_manager.php:44
RegisterTag($tag)
Определения cache_manager.php:116
EndTagCache()
Определения cache_manager.php:100
GetCompCachePath($relativePath)
Определения cache_manager.php:85
Read($ttl, $uniqid, $table_id=false)
Определения cache_manager.php:32
StartTagCache($relativePath)
Определения cache_manager.php:92
AbortTagCache()
Определения cache_manager.php:108
CleanAll()
Определения cache_manager.php:73
ClearByTag($tag)
Определения cache_manager.php:124
CleanDir($table_id)
Определения cache_manager.php:67
GetImmediate($ttl, $uniqid, $table_id=false)
Определения cache_manager.php:37
_Finalize()
Определения cache_manager.php:80
SetImmediate($uniqid, $val)
Определения cache_manager.php:55
$app
Определения proxy.php:8
$val
Определения options.php:1793