1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace kalanis\kw_storage\Storage; |
4
|
|
|
|
5
|
|
|
|
6
|
|
|
use kalanis\kw_storage\Interfaces\IPassDirs; |
7
|
|
|
use kalanis\kw_storage\Interfaces\ITargetVolume; |
8
|
|
|
|
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Class StorageDirs |
12
|
|
|
* @package kalanis\kw_storage |
13
|
|
|
* Extended storage class |
14
|
|
|
*/ |
15
|
|
|
class StorageDirs extends Storage implements IPassDirs |
16
|
|
|
{ |
17
|
|
|
/** @var ITargetVolume */ |
18
|
|
|
protected $target = null; |
19
|
|
|
|
20
|
4 |
|
public function isDir(string $key): bool |
21
|
|
|
{ |
22
|
4 |
|
return $this->target->isDir($this->key->fromSharedKey($key)); |
23
|
|
|
} |
24
|
|
|
|
25
|
1 |
|
public function isFile(string $key): bool |
26
|
|
|
{ |
27
|
1 |
|
return $this->target->isFile($this->key->fromSharedKey($key)); |
28
|
|
|
} |
29
|
|
|
|
30
|
2 |
|
public function isReadable(string $key): bool |
31
|
|
|
{ |
32
|
2 |
|
return $this->target->isReadable($this->key->fromSharedKey($key)); |
33
|
|
|
} |
34
|
|
|
|
35
|
2 |
|
public function isWritable(string $key): bool |
36
|
|
|
{ |
37
|
2 |
|
return $this->target->isWritable($this->key->fromSharedKey($key)); |
38
|
|
|
} |
39
|
|
|
|
40
|
1 |
|
public function mkDir(string $key, bool $recursive = false): bool |
41
|
|
|
{ |
42
|
1 |
|
return $this->target->mkDir($this->key->fromSharedKey($key), $recursive); |
43
|
|
|
} |
44
|
|
|
|
45
|
1 |
|
public function rmDir(string $key, bool $recursive = false): bool |
46
|
|
|
{ |
47
|
1 |
|
return $this->target->rmDir($this->key->fromSharedKey($key), $recursive); |
48
|
|
|
} |
49
|
|
|
|
50
|
1 |
|
public function copy(string $source, string $dest): bool |
51
|
|
|
{ |
52
|
1 |
|
return $this->target->copy($this->key->fromSharedKey($source), $this->key->fromSharedKey($dest)); |
53
|
|
|
} |
54
|
|
|
|
55
|
1 |
|
public function move(string $source, string $dest): bool |
56
|
|
|
{ |
57
|
1 |
|
return $this->target->move($this->key->fromSharedKey($source), $this->key->fromSharedKey($dest)); |
58
|
|
|
} |
59
|
|
|
|
60
|
1 |
|
public function size(string $key): ?int |
61
|
|
|
{ |
62
|
1 |
|
return $this->target->size($this->key->fromSharedKey($key)); |
63
|
|
|
} |
64
|
|
|
|
65
|
1 |
|
public function created(string $key): ?int |
66
|
|
|
{ |
67
|
1 |
|
return $this->target->created($this->key->fromSharedKey($key)); |
68
|
|
|
} |
69
|
|
|
} |
70
|
|
|
|