]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Ticket #3928 updated ElggMemecache->save() to take 3rd optional parameter
authorJanek Lasocki-Biczysko <j.lasocki-biczysko@intrallect.com>
Fri, 14 Oct 2011 11:52:34 +0000 (12:52 +0100)
committerJanek Lasocki-Biczysko <j.lasocki-biczysko@intrallect.com>
Fri, 14 Oct 2011 11:52:34 +0000 (12:52 +0100)
engine/classes/ElggMemcache.php

index 7d19fb2c7a20563cd419a3b370f83c92ef5ab3a9..1fd3be0d150b5fcff26680227c77b1105ef581da 100644 (file)
@@ -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');
                }