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\IProcessNodes; |
8
|
|
|
use kalanis\kw_storage\Interfaces\IStorage; |
9
|
|
|
|
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* Class ProcessNode |
13
|
|
|
* @package kalanis\kw_files\Processing\Storage |
14
|
|
|
* Process nodes in storages |
15
|
|
|
*/ |
16
|
|
|
class ProcessNode implements IProcessNodes |
17
|
|
|
{ |
18
|
|
|
/** @var IProcessNodes */ |
19
|
|
|
protected $adapter = null; |
20
|
|
|
|
21
|
18 |
|
public function __construct(IStorage $storage, ?IFLTranslations $lang = null) |
22
|
|
|
{ |
23
|
18 |
|
$factory = new Nodes\Factory(); |
24
|
18 |
|
$this->adapter = $factory->getClass($storage, $lang); |
25
|
18 |
|
} |
26
|
|
|
|
27
|
9 |
|
public function exists(array $entry): bool |
28
|
|
|
{ |
29
|
9 |
|
return $this->adapter->exists($entry); |
30
|
|
|
} |
31
|
|
|
|
32
|
2 |
|
public function isReadable(array $entry): bool |
33
|
|
|
{ |
34
|
2 |
|
return $this->adapter->isReadable($entry); |
35
|
|
|
} |
36
|
|
|
|
37
|
2 |
|
public function isWritable(array $entry): bool |
38
|
|
|
{ |
39
|
2 |
|
return $this->adapter->isWritable($entry); |
40
|
|
|
} |
41
|
|
|
|
42
|
9 |
|
public function isDir(array $entry): bool |
43
|
|
|
{ |
44
|
9 |
|
return $this->adapter->isDir($entry); |
45
|
|
|
} |
46
|
|
|
|
47
|
5 |
|
public function isFile(array $entry): bool |
48
|
|
|
{ |
49
|
5 |
|
return $this->adapter->isFile($entry); |
50
|
|
|
} |
51
|
|
|
|
52
|
4 |
|
public function size(array $entry): ?int |
53
|
|
|
{ |
54
|
4 |
|
return $this->adapter->size($entry); |
55
|
|
|
} |
56
|
|
|
|
57
|
3 |
|
public function created(array $entry): ?int |
58
|
|
|
{ |
59
|
3 |
|
return $this->adapter->created($entry); |
60
|
|
|
} |
61
|
|
|
} |
62
|
|
|
|