XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
Legacy_CacheInformation.class.php
1<?php
10
11if (!defined('XOOPS_ROOT_PATH')) {
12 exit();
13}
14
23{
31 public $mIdentityArr = [];
32
40 public $mGroupArr = [];
41
49 public $_mEnableCache = false;
50
57 public $mAttributes = [];
58
59 public function __construct()
60 //public function Legacy_AbstractCacheInformation()
61 {
62 }
63
69 public function hasSetEnable()
70 {
71 return false !== $this->_mEnableCache;
72 }
73
78 public function setEnableCache($flag)
79 {
80 $this->_mEnableCache = $flag;
81 }
82
87 public function isEnableCache()
88 {
89 return $this->_mEnableCache;
90 }
91
95 public function reset()
96 {
97 $this->mIdentityArr = [];
98 $this->mGroupArr = [];
99 $this->_mEnableCache = null;
100 }
101
102 public function getCacheFilePath()
103 {
104 }
105}
106
108{
115 public $mModule = null;
116
124 public $mURL = null;
125
129 public $mGetCacheFilePath = null;
130
131 public function __construct()
132 {
133 parent::__construct();
134
135 $this->mGetCacheFilePath = new XCube_Delegate();
136 $this->mGetCacheFilePath->register('Legacy_ModuleCacheInformation.GetCacheFilePath');
137 }
138
143 public function setModule(&$module)
144 {
145 $this->mModule =& $module;
146 }
147
148 public function reset()
149 {
150 parent::reset();
151 $this->mModule = null;
152 $this->mURL = null;
153 }
154
159 public function getCacheFilePath()
160 {
161 $filepath = null;
162 $this->mGetCacheFilePath->call(new XCube_Ref($filepath), $this);
163
164 if (!$filepath) {
165 $id = md5(XOOPS_SALT . $this->mURL . '(' . implode('_', $this->mIdentityArr) . ')' . implode('_', $this->mGroupArr));
166 $filepath = XOOPS_CACHE_PATH . '/' . $id . '.cache.html';
167 }
168
169 return $filepath;
170 }
171}
172
174{
181 public $mBlock = null;
182
186 public $mGetCacheFilePath = null;
187
188 public function __construct()
189 {
190 parent::__construct();
191 $this->mGetCacheFilePath = new XCube_Delegate();
192 $this->mGetCacheFilePath->register('Legacy_BlockCachInformation.getCacheFilePath');
193 }
194
200 public function setBlock(&$blockProcedure)
201 {
202 $this->mBlock = $blockProcedure->_mBlock;
203 }
204
205 public function reset()
206 {
207 parent::reset();
208 $this->mBlock = null;
209 }
210
215 public function getCacheFilePath()
216 {
217 $filepath = null;
218 $this->mGetCacheFilePath->call(new XCube_Ref($filepath), $this);
219
220 if (!$filepath) {
221 $id = md5(XOOPS_SALT . '(' . implode('_', $this->mIdentityArr) . ')' . implode('_', $this->mGroupArr));
222 $filepath = static::getCacheFileBase($this->mBlock->get('bid'), $id);
223 }
224 return $filepath;
225 }
226
227 public static function getCacheFileBase($bid, $context)
228 {
229 return XOOPS_CACHE_PATH . '/' . urlencode(XOOPS_URL) . '_bid'. $bid . '_' . $context . '.cache.html';
230 }
231}
[Final] Used for the simple mechanism for common delegation in XCube.