1 | <?php |
||
7 | class OVHConfiguration |
||
8 | { |
||
9 | /** @var string */ |
||
10 | protected $authUrl; |
||
11 | |||
12 | /** @var string */ |
||
13 | protected $projectId; |
||
14 | |||
15 | /** @var string */ |
||
16 | protected $region; |
||
17 | |||
18 | /** @var string */ |
||
19 | protected $userDomain; |
||
20 | |||
21 | /** @var string */ |
||
22 | protected $username; |
||
23 | |||
24 | /** @var string */ |
||
25 | protected $password; |
||
26 | |||
27 | /** @var string */ |
||
28 | protected $container; |
||
29 | |||
30 | /** @var string|null */ |
||
31 | private $tempUrlKey; |
||
32 | |||
33 | /** @var string|null */ |
||
34 | private $endpoint; |
||
35 | |||
36 | /** @var string|null */ |
||
37 | private $swiftLargeObjectThreshold; |
||
38 | |||
39 | /** @var string|null */ |
||
40 | private $swiftSegmentSize; |
||
41 | |||
42 | /** @var string|null */ |
||
43 | private $swiftSegmentContainer; |
||
44 | |||
45 | /** |
||
46 | * OVHConfiguration constructor. |
||
47 | * |
||
48 | * @param string $authUrl |
||
49 | * @param string $projectId |
||
50 | * @param string $region |
||
51 | * @param string $userDomain |
||
52 | * @param string $username |
||
53 | * @param string $password |
||
54 | * @param string $container |
||
55 | * @param string|null $tempUrlKey |
||
56 | * @param string|null $endpoint |
||
57 | * @param string|null $swiftLargeObjectThreshold |
||
58 | * @param string|null $swiftSegmentSize |
||
59 | * @param string|null $swiftSegmentContainer |
||
60 | */ |
||
61 | public function __construct( |
||
89 | |||
90 | /** |
||
91 | * Creates a new OVHConfiguration instance. |
||
92 | * |
||
93 | * @param array $config |
||
94 | * @return static |
||
95 | */ |
||
96 | public static function make(array $config): self |
||
120 | |||
121 | /** |
||
122 | * Returns the Project Auth Server URL. |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | public function getAuthUrl(): string |
||
130 | |||
131 | /** |
||
132 | * Returns the Project Id. |
||
133 | * |
||
134 | * @return string |
||
135 | */ |
||
136 | public function getProjectId(): string |
||
140 | |||
141 | /** |
||
142 | * Returns the Project Region. |
||
143 | * It could be one of the following: |
||
144 | * - BHS |
||
145 | * - DE |
||
146 | * - GRA |
||
147 | * - SBG |
||
148 | * - UK |
||
149 | * - WAW |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | public function getRegion(): string |
||
157 | |||
158 | /** |
||
159 | * Returns the User Domain in the Project. |
||
160 | * OVH uses the "Default" region by... default... |
||
161 | * |
||
162 | * @return string |
||
163 | */ |
||
164 | public function getUserDomain(): string |
||
168 | |||
169 | /** |
||
170 | * Returns the Project Username. |
||
171 | * |
||
172 | * @return string |
||
173 | */ |
||
174 | public function getUsername(): string |
||
178 | |||
179 | /** |
||
180 | * Returns the Password for the current User. |
||
181 | * |
||
182 | * @return string |
||
183 | */ |
||
184 | public function getPassword(): string |
||
188 | |||
189 | /** |
||
190 | * Returns the name of the desired Container. |
||
191 | * |
||
192 | * @return string |
||
193 | */ |
||
194 | public function getContainer(): string |
||
198 | |||
199 | /** |
||
200 | * Returns the pre-assigned Temp Url Key of either the Container or Project. |
||
201 | * This is used to generate Temporary Access Urls for files in the container. |
||
202 | * |
||
203 | * @return string|null |
||
204 | */ |
||
205 | public function getTempUrlKey(): ?string |
||
209 | |||
210 | /** |
||
211 | * Returns the Custom Endpoint configured for the container. |
||
212 | * |
||
213 | * @return string|null |
||
214 | */ |
||
215 | public function getEndpoint(): ?string |
||
219 | |||
220 | /** |
||
221 | * Returns Object Threshold, used while uploading large files. |
||
222 | * |
||
223 | * @return string|null |
||
224 | */ |
||
225 | public function getSwiftLargeObjectThreshold(): ?string |
||
229 | |||
230 | /** |
||
231 | * Returns Object Segment Size, used while uploading large files. |
||
232 | * |
||
233 | * @return string|null |
||
234 | */ |
||
235 | public function getSwiftSegmentSize(): ?string |
||
239 | |||
240 | /** |
||
241 | * Returns Container Segment, used while uploading large files. |
||
242 | * |
||
243 | * @return string|null |
||
244 | */ |
||
245 | public function getSwiftSegmentContainer(): ?string |
||
249 | } |