|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
|
|
4
|
|
|
namespace Nexus\Dumper; |
|
5
|
|
|
|
|
6
|
|
|
|
|
7
|
|
|
use Xervice\Core\Facade\AbstractFacade; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* @method \Nexus\Dumper\DumperFactory getFactory() |
|
11
|
|
|
* @method \Nexus\Dumper\DumperConfig getConfig() |
|
12
|
|
|
* @method \Nexus\Dumper\DumperClient getClient() |
|
13
|
|
|
*/ |
|
14
|
|
|
class DumperFacade extends AbstractFacade |
|
15
|
|
|
{ |
|
16
|
|
|
/** |
|
17
|
|
|
* @return array |
|
18
|
|
|
*/ |
|
19
|
|
|
public function getCommands() |
|
20
|
|
|
{ |
|
21
|
|
|
return $this->getFactory()->getCommandList(); |
|
22
|
|
|
} |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* @param string $volume |
|
26
|
|
|
* @param string $path |
|
27
|
|
|
* @param string $version |
|
28
|
|
|
* |
|
29
|
|
|
* @return string |
|
30
|
|
|
* @throws \Xervice\Config\Exception\ConfigNotFound |
|
31
|
|
|
*/ |
|
32
|
|
|
public function dumpToLocal(string $volume, string $path, string $version, string $datapath) |
|
33
|
|
|
{ |
|
34
|
|
|
return $this->getFactory()->createDumper($volume, $path, 'local', $version, $datapath)->dump(); |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* @param string $volume |
|
39
|
|
|
* @param string $path |
|
40
|
|
|
* @param string $version |
|
41
|
|
|
* |
|
42
|
|
|
* @return string |
|
43
|
|
|
* @throws \Xervice\Config\Exception\ConfigNotFound |
|
44
|
|
|
*/ |
|
45
|
|
|
public function restoreToLocal(string $volume, string $path, string $version, string $datapath) |
|
46
|
|
|
{ |
|
47
|
|
|
return $this->getFactory()->createDumper($volume, $path, 'local', $version, $datapath)->restore(); |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* @param string $volume |
|
52
|
|
|
* @param string $path |
|
53
|
|
|
* @param string $version |
|
54
|
|
|
* |
|
55
|
|
|
* @return string |
|
56
|
|
|
* @throws \Xervice\Config\Exception\ConfigNotFound |
|
57
|
|
|
*/ |
|
58
|
|
|
public function dumpToSsh(string $volume, string $path, string $version, string $datapath) |
|
59
|
|
|
{ |
|
60
|
|
|
return $this->getFactory()->createDumper($volume, $path, 'ssh', $version, $datapath)->dump(); |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* @param string $volume |
|
65
|
|
|
* @param string $path |
|
66
|
|
|
* @param string $version |
|
67
|
|
|
* |
|
68
|
|
|
* @return string |
|
69
|
|
|
* @throws \Xervice\Config\Exception\ConfigNotFound |
|
70
|
|
|
*/ |
|
71
|
|
|
public function restoreToSsh(string $volume, string $path, string $version, string $datapath) |
|
72
|
|
|
{ |
|
73
|
|
|
return $this->getFactory()->createDumper($volume, $path, 'ssh', $version, $datapath)->restore(); |
|
74
|
|
|
} |
|
75
|
|
|
} |