5 class File extends \Rsi\Fred\Storage\Container{
14 $this->_data = \Rsi\Record::get(\
Rsi\File::unserialize($this->filename,[]),
'data',[]);
18 if($this->_data) \Rsi\File::serialize($this->filename,[
'key' => $this->_key,
'data' => $this->_data],$this->mode);
19 else \Rsi\File::unlink($this->filename);
23 if(!$this->_filename){
24 if(!$this->path)
throw new \Exception(
'No path defined');
25 $key = is_array($this->_key) ? implode(
'/',$this->_key) :
$this->_key;
26 $this->_filename = $this->path . preg_replace(
'/[^\\w\\-\\/]+/',
'-',strtolower($key)) .
'-' . md5($key) .
$this->ext;
27 \Rsi\File::mkdir(dirname($this->_filename));