function _createContainer($data) { if ($this->need_serialization) { return lmbSerializable::serialize($data); } else { return $data; } }
function set($key, $value, $ttl = false) { $resolved_key = $this->_resolveKey($key); try { $this->db_table->insertOnDuplicateUpdate(array('key' => $resolved_key, 'value' => lmbSerializable::serialize($value), 'ttl' => $ttl ? $ttl + time() : 0)); return true; } catch (Exception $e) { return false; } }
function set($key, $value, $ttl = false) { if ($ttl) { $ttl += time(); } if ($this->need_serialization) { $value = lmbSerializable::serialize($value); } $this->_getSession()->set($this->_resolveKey($key), $value); $this->_getSession()->set($this->_resolveKey($key) . 'ttl', $ttl); }