XCL Web Application Platform
2.5.0
The XoopsCube Legacy Project
📘
Loading...
Searching...
No Matches
Legacy_CacheInformation.class.php
1
<?php
10
11
if
(!defined(
'XOOPS_ROOT_PATH'
)) {
12
exit();
13
}
14
22
class
Legacy_AbstractCacheInformation
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
107
class
Legacy_ModuleCacheInformation
extends
Legacy_AbstractCacheInformation
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
173
class
Legacy_BlockCacheInformation
extends
Legacy_AbstractCacheInformation
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
}
Legacy_AbstractCacheInformation
Definition
Legacy_CacheInformation.class.php:23
Legacy_AbstractCacheInformation\reset
reset()
Definition
Legacy_CacheInformation.class.php:95
Legacy_AbstractCacheInformation\isEnableCache
isEnableCache()
Definition
Legacy_CacheInformation.class.php:87
Legacy_AbstractCacheInformation\hasSetEnable
hasSetEnable()
Definition
Legacy_CacheInformation.class.php:69
Legacy_AbstractCacheInformation\setEnableCache
setEnableCache($flag)
Definition
Legacy_CacheInformation.class.php:78
Legacy_BlockCacheInformation
Definition
Legacy_CacheInformation.class.php:174
Legacy_BlockCacheInformation\setBlock
setBlock(&$blockProcedure)
Definition
Legacy_CacheInformation.class.php:200
Legacy_BlockCacheInformation\reset
reset()
Definition
Legacy_CacheInformation.class.php:205
Legacy_BlockCacheInformation\getCacheFilePath
getCacheFilePath()
Definition
Legacy_CacheInformation.class.php:215
Legacy_ModuleCacheInformation
Definition
Legacy_CacheInformation.class.php:108
Legacy_ModuleCacheInformation\setModule
setModule(&$module)
Definition
Legacy_CacheInformation.class.php:143
Legacy_ModuleCacheInformation\reset
reset()
Definition
Legacy_CacheInformation.class.php:148
Legacy_ModuleCacheInformation\getCacheFilePath
getCacheFilePath()
Definition
Legacy_CacheInformation.class.php:159
XCube_Delegate
[Final] Used for the simple mechanism for common delegation in XCube.
Definition
XCube_Delegate.class.php:101
XCube_Ref
Definition
XCube_Delegate.class.php:32
html
modules
legacy
kernel
Legacy_CacheInformation.class.php
Generated by
1.13.2