1 | <?php |
||
22 | class Ftp extends Xtp |
||
23 | { |
||
24 | use Cleanable; |
||
25 | |||
26 | /** |
||
27 | * FTP connection stream |
||
28 | * |
||
29 | * @var \SebastianFeldmann\Ftp\Client |
||
30 | */ |
||
31 | protected $ftpClient; |
||
32 | |||
33 | /** |
||
34 | * Determine should ftp connects via passive mode. |
||
35 | * |
||
36 | * @var bool |
||
37 | */ |
||
38 | protected $passive; |
||
39 | |||
40 | /** |
||
41 | * Setup the Ftp sync. |
||
42 | * |
||
43 | * @param array $config |
||
44 | * @throws \phpbu\App\Backup\Sync\Exception |
||
45 | * @throws \phpbu\App\Exception |
||
46 | */ |
||
47 | 9 | public function setup(array $config) |
|
61 | |||
62 | /** |
||
63 | * Check for required loaded libraries or extensions. |
||
64 | * |
||
65 | * @throws \phpbu\App\Backup\Sync\Exception |
||
66 | */ |
||
67 | 7 | protected function checkRequirements() |
|
73 | |||
74 | /** |
||
75 | * Return implemented (*)TP protocol name. |
||
76 | * |
||
77 | * @return string |
||
78 | */ |
||
79 | 1 | protected function getProtocolName() |
|
83 | |||
84 | /** |
||
85 | * (non-PHPDoc) |
||
86 | * |
||
87 | * @see \phpbu\App\Backup\Sync::sync() |
||
88 | * @param \phpbu\App\Backup\Target $target |
||
89 | * @param \phpbu\App\Result $result |
||
90 | * @throws \phpbu\App\Backup\Sync\Exception |
||
91 | */ |
||
92 | 3 | public function sync(Target $target, Result $result) |
|
107 | |||
108 | /** |
||
109 | * Return FTP client wrapping the ftp connection. |
||
110 | * |
||
111 | * @return \SebastianFeldmann\Ftp\Client |
||
112 | */ |
||
113 | protected function createClient() |
||
121 | |||
122 | /** |
||
123 | * Creates FTP remote collector. |
||
124 | * |
||
125 | * @param \phpbu\App\Backup\Target $target |
||
126 | * @return \phpbu\App\Backup\Collector |
||
127 | */ |
||
128 | 1 | protected function createCollector(Target $target): Collector |
|
132 | } |
||
133 |