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 | /** |
||
24 | * Constructor. |
||
25 | * |
||
26 | * @param Container $container |
||
27 | * @param array $urlVars |
||
28 | * @param string $prefix |
||
29 | */ |
||
30 | 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) |
||
50 | |||
51 | /** |
||
52 | * Custom function to get a url with confirmed file existence. |
||
53 | * |
||
54 | * @param string $path |
||
55 | * @return string |
||
56 | */ |
||
57 | public function getUrlConfirm($path) |
||
70 | |||
71 | /** |
||
72 | * Generate a temporary URL for private containers. |
||
73 | * |
||
74 | * @param string $path |
||
75 | * @param Carbon $expiration |
||
76 | * @param array $options |
||
77 | * @return string |
||
78 | */ |
||
79 | public function getTemporaryUrl($path, $expiration, $options = []) |
||
111 | |||
112 | /** |
||
113 | * Gets the endpoint url of the bucket. |
||
114 | * |
||
115 | * @return string |
||
116 | */ |
||
117 | protected function getEndpoint() |
||
132 | |||
133 | /** |
||
134 | * Check if the url support variables have |
||
135 | * been correctly defined. |
||
136 | * |
||
137 | * @return void|BadMethodCallException |
||
138 | */ |
||
139 | protected function checkParams() |
||
147 | |||
148 | /** |
||
149 | * {@inheritdoc} |
||
150 | */ |
||
151 | public function write($path, $contents, Config $config, $size = 0) |
||
157 | |||
158 | /** |
||
159 | * Include support for object deletion. |
||
160 | * |
||
161 | * @param string $path |
||
162 | * @see Nimbusoft\Flysystem\OpenStack |
||
163 | * |
||
164 | * @return array |
||
165 | */ |
||
166 | protected function getData($path) |
||
178 | } |
||
179 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: