mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-10 05:22:41 +00:00
Making XcacheTest use refactored Cache API.
This commit is contained in:
parent
3f067ed166
commit
fb7d99e6b3
2 changed files with 4 additions and 5 deletions
5
cake/libs/cache/xcache.php
vendored
5
cake/libs/cache/xcache.php
vendored
|
@ -2,7 +2,6 @@
|
|||
/**
|
||||
* Xcache storage engine for cache.
|
||||
*
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
|
@ -68,7 +67,7 @@ class XcacheEngine extends CacheEngine {
|
|||
*/
|
||||
function write($key, &$value, $duration) {
|
||||
$expires = time() + $duration;
|
||||
xcache_set($key.'_expires', $expires, $duration);
|
||||
xcache_set($key . '_expires', $expires, $duration);
|
||||
return xcache_set($key, $value, $duration);
|
||||
}
|
||||
|
||||
|
@ -82,7 +81,7 @@ class XcacheEngine extends CacheEngine {
|
|||
function read($key) {
|
||||
if (xcache_isset($key)) {
|
||||
$time = time();
|
||||
$cachetime = intval(xcache_get($key.'_expires'));
|
||||
$cachetime = intval(xcache_get($key . '_expires'));
|
||||
if ($cachetime < $time || ($time + $this->settings['duration']) < $cachetime) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue