1 | <?php |
||
11 | class OVHSwiftAdapter extends SwiftAdapter |
||
12 | { |
||
13 | /** Variables from the Filesystem class will be temporarily stored here */ |
||
14 | protected $specialParams; |
||
15 | |||
16 | /** @var OVHConfiguration */ |
||
17 | protected $config; |
||
18 | |||
19 | /** |
||
20 | * OVHSwiftAdapter constructor. |
||
21 | * |
||
22 | * @param Container $container |
||
23 | * @param OVHConfiguration $config |
||
24 | * @param string|null $prefix |
||
25 | */ |
||
26 | public function __construct(Container $container, OVHConfiguration $config, ?string $prefix = null) |
||
32 | |||
33 | /** |
||
34 | * Gets the endpoint url of the bucket. |
||
35 | * |
||
36 | * @param string|null $path |
||
37 | * @return string |
||
38 | */ |
||
39 | protected function getEndpoint(?string $path = null): string |
||
58 | |||
59 | /** |
||
60 | * Custom function to comply with the Storage::url() function in laravel |
||
61 | * without checking the existence of a file (faster). |
||
62 | * |
||
63 | * @param string $path |
||
64 | * @return string |
||
65 | */ |
||
66 | public function getUrl($path) |
||
70 | |||
71 | /** |
||
72 | * Custom function to get an url with confirmed file existence. |
||
73 | * |
||
74 | * @param string $path |
||
75 | * @return string |
||
76 | * @throws BadResponseError |
||
77 | */ |
||
78 | public function getUrlConfirm($path): string |
||
89 | |||
90 | /** |
||
91 | * Generate a temporary URL for private containers. |
||
92 | * |
||
93 | * @param string $path |
||
94 | * @param Carbon|null $expiresAt |
||
95 | * @param array $options |
||
96 | * @return string |
||
97 | */ |
||
98 | public function getTemporaryUrl(string $path, ?Carbon $expiresAt = null, array $options = []): string |
||
133 | |||
134 | /** |
||
135 | * Expose the container to allow for modification to metadata. |
||
136 | * |
||
137 | * @return Container |
||
138 | */ |
||
139 | public function getContainer(): Container |
||
143 | |||
144 | /** |
||
145 | * Include support for object deletion. |
||
146 | * |
||
147 | * @param string $path |
||
148 | * @param Config $config |
||
149 | * @return array |
||
150 | * @see SwiftAdapter |
||
151 | */ |
||
152 | protected function getWriteData($path, $config): array |
||
164 | } |
||
165 |