1 | <?php |
||
13 | class OVHSwiftAdapter extends SwiftAdapter |
||
14 | { |
||
15 | /** |
||
16 | * URL base path variables for OVH service |
||
17 | * the HTTPS url is typically of the format |
||
18 | * https://storage.[REGION].cloud.ovh.net/v1/AUTH_[PROJECT_ID]/[CONTAINER_NAME]. |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $urlVars; |
||
22 | |||
23 | /** Variables from the Filesystem class will be temporarily stored here */ |
||
24 | protected $specialParams; |
||
25 | |||
26 | /** |
||
27 | * Constructor. |
||
28 | * |
||
29 | * @param Container $container |
||
30 | * @param array $urlVars |
||
31 | * @param string $prefix |
||
32 | */ |
||
33 | public function __construct(Container $container, $urlVars = [], $prefix = null) |
||
39 | |||
40 | /** |
||
41 | * Custom function to comply with the Storage::url() function in laravel |
||
42 | * without checking the existence of a file (faster). |
||
43 | * |
||
44 | * @param string $path |
||
45 | * @return string |
||
46 | */ |
||
47 | public function getUrl($path) |
||
53 | |||
54 | /** |
||
55 | * Custom function to get a url with confirmed file existence. |
||
56 | * |
||
57 | * @param string $path |
||
58 | * @return string |
||
59 | */ |
||
60 | public function getUrlConfirm($path) |
||
73 | |||
74 | /** |
||
75 | * Generate a temporary URL for private containers. |
||
76 | * |
||
77 | * @param string $path |
||
78 | * @param Carbon $expiration |
||
79 | * @param array $options |
||
80 | * @return string |
||
81 | */ |
||
82 | public function getTemporaryUrl($path, $expiration, $options = []) |
||
114 | |||
115 | /** |
||
116 | * Gets the endpoint url of the bucket. |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | protected function getEndpoint() |
||
135 | |||
136 | /** |
||
137 | * Check if the url support variables have |
||
138 | * been correctly defined. |
||
139 | * |
||
140 | * @return void|BadMethodCallException |
||
141 | */ |
||
142 | protected function checkParams() |
||
150 | |||
151 | /** |
||
152 | * {@inheritdoc} |
||
153 | */ |
||
154 | public function write($path, $contents, Config $config, $size = 0) |
||
160 | |||
161 | /** |
||
162 | * Include support for object deletion. |
||
163 | * |
||
164 | * @param string $path |
||
165 | * @see Nimbusoft\Flysystem\OpenStack |
||
166 | * |
||
167 | * @return array |
||
168 | */ |
||
169 | protected function getData($path) |
||
181 | } |
||
182 |