58 public function __construct($a_storage_type,$a_path_conversion,$a_container_id)
60 $this->storage_type = $a_storage_type;
61 $this->path_conversion = $a_path_conversion;
62 $this->container_id = $a_container_id;
86 $num = $a_container_id;
87 for($i = self::MAX_EXPONENT; $i > 0;$i--)
89 $factor = pow(self::FACTOR,$i);
90 if(($tmp = (
int) ($num / $factor)) or $found)
93 $num = $num % $factor;
100 $path_string = (implode(
'/',
$path).
'/');
102 return $path_string.$a_name.
'_'.$a_container_id;
136 if(!file_exists($this->path))
162 switch($this->storage_type)
164 case self::STORAGE_DATA:
168 case self::STORAGE_WEB:
178 if($this->path_conversion)
198 if(!$fp = @fopen($a_absolute_path,
'w+'))
202 if(@fwrite($fp,$a_data) ===
false)
220 if(@file_exists($a_abs_name))
222 @unlink($a_abs_name);
237 if(@file_exists($a_abs_name))
253 public function delete()
269 if(@file_exists($a_from))
271 @copy($a_from,$a_to);
293 $this->path .= $a_appendix;