1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace kalanis\kw_files\Processing\Storage; |
4
|
|
|
|
5
|
|
|
|
6
|
|
|
use kalanis\kw_files\Interfaces\IFLTranslations; |
7
|
|
|
use kalanis\kw_files\Interfaces\IProcessDirs; |
8
|
|
|
use kalanis\kw_storage\Interfaces\IStorage; |
9
|
|
|
|
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* Class ProcessDir |
13
|
|
|
* @package kalanis\kw_files\Processing\Storage |
14
|
|
|
* Process dirs in storages |
15
|
|
|
*/ |
16
|
|
|
class ProcessDir implements IProcessDirs |
17
|
|
|
{ |
18
|
|
|
protected IProcessDirs $adapter; |
19
|
|
|
|
20
|
83 |
|
public function __construct(IStorage $storage, ?IFLTranslations $lang = null) |
21
|
|
|
{ |
22
|
83 |
|
$factory = new Dirs\Factory(); |
23
|
83 |
|
$this->adapter = $factory->getClass($storage, $lang); |
24
|
|
|
} |
25
|
|
|
|
26
|
22 |
|
public function createDir(array $entry, bool $deep = false): bool |
27
|
|
|
{ |
28
|
22 |
|
return $this->adapter->createDir($entry, $deep); |
29
|
|
|
} |
30
|
|
|
|
31
|
19 |
|
public function readDir(array $entry, bool $loadRecursive = false, bool $wantSize = false): array |
32
|
|
|
{ |
33
|
19 |
|
return $this->adapter->readDir($entry, $loadRecursive, $wantSize); |
34
|
|
|
} |
35
|
|
|
|
36
|
18 |
|
public function copyDir(array $source, array $dest): bool |
37
|
|
|
{ |
38
|
18 |
|
return $this->adapter->copyDir($source, $dest); |
39
|
|
|
} |
40
|
|
|
|
41
|
18 |
|
public function moveDir(array $source, array $dest): bool |
42
|
|
|
{ |
43
|
18 |
|
return $this->adapter->moveDir($source, $dest); |
44
|
|
|
} |
45
|
|
|
|
46
|
22 |
|
public function deleteDir(array $entry, bool $deep = false): bool |
47
|
|
|
{ |
48
|
22 |
|
return $this->adapter->deleteDir($entry, $deep); |
49
|
|
|
} |
50
|
|
|
} |
51
|
|
|
|