1 | <?php |
||
12 | class OVHSwiftAdapter extends SwiftAdapter |
||
13 | { |
||
14 | /** |
||
15 | * URL base path variables for OVH service |
||
16 | * the HTTPS url is typically of the format |
||
17 | * https://storage.[REGION].cloud.ovh.net/v1/AUTH_[PROJECT_ID]/[CONTAINER_NAME]. |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $urlVars; |
||
21 | |||
22 | /** |
||
23 | * Constructor. |
||
24 | * |
||
25 | * @param Container $container |
||
26 | * @param array $urlVars |
||
27 | * @param string $prefix |
||
28 | */ |
||
29 | public function __construct(Container $container, $urlVars = [], $prefix = null) |
||
35 | |||
36 | /** |
||
37 | * Custom function to comply with the Storage::url() function in laravel |
||
38 | * without checking the existence of a file (faster). |
||
39 | * |
||
40 | * @param string $path |
||
41 | * @return string |
||
42 | */ |
||
43 | public function getUrl($path) |
||
49 | |||
50 | /** |
||
51 | * Custom function to get a url with confirmed file existence. |
||
52 | * |
||
53 | * @param string $path |
||
54 | * @return string |
||
55 | */ |
||
56 | public function getUrlConfirm($path) |
||
69 | |||
70 | /** |
||
71 | * Generate a temporary URL for private containers. |
||
72 | * |
||
73 | * @param string $path |
||
74 | * @param Carbon $expiration |
||
75 | * @param array $options |
||
76 | * @return string |
||
77 | */ |
||
78 | public function getTemporaryUrl($path, $expiration, $options = []) |
||
110 | |||
111 | /** |
||
112 | * Gets the endpoint url of the bucket. |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | protected function getEndpoint() |
||
134 | |||
135 | /** |
||
136 | * Check if the url support variables have |
||
137 | * been correctly defined. |
||
138 | * |
||
139 | * @return void|BadMethodCallException |
||
140 | */ |
||
141 | protected function checkParams() |
||
147 | } |
||
148 |