mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Removing time manipulation so its possible to create memcache entries that do not expire. Updating documentation about the peculiarities of memcache. Refs #871
This commit is contained in:
parent
0865679684
commit
2a50c3a1fb
1 changed files with 9 additions and 4 deletions
13
cake/libs/cache/memcache.php
vendored
13
cake/libs/cache/memcache.php
vendored
|
@ -20,7 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Memcache storage engine for cache
|
||||
* Memcache storage engine for cache. Memcache has some limitations in the amount of
|
||||
* control you have over expire times far in the future. See MemcacheEngine::write() for
|
||||
* more information.
|
||||
*
|
||||
* @package cake
|
||||
* @subpackage cake.cake.libs.cache
|
||||
|
@ -95,17 +97,20 @@ class MemcacheEngine extends CacheEngine {
|
|||
}
|
||||
|
||||
/**
|
||||
* Write data for key into cache
|
||||
* Write data for key into cache. When using memcache as your cache engine
|
||||
* remember that the Memcache pecl extension does not support cache expiry times greater
|
||||
* than 30 days in the future. If you wish to create cache entries that do not expire, set the duration
|
||||
* to `0` in your cache configuration.
|
||||
*
|
||||
* @param string $key Identifier for the data
|
||||
* @param mixed $value Data to be cached
|
||||
* @param integer $duration How long to cache the data, in seconds
|
||||
* @return boolean True if the data was succesfully cached, false on failure
|
||||
* @see http://php.net/manual/en/memcache.set.php
|
||||
* @access public
|
||||
*/
|
||||
function write($key, &$value, $duration) {
|
||||
$expires = time() + $duration;
|
||||
return $this->__Memcache->set($key, $value, $this->settings['compress'], $expires);
|
||||
return $this->__Memcache->set($key, $value, $this->settings['compress'], $duration);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue