diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2011-10-27 10:04:48 -0700 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2011-10-27 10:04:48 -0700 |
commit | aee0471eede56d2cee19602f13943deec7e4f7e5 (patch) | |
tree | e7d6e254fcaf8230213af49e0c1dedc678d7069c /engine/classes/ElggMemcache.php | |
parent | 134f2767ba09f433fc7f0f85d90432347a1b285d (diff) | |
parent | dca59d90ed3142011c0c46ff9d9a606059eaf205 (diff) | |
download | elgg-aee0471eede56d2cee19602f13943deec7e4f7e5.tar.gz elgg-aee0471eede56d2cee19602f13943deec7e4f7e5.tar.bz2 |
Merge pull request #77 from janeklb/t3928
Fixes #3928 (updated ElggMemecache->save() to take 3rd optional parameter)
Diffstat (limited to 'engine/classes/ElggMemcache.php')
-rw-r--r-- | engine/classes/ElggMemcache.php | 13 |
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'); } |