aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanek Lasocki-Biczysko <j.lasocki-biczysko@intrallect.com>2011-10-14 12:52:34 +0100
committerJanek Lasocki-Biczysko <j.lasocki-biczysko@intrallect.com>2011-10-14 12:52:34 +0100
commitdca59d90ed3142011c0c46ff9d9a606059eaf205 (patch)
tree282e63535076a60a59feb0e806f0f26515314a4f
parent164234083c0bf56407442ee4214e7f42ebca7113 (diff)
downloadelgg-dca59d90ed3142011c0c46ff9d9a606059eaf205.tar.gz
elgg-dca59d90ed3142011c0c46ff9d9a606059eaf205.tar.bz2
Ticket #3928 updated ElggMemecache->save() to take 3rd optional parameter
-rw-r--r--engine/classes/ElggMemcache.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/engine/classes/ElggMemcache.php b/engine/classes/ElggMemcache.php
index 7d19fb2c7..1fd3be0d1 100644
--- a/engine/classes/ElggMemcache.php
+++ b/engine/classes/ElggMemcache.php
@@ -147,15 +147,20 @@ class ElggMemcache extends ElggSharedMemoryCache {
/**
* Saves a name and value to the cache
*
- * @param string $key Name
- * @param string $data Value
+ * @param string $key Name
+ * @param string $data Value
+ * @param integer $expires Expires (in seconds)
*
* @return bool
*/
- public function save($key, $data) {
+ public function save($key, $data, $expires = null) {
$key = $this->_makeMemcacheKey($key);
- $result = $this->memcache->set($key, $data, null, $this->expires);
+ if ($expires === null) {
+ $expires = $this->expires;
+ }
+
+ $result = $this->memcache->set($key, $data, null, $expires);
if (!$result) {
elgg_log("MEMCACHE: FAILED TO SAVE $key", 'ERROR');
}