57 public function __construct($a_storage_type, $a_path_conversion, $a_container_id)
59 $this->storage_type = $a_storage_type;
60 $this->path_conversion = $a_path_conversion;
61 $this->container_id = $a_container_id;
85 $num = $a_container_id;
86 for (
$i = self::MAX_EXPONENT;
$i > 0;
$i--) {
87 $factor = pow(self::FACTOR,
$i);
88 if (($tmp = (
int) ($num / $factor))
or $found) {
90 $num = $num % $factor;
96 $path_string = (implode(
'/',
$path) .
'/');
98 return $path_string . $a_name .
'_' . $a_container_id;
132 if (!file_exists($this->path)) {
157 switch ($this->storage_type) {
158 case self::STORAGE_DATA:
162 case self::STORAGE_WEB:
172 if ($this->path_conversion) {
173 $this->path .= self::_createPathFromId($this->container_id, $this->
getPathPostfix());
189 if (!$fp = @
fopen($a_absolute_path,
'w+')) {
192 if (@fwrite($fp, $a_data) ===
false) {
209 if (@file_exists($a_abs_name)) {
210 @unlink($a_abs_name);
225 if (@file_exists($a_abs_name)) {
240 public function delete()
256 if (@file_exists($a_from)) {
257 @copy($a_from, $a_to);
274 return ilUpdateUtilsMailMigration::rCopy($a_source, $a_target);
279 $this->path .= $a_appendix;
static removeTrailingPathSeparators($path)
static getWebspaceDir($mode="filesystem")
deleteDirectory($a_abs_name)
Delete directory.
static makeDirParents($a_dir)
deleteFile($a_abs_name)
Delete file.
writeToFile($a_data, $a_absolute_path)
Write data to file.
copyFile($a_from, $a_to)
Copy files.
__construct($a_storage_type, $a_path_conversion, $a_container_id)
Constructor.
getAbsolutePath()
Get absolute path of storage directory.
static _createPathFromId($a_container_id, $a_name)
Create a path from an id: e.g 12345 will be converted to 12/34/<name>_5.
_copyDirectory($a_source, $a_target)
Copy directory and all contents.
getPathPrefix()
Get path prefix.
create()
Create directory.
getPathPostfix()
Get directory name.
appendToPath($a_appendix)