6
6
*
7
7
* Filedisk Cache Handler
8
8
*
9
- * @author NAVER (developers@xpressengine.com)
9
+ * @author NAVER (developers@xpressengine.com)
10
10
*/
11
11
class CacheFile extends CacheBase
12
12
{
@@ -78,10 +78,10 @@ function put($key, $obj, $valid_time = 0)
78
78
$ content [] = 'if(!defined( \'__XE__ \')) { exit(); } ' ;
79
79
$ content [] = 'return \'' . addslashes (serialize ($ obj )) . '\'; ' ;
80
80
FileHandler::writeFile ($ cache_file , implode (PHP_EOL , $ content ));
81
- if (function_exists ('opcache_invalidate ' ))
82
- {
83
- @opcache_invalidate ($ cache_file , true );
84
- }
81
+ if (function_exists ('opcache_invalidate ' ))
82
+ {
83
+ @opcache_invalidate ($ cache_file , true );
84
+ }
85
85
}
86
86
87
87
/**
@@ -94,15 +94,15 @@ function put($key, $obj, $valid_time = 0)
94
94
function isValid ($ key , $ modified_time = 0 )
95
95
{
96
96
$ cache_file = $ this ->getCacheFileName ($ key );
97
-
97
+
98
98
if (file_exists ($ cache_file ))
99
99
{
100
- if ($ modified_time > 0 && filemtime ($ cache_file ) < $ modified_timed )
101
- {
102
- FileHandler::removeFile ($ cache_file );
103
- return false ;
104
- }
105
-
100
+ if ($ modified_time > 0 && filemtime ($ cache_file ) < $ modified_time )
101
+ {
102
+ FileHandler::removeFile ($ cache_file );
103
+ return false ;
104
+ }
105
+
106
106
return true ;
107
107
}
108
108
@@ -118,19 +118,19 @@ function isValid($key, $modified_time = 0)
118
118
*/
119
119
function get ($ key , $ modified_time = 0 )
120
120
{
121
- if (!$ cache_file = FileHandler::exists ($ this ->getCacheFileName ($ key )))
122
- {
123
- return false ;
124
- }
121
+ if (!$ cache_file = FileHandler::exists ($ this ->getCacheFileName ($ key )))
122
+ {
123
+ return false ;
124
+ }
125
125
126
- if ($ modified_time > 0 && filemtime ($ cache_file ) < $ modified_timed )
126
+ if ($ modified_time > 0 && filemtime ($ cache_file ) < $ modified_time )
127
127
{
128
- FileHandler::removeFile ($ cache_file );
128
+ FileHandler::removeFile ($ cache_file );
129
129
return false ;
130
130
}
131
131
132
- $ content = include ($ cache_file );
133
-
132
+ $ content = include ($ cache_file );
133
+
134
134
return unserialize (stripslashes ($ content ));
135
135
}
136
136
@@ -143,10 +143,10 @@ function get($key, $modified_time = 0)
143
143
function _delete ($ _key )
144
144
{
145
145
$ cache_file = $ this ->getCacheFileName ($ _key );
146
- if (function_exists ('opcache_invalidate ' ))
147
- {
148
- @opcache_invalidate ($ cache_file , true );
149
- }
146
+ if (function_exists ('opcache_invalidate ' ))
147
+ {
148
+ @opcache_invalidate ($ cache_file , true );
149
+ }
150
150
FileHandler::removeFile ($ cache_file );
151
151
}
152
152
0 commit comments