1 | <?php |
||
16 | class WebDAVAdapter extends AbstractAdapter |
||
17 | { |
||
18 | use StreamedTrait; |
||
19 | use StreamedCopyTrait; |
||
20 | use NotSupportingVisibilityTrait; |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | protected static $resultMap = [ |
||
26 | '{DAV:}getcontentlength' => 'size', |
||
27 | '{DAV:}getcontenttype' => 'mimetype', |
||
28 | 'content-length' => 'size', |
||
29 | 'content-type' => 'mimetype', |
||
30 | ]; |
||
31 | |||
32 | /** |
||
33 | * @var Client |
||
34 | */ |
||
35 | protected $client; |
||
36 | |||
37 | /** |
||
38 | * Constructor. |
||
39 | * |
||
40 | * @param Client $client |
||
41 | * @param string $prefix |
||
42 | */ |
||
43 | 66 | public function __construct(Client $client, $prefix = null) |
|
48 | |||
49 | /** |
||
50 | * Get client instance. |
||
51 | * |
||
52 | * @return Client |
||
53 | */ |
||
54 | public function getClient() |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | 12 | public function getMetadata($path) |
|
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | 6 | public function has($path) |
|
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | 15 | public function read($path) |
|
120 | |||
121 | /** |
||
122 | * {@inheritdoc} |
||
123 | */ |
||
124 | 9 | public function write($path, $contents, Config $config) |
|
136 | |||
137 | /** |
||
138 | * {@inheritdoc} |
||
139 | */ |
||
140 | 3 | public function update($path, $contents, Config $config) |
|
144 | |||
145 | /** |
||
146 | * {@inheritdoc} |
||
147 | */ |
||
148 | 9 | public function rename($path, $newpath) |
|
167 | |||
168 | /** |
||
169 | * {@inheritdoc} |
||
170 | */ |
||
171 | 6 | public function delete($path) |
|
183 | |||
184 | /** |
||
185 | * {@inheritdoc} |
||
186 | */ |
||
187 | 6 | public function createDir($path, Config $config) |
|
198 | |||
199 | /** |
||
200 | * {@inheritdoc} |
||
201 | */ |
||
202 | 6 | public function deleteDir($dirname) |
|
206 | |||
207 | /** |
||
208 | * {@inheritdoc} |
||
209 | */ |
||
210 | 3 | public function listContents($directory = '', $recursive = false) |
|
235 | |||
236 | /** |
||
237 | * {@inheritdoc} |
||
238 | */ |
||
239 | 3 | public function getSize($path) |
|
243 | |||
244 | /** |
||
245 | * {@inheritdoc} |
||
246 | */ |
||
247 | 3 | public function getTimestamp($path) |
|
251 | |||
252 | /** |
||
253 | * {@inheritdoc} |
||
254 | */ |
||
255 | 3 | public function getMimetype($path) |
|
259 | |||
260 | /** |
||
261 | * Normalise a WebDAV repsonse object. |
||
262 | * |
||
263 | * @param array $object |
||
264 | * @param string $path |
||
265 | * |
||
266 | * @return array |
||
267 | */ |
||
268 | 15 | protected function normalizeObject(array $object, $path) |
|
285 | } |
||
286 |