14 $this->_storage = $storage;
23 abstract protected function open();
25 abstract protected function save();
27 public function read($key,$default = null){
28 return \Rsi\Record::get($this->data,$key,$default);
31 public function write($key,$value){
32 if($value !== $this->
read($key)){
33 \Rsi\Record::set($this->_data,$key,$value);
34 $this->_changed =
true;
38 public function remove($key){
39 if(\
Rsi\Record::exists($this->data,$key)){
40 \Rsi\Record::delete($this->_data,$key);
41 $this->_changed =
true;
47 $this->_changed =
true;
51 if($this->_changed) $this->
save();
52 $this->_changed =
false;
57 $this->_changed =
false;
60 protected function _get($key){
61 return $this->
read($key);
64 protected function _set($key,$value){
65 $this->
write($key,$value);
69 if($this->_data === null) $this->
open();
configure($config)
Configure the object.
read($key, $default=null)
__construct($storage, $options, $key)