1 | <?php |
||
22 | abstract class AmazonS3 implements Simulator |
||
23 | { |
||
24 | /** |
||
25 | * AWS key |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $key; |
||
30 | |||
31 | /** |
||
32 | * AWS secret |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $secret; |
||
37 | |||
38 | /** |
||
39 | * AWS S3 bucket |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $bucket; |
||
44 | |||
45 | /** |
||
46 | * AWS S3 region |
||
47 | * |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $region; |
||
51 | |||
52 | /** |
||
53 | * AWS remote path / object key |
||
54 | * |
||
55 | * @var string |
||
56 | */ |
||
57 | protected $path; |
||
58 | |||
59 | /** |
||
60 | * AWS acl |
||
61 | * 'private' by default |
||
62 | * |
||
63 | * @var string |
||
64 | */ |
||
65 | protected $acl; |
||
66 | |||
67 | /** |
||
68 | * Use multi part config |
||
69 | * |
||
70 | * @var boolean |
||
71 | */ |
||
72 | protected $multiPartUpload; |
||
73 | |||
74 | 6 | /** |
|
75 | * Min multi part upload size |
||
76 | 6 | * |
|
77 | * @var int |
||
78 | */ |
||
79 | 6 | protected $minMultiPartUploadSize = 5242880; |
|
80 | 1 | ||
81 | /** |
||
82 | 5 | * Max stream upload size |
|
83 | 1 | * |
|
84 | * @var int |
||
85 | 4 | */ |
|
86 | 1 | protected $maxStreamUploadSize = 104857600; |
|
87 | |||
88 | 3 | /** |
|
89 | 1 | * Configure the sync. |
|
90 | * |
||
91 | 2 | * @see \phpbu\App\Backup\Sync::setup() |
|
92 | 1 | * @param array $config |
|
93 | * @throws \phpbu\App\Backup\Sync\Exception |
||
94 | 1 | */ |
|
95 | 1 | public function setup(array $config) |
|
123 | |||
124 | /** |
||
125 | * Execute the sync |
||
126 | * |
||
127 | * @see \phpbu\App\Backup\Sync::sync() |
||
128 | * @param \phpbu\App\Backup\Target $target |
||
129 | * @param \phpbu\App\Result $result |
||
130 | * @throws \phpbu\App\Backup\Sync\Exception |
||
131 | */ |
||
132 | abstract public function sync(Target $target, Result $result); |
||
133 | |||
134 | /** |
||
135 | * Simulate the sync execution. |
||
136 | * |
||
137 | * @param \phpbu\App\Backup\Target $target |
||
138 | * @param \phpbu\App\Result $result |
||
139 | */ |
||
140 | public function simulate(Target $target, Result $result) |
||
150 | |||
151 | /** |
||
152 | * Should multi part upload be used. |
||
153 | * |
||
154 | * @param \phpbu\App\Backup\Target $target |
||
155 | * @return bool |
||
156 | */ |
||
157 | protected function useMultiPartUpload(Target $target) |
||
165 | } |
||
166 |