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) |
||
36 | |||
37 | /** |
||
38 | * Custom function to comply with the Storage::url() function in laravel |
||
39 | * without checking the existence of a file (faster). |
||
40 | * |
||
41 | * @param string $path |
||
42 | * @return string |
||
43 | */ |
||
44 | public function getUrl($path) |
||
57 | |||
58 | /** |
||
59 | * Custom function to get a url with confirmed file existence. |
||
60 | * |
||
61 | * @param string $path |
||
62 | * @return string |
||
63 | */ |
||
64 | public function getUrlConfirm($path) |
||
84 | |||
85 | /** |
||
86 | * Generate a temporary URL for private containers. |
||
87 | * |
||
88 | * @param string $path |
||
89 | * @param Carbon $expiration |
||
90 | * @param array $options |
||
91 | * @return string |
||
92 | */ |
||
93 | public function getTemporaryUrl($path, $expiration, $options = []) |
||
126 | |||
127 | /** |
||
128 | * Check if the url support variables have |
||
129 | * been correctly defined. |
||
130 | * |
||
131 | * @return void|BadMethodCallException |
||
132 | */ |
||
133 | protected function checkParams() |
||
139 | } |
||
140 |