| | |
| | | $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); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 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; |
| | | } |
| | | |
| | |
| | | $node[$k] = $value; |
| | | } |
| | | |
| | | if($this->key) { |
| | | if ($this->key) { |
| | | $data = $this->read($this->key); |
| | | } |
| | | |