| | |
| | | $oldvars = $this->get_cache($key); |
| | | |
| | | // if there are cached vars, update store, else insert new data |
| | | if ($oldvars !== null) { |
| | | if ($oldvars) { |
| | | $newvars = $this->_fixvars($vars, $oldvars); |
| | | return $this->update($key, $newvars, $oldvars); |
| | | } |
| | |
| | | { |
| | | // move gc execution to the script shutdown function |
| | | // see rcube::shutdown() and rcube_session::write_close() |
| | | return $this->gc_enabled = $maxlifetime; |
| | | $this->gc_enabled = $maxlifetime; |
| | | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * see if we have vars of this key already cached, and if so, return them. |
| | | * See if we have vars of this key already cached, and if so, return them. |
| | | * |
| | | * @param $key |
| | | * @return null|array |
| | | * @param string $key Session ID |
| | | * |
| | | * @return string |
| | | */ |
| | | protected function get_cache($key) |
| | | { |
| | |
| | | else { // else read data again |
| | | $cache = $this->read($key); |
| | | } |
| | | |
| | | return $cache; |
| | | } |
| | | |
| | | /** |
| | | * Append the given value to the certain node in the session data array |
| | | * |
| | | * Warning: Do not use if you already modified $_SESSION in the same request (#1490608) |
| | | * |
| | | * @param string Path denoting the session variable where to append the value |
| | | * @param string Key name under which to append the new value (use null for appending to an indexed list) |
| | |
| | | $this->appends[] = $path; |
| | | |
| | | // when overwriting a previously unset variable |
| | | if ($this->unsets[$path]) |
| | | if ($this->unsets[$path]) { |
| | | unset($this->unsets[$path]); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | $node[$k] = $value; |
| | | } |
| | | |
| | | if($this->key) { |
| | | if ($this->key) { |
| | | $data = $this->read($this->key); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |