@@ -76,681 +76,681 @@ |
||
76 | 76 | use Sabre\DAV\IFile; |
77 | 77 | |
78 | 78 | class File extends Node implements IFile { |
79 | - protected $request; |
|
80 | - |
|
81 | - protected IL10N $l10n; |
|
82 | - |
|
83 | - /** |
|
84 | - * Sets up the node, expects a full path name |
|
85 | - * |
|
86 | - * @param \OC\Files\View $view |
|
87 | - * @param \OCP\Files\FileInfo $info |
|
88 | - * @param \OCP\Share\IManager $shareManager |
|
89 | - * @param \OC\AppFramework\Http\Request $request |
|
90 | - */ |
|
91 | - public function __construct(View $view, FileInfo $info, IManager $shareManager = null, Request $request = null) { |
|
92 | - parent::__construct($view, $info, $shareManager); |
|
93 | - |
|
94 | - // Querying IL10N directly results in a dependency loop |
|
95 | - /** @var IL10NFactory $l10nFactory */ |
|
96 | - $l10nFactory = \OC::$server->get(IL10NFactory::class); |
|
97 | - $this->l10n = $l10nFactory->get(Application::APP_ID); |
|
98 | - |
|
99 | - if (isset($request)) { |
|
100 | - $this->request = $request; |
|
101 | - } else { |
|
102 | - $this->request = \OC::$server->getRequest(); |
|
103 | - } |
|
104 | - } |
|
105 | - |
|
106 | - /** |
|
107 | - * Updates the data |
|
108 | - * |
|
109 | - * The data argument is a readable stream resource. |
|
110 | - * |
|
111 | - * After a successful put operation, you may choose to return an ETag. The |
|
112 | - * etag must always be surrounded by double-quotes. These quotes must |
|
113 | - * appear in the actual string you're returning. |
|
114 | - * |
|
115 | - * Clients may use the ETag from a PUT request to later on make sure that |
|
116 | - * when they update the file, the contents haven't changed in the mean |
|
117 | - * time. |
|
118 | - * |
|
119 | - * If you don't plan to store the file byte-by-byte, and you return a |
|
120 | - * different object on a subsequent GET you are strongly recommended to not |
|
121 | - * return an ETag, and just return null. |
|
122 | - * |
|
123 | - * @param resource $data |
|
124 | - * |
|
125 | - * @throws Forbidden |
|
126 | - * @throws UnsupportedMediaType |
|
127 | - * @throws BadRequest |
|
128 | - * @throws Exception |
|
129 | - * @throws EntityTooLarge |
|
130 | - * @throws ServiceUnavailable |
|
131 | - * @throws FileLocked |
|
132 | - * @return string|null |
|
133 | - */ |
|
134 | - public function put($data) { |
|
135 | - try { |
|
136 | - $exists = $this->fileView->file_exists($this->path); |
|
137 | - if ($this->info && $exists && !$this->info->isUpdateable()) { |
|
138 | - throw new Forbidden(); |
|
139 | - } |
|
140 | - } catch (StorageNotAvailableException $e) { |
|
141 | - throw new ServiceUnavailable($this->l10n->t('File is not updatable: %1$s', [$e->getMessage()])); |
|
142 | - } |
|
143 | - |
|
144 | - // verify path of the target |
|
145 | - $this->verifyPath(); |
|
146 | - |
|
147 | - // chunked handling |
|
148 | - if (isset($_SERVER['HTTP_OC_CHUNKED'])) { |
|
149 | - try { |
|
150 | - return $this->createFileChunked($data); |
|
151 | - } catch (\Exception $e) { |
|
152 | - $this->convertToSabreException($e); |
|
153 | - } |
|
154 | - } |
|
155 | - |
|
156 | - /** @var Storage $partStorage */ |
|
157 | - [$partStorage] = $this->fileView->resolvePath($this->path); |
|
158 | - $needsPartFile = $partStorage->needsPartFile() && (strlen($this->path) > 1); |
|
159 | - |
|
160 | - $view = \OC\Files\Filesystem::getView(); |
|
161 | - |
|
162 | - if ($needsPartFile) { |
|
163 | - // mark file as partial while uploading (ignored by the scanner) |
|
164 | - $partFilePath = $this->getPartFileBasePath($this->path) . '.ocTransferId' . rand() . '.part'; |
|
165 | - |
|
166 | - if (!$view->isCreatable($partFilePath) && $view->isUpdatable($this->path)) { |
|
167 | - $needsPartFile = false; |
|
168 | - } |
|
169 | - } |
|
170 | - if (!$needsPartFile) { |
|
171 | - // upload file directly as the final path |
|
172 | - $partFilePath = $this->path; |
|
173 | - |
|
174 | - if ($view && !$this->emitPreHooks($exists)) { |
|
175 | - throw new Exception($this->l10n->t('Could not write to final file, canceled by hook')); |
|
176 | - } |
|
177 | - } |
|
178 | - |
|
179 | - // the part file and target file might be on a different storage in case of a single file storage (e.g. single file share) |
|
180 | - /** @var \OC\Files\Storage\Storage $partStorage */ |
|
181 | - [$partStorage, $internalPartPath] = $this->fileView->resolvePath($partFilePath); |
|
182 | - /** @var \OC\Files\Storage\Storage $storage */ |
|
183 | - [$storage, $internalPath] = $this->fileView->resolvePath($this->path); |
|
184 | - try { |
|
185 | - if (!$needsPartFile) { |
|
186 | - try { |
|
187 | - $this->changeLock(ILockingProvider::LOCK_EXCLUSIVE); |
|
188 | - } catch (LockedException $e) { |
|
189 | - // during very large uploads, the shared lock we got at the start might have been expired |
|
190 | - // meaning that the above lock can fail not just only because somebody else got a shared lock |
|
191 | - // or because there is no existing shared lock to make exclusive |
|
192 | - // |
|
193 | - // Thus we try to get a new exclusive lock, if the original lock failed because of a different shared |
|
194 | - // lock this will still fail, if our original shared lock expired the new lock will be successful and |
|
195 | - // the entire operation will be safe |
|
196 | - |
|
197 | - try { |
|
198 | - $this->acquireLock(ILockingProvider::LOCK_EXCLUSIVE); |
|
199 | - } catch (LockedException $ex) { |
|
200 | - throw new FileLocked($e->getMessage(), $e->getCode(), $e); |
|
201 | - } |
|
202 | - } |
|
203 | - } |
|
204 | - |
|
205 | - if (!is_resource($data)) { |
|
206 | - $tmpData = fopen('php://temp', 'r+'); |
|
207 | - if ($data !== null) { |
|
208 | - fwrite($tmpData, $data); |
|
209 | - rewind($tmpData); |
|
210 | - } |
|
211 | - $data = $tmpData; |
|
212 | - } |
|
213 | - |
|
214 | - $data = HashWrapper::wrap($data, 'md5', function ($hash) { |
|
215 | - $this->header('X-Hash-MD5: ' . $hash); |
|
216 | - }); |
|
217 | - $data = HashWrapper::wrap($data, 'sha1', function ($hash) { |
|
218 | - $this->header('X-Hash-SHA1: ' . $hash); |
|
219 | - }); |
|
220 | - $data = HashWrapper::wrap($data, 'sha256', function ($hash) { |
|
221 | - $this->header('X-Hash-SHA256: ' . $hash); |
|
222 | - }); |
|
223 | - |
|
224 | - if ($partStorage->instanceOfStorage(Storage\IWriteStreamStorage::class)) { |
|
225 | - $isEOF = false; |
|
226 | - $wrappedData = CallbackWrapper::wrap($data, null, null, null, null, function ($stream) use (&$isEOF) { |
|
227 | - $isEOF = feof($stream); |
|
228 | - }); |
|
229 | - |
|
230 | - $result = true; |
|
231 | - $count = -1; |
|
232 | - try { |
|
233 | - $count = $partStorage->writeStream($internalPartPath, $wrappedData); |
|
234 | - } catch (GenericFileException $e) { |
|
235 | - $result = false; |
|
236 | - } catch (BadGateway $e) { |
|
237 | - throw $e; |
|
238 | - } |
|
239 | - |
|
240 | - |
|
241 | - if ($result === false) { |
|
242 | - $result = $isEOF; |
|
243 | - if (is_resource($wrappedData)) { |
|
244 | - $result = feof($wrappedData); |
|
245 | - } |
|
246 | - } |
|
247 | - } else { |
|
248 | - $target = $partStorage->fopen($internalPartPath, 'wb'); |
|
249 | - if ($target === false) { |
|
250 | - \OC::$server->getLogger()->error('\OC\Files\Filesystem::fopen() failed', ['app' => 'webdav']); |
|
251 | - // because we have no clue about the cause we can only throw back a 500/Internal Server Error |
|
252 | - throw new Exception($this->l10n->t('Could not write file contents')); |
|
253 | - } |
|
254 | - [$count, $result] = \OC_Helper::streamCopy($data, $target); |
|
255 | - fclose($target); |
|
256 | - } |
|
257 | - |
|
258 | - if ($result === false) { |
|
259 | - $expected = -1; |
|
260 | - if (isset($_SERVER['CONTENT_LENGTH'])) { |
|
261 | - $expected = $_SERVER['CONTENT_LENGTH']; |
|
262 | - } |
|
263 | - if ($expected !== "0") { |
|
264 | - throw new Exception( |
|
265 | - $this->l10n->t( |
|
266 | - 'Error while copying file to target location (copied: %1$s, expected filesize: %2$s)', |
|
267 | - [ |
|
268 | - $this->l10n->n('%n byte', '%n bytes', $count), |
|
269 | - $this->l10n->n('%n byte', '%n bytes', $expected), |
|
270 | - ], |
|
271 | - ) |
|
272 | - ); |
|
273 | - } |
|
274 | - } |
|
275 | - |
|
276 | - // if content length is sent by client: |
|
277 | - // double check if the file was fully received |
|
278 | - // compare expected and actual size |
|
279 | - if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['REQUEST_METHOD'] === 'PUT') { |
|
280 | - $expected = (int)$_SERVER['CONTENT_LENGTH']; |
|
281 | - if ($count !== $expected) { |
|
282 | - throw new BadRequest( |
|
283 | - $this->l10n->t( |
|
284 | - 'Expected filesize of %1$s but read (from Nextcloud client) and wrote (to Nextcloud storage) %2$s. Could either be a network problem on the sending side or a problem writing to the storage on the server side.', |
|
285 | - [ |
|
286 | - $this->l10n->n('%n byte', '%n bytes', $expected), |
|
287 | - $this->l10n->n('%n byte', '%n bytes', $count), |
|
288 | - ], |
|
289 | - ) |
|
290 | - ); |
|
291 | - } |
|
292 | - } |
|
293 | - } catch (\Exception $e) { |
|
294 | - $context = []; |
|
295 | - |
|
296 | - if ($e instanceof LockedException) { |
|
297 | - $context['level'] = ILogger::DEBUG; |
|
298 | - } |
|
299 | - |
|
300 | - \OC::$server->getLogger()->logException($e, $context); |
|
301 | - if ($needsPartFile) { |
|
302 | - $partStorage->unlink($internalPartPath); |
|
303 | - } |
|
304 | - $this->convertToSabreException($e); |
|
305 | - } |
|
306 | - |
|
307 | - try { |
|
308 | - if ($needsPartFile) { |
|
309 | - if ($view && !$this->emitPreHooks($exists)) { |
|
310 | - $partStorage->unlink($internalPartPath); |
|
311 | - throw new Exception($this->l10n->t('Could not rename part file to final file, canceled by hook')); |
|
312 | - } |
|
313 | - try { |
|
314 | - $this->changeLock(ILockingProvider::LOCK_EXCLUSIVE); |
|
315 | - } catch (LockedException $e) { |
|
316 | - // during very large uploads, the shared lock we got at the start might have been expired |
|
317 | - // meaning that the above lock can fail not just only because somebody else got a shared lock |
|
318 | - // or because there is no existing shared lock to make exclusive |
|
319 | - // |
|
320 | - // Thus we try to get a new exclusive lock, if the original lock failed because of a different shared |
|
321 | - // lock this will still fail, if our original shared lock expired the new lock will be successful and |
|
322 | - // the entire operation will be safe |
|
323 | - |
|
324 | - try { |
|
325 | - $this->acquireLock(ILockingProvider::LOCK_EXCLUSIVE); |
|
326 | - } catch (LockedException $ex) { |
|
327 | - if ($needsPartFile) { |
|
328 | - $partStorage->unlink($internalPartPath); |
|
329 | - } |
|
330 | - throw new FileLocked($e->getMessage(), $e->getCode(), $e); |
|
331 | - } |
|
332 | - } |
|
333 | - |
|
334 | - // rename to correct path |
|
335 | - try { |
|
336 | - $renameOkay = $storage->moveFromStorage($partStorage, $internalPartPath, $internalPath); |
|
337 | - $fileExists = $storage->file_exists($internalPath); |
|
338 | - if ($renameOkay === false || $fileExists === false) { |
|
339 | - \OC::$server->getLogger()->error('renaming part file to final file failed $renameOkay: ' . ($renameOkay ? 'true' : 'false') . ', $fileExists: ' . ($fileExists ? 'true' : 'false') . ')', ['app' => 'webdav']); |
|
340 | - throw new Exception($this->l10n->t('Could not rename part file to final file')); |
|
341 | - } |
|
342 | - } catch (ForbiddenException $ex) { |
|
343 | - if (!$ex->getRetry()) { |
|
344 | - $partStorage->unlink($internalPartPath); |
|
345 | - } |
|
346 | - throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry()); |
|
347 | - } catch (\Exception $e) { |
|
348 | - $partStorage->unlink($internalPartPath); |
|
349 | - $this->convertToSabreException($e); |
|
350 | - } |
|
351 | - } |
|
352 | - |
|
353 | - // since we skipped the view we need to scan and emit the hooks ourselves |
|
354 | - $storage->getUpdater()->update($internalPath); |
|
355 | - |
|
356 | - try { |
|
357 | - $this->changeLock(ILockingProvider::LOCK_SHARED); |
|
358 | - } catch (LockedException $e) { |
|
359 | - throw new FileLocked($e->getMessage(), $e->getCode(), $e); |
|
360 | - } |
|
361 | - |
|
362 | - // allow sync clients to send the mtime along in a header |
|
363 | - if (isset($this->request->server['HTTP_X_OC_MTIME'])) { |
|
364 | - $mtime = $this->sanitizeMtime($this->request->server['HTTP_X_OC_MTIME']); |
|
365 | - if ($this->fileView->touch($this->path, $mtime)) { |
|
366 | - $this->header('X-OC-MTime: accepted'); |
|
367 | - } |
|
368 | - } |
|
369 | - |
|
370 | - $fileInfoUpdate = [ |
|
371 | - 'upload_time' => time() |
|
372 | - ]; |
|
373 | - |
|
374 | - // allow sync clients to send the creation time along in a header |
|
375 | - if (isset($this->request->server['HTTP_X_OC_CTIME'])) { |
|
376 | - $ctime = $this->sanitizeMtime($this->request->server['HTTP_X_OC_CTIME']); |
|
377 | - $fileInfoUpdate['creation_time'] = $ctime; |
|
378 | - $this->header('X-OC-CTime: accepted'); |
|
379 | - } |
|
380 | - |
|
381 | - $this->fileView->putFileInfo($this->path, $fileInfoUpdate); |
|
382 | - |
|
383 | - if ($view) { |
|
384 | - $this->emitPostHooks($exists); |
|
385 | - } |
|
386 | - |
|
387 | - $this->refreshInfo(); |
|
388 | - |
|
389 | - if (isset($this->request->server['HTTP_OC_CHECKSUM'])) { |
|
390 | - $checksum = trim($this->request->server['HTTP_OC_CHECKSUM']); |
|
391 | - $this->setChecksum($checksum); |
|
392 | - } elseif ($this->getChecksum() !== null && $this->getChecksum() !== '') { |
|
393 | - $this->setChecksum(''); |
|
394 | - } |
|
395 | - } catch (StorageNotAvailableException $e) { |
|
396 | - throw new ServiceUnavailable($this->l10n->t('Failed to check file size: %1$s', [$e->getMessage()]), 0, $e); |
|
397 | - } |
|
398 | - |
|
399 | - return '"' . $this->info->getEtag() . '"'; |
|
400 | - } |
|
401 | - |
|
402 | - private function getPartFileBasePath($path) { |
|
403 | - $partFileInStorage = \OC::$server->getConfig()->getSystemValue('part_file_in_storage', true); |
|
404 | - if ($partFileInStorage) { |
|
405 | - return $path; |
|
406 | - } else { |
|
407 | - return md5($path); // will place it in the root of the view with a unique name |
|
408 | - } |
|
409 | - } |
|
410 | - |
|
411 | - /** |
|
412 | - * @param string $path |
|
413 | - */ |
|
414 | - private function emitPreHooks($exists, $path = null) { |
|
415 | - if (is_null($path)) { |
|
416 | - $path = $this->path; |
|
417 | - } |
|
418 | - $hookPath = Filesystem::getView()->getRelativePath($this->fileView->getAbsolutePath($path)); |
|
419 | - $run = true; |
|
420 | - |
|
421 | - if (!$exists) { |
|
422 | - \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_create, [ |
|
423 | - \OC\Files\Filesystem::signal_param_path => $hookPath, |
|
424 | - \OC\Files\Filesystem::signal_param_run => &$run, |
|
425 | - ]); |
|
426 | - } else { |
|
427 | - \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_update, [ |
|
428 | - \OC\Files\Filesystem::signal_param_path => $hookPath, |
|
429 | - \OC\Files\Filesystem::signal_param_run => &$run, |
|
430 | - ]); |
|
431 | - } |
|
432 | - \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_write, [ |
|
433 | - \OC\Files\Filesystem::signal_param_path => $hookPath, |
|
434 | - \OC\Files\Filesystem::signal_param_run => &$run, |
|
435 | - ]); |
|
436 | - return $run; |
|
437 | - } |
|
438 | - |
|
439 | - /** |
|
440 | - * @param string $path |
|
441 | - */ |
|
442 | - private function emitPostHooks($exists, $path = null) { |
|
443 | - if (is_null($path)) { |
|
444 | - $path = $this->path; |
|
445 | - } |
|
446 | - $hookPath = Filesystem::getView()->getRelativePath($this->fileView->getAbsolutePath($path)); |
|
447 | - if (!$exists) { |
|
448 | - \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_create, [ |
|
449 | - \OC\Files\Filesystem::signal_param_path => $hookPath |
|
450 | - ]); |
|
451 | - } else { |
|
452 | - \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_update, [ |
|
453 | - \OC\Files\Filesystem::signal_param_path => $hookPath |
|
454 | - ]); |
|
455 | - } |
|
456 | - \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_write, [ |
|
457 | - \OC\Files\Filesystem::signal_param_path => $hookPath |
|
458 | - ]); |
|
459 | - } |
|
460 | - |
|
461 | - /** |
|
462 | - * Returns the data |
|
463 | - * |
|
464 | - * @return resource |
|
465 | - * @throws Forbidden |
|
466 | - * @throws ServiceUnavailable |
|
467 | - */ |
|
468 | - public function get() { |
|
469 | - //throw exception if encryption is disabled but files are still encrypted |
|
470 | - try { |
|
471 | - if (!$this->info->isReadable()) { |
|
472 | - // do a if the file did not exist |
|
473 | - throw new NotFound(); |
|
474 | - } |
|
475 | - try { |
|
476 | - $res = $this->fileView->fopen(ltrim($this->path, '/'), 'rb'); |
|
477 | - } catch (\Exception $e) { |
|
478 | - $this->convertToSabreException($e); |
|
479 | - } |
|
480 | - if ($res === false) { |
|
481 | - throw new ServiceUnavailable($this->l10n->t('Could not open file')); |
|
482 | - } |
|
483 | - return $res; |
|
484 | - } catch (GenericEncryptionException $e) { |
|
485 | - // returning 503 will allow retry of the operation at a later point in time |
|
486 | - throw new ServiceUnavailable($this->l10n->t('Encryption not ready: %1$s', [$e->getMessage()])); |
|
487 | - } catch (StorageNotAvailableException $e) { |
|
488 | - throw new ServiceUnavailable($this->l10n->t('Failed to open file: %1$s', [$e->getMessage()])); |
|
489 | - } catch (ForbiddenException $ex) { |
|
490 | - throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry()); |
|
491 | - } catch (LockedException $e) { |
|
492 | - throw new FileLocked($e->getMessage(), $e->getCode(), $e); |
|
493 | - } |
|
494 | - } |
|
495 | - |
|
496 | - /** |
|
497 | - * Delete the current file |
|
498 | - * |
|
499 | - * @throws Forbidden |
|
500 | - * @throws ServiceUnavailable |
|
501 | - */ |
|
502 | - public function delete() { |
|
503 | - if (!$this->info->isDeletable()) { |
|
504 | - throw new Forbidden(); |
|
505 | - } |
|
506 | - |
|
507 | - try { |
|
508 | - if (!$this->fileView->unlink($this->path)) { |
|
509 | - // assume it wasn't possible to delete due to permissions |
|
510 | - throw new Forbidden(); |
|
511 | - } |
|
512 | - } catch (StorageNotAvailableException $e) { |
|
513 | - throw new ServiceUnavailable($this->l10n->t('Failed to unlink: %1$s', [$e->getMessage()])); |
|
514 | - } catch (ForbiddenException $ex) { |
|
515 | - throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry()); |
|
516 | - } catch (LockedException $e) { |
|
517 | - throw new FileLocked($e->getMessage(), $e->getCode(), $e); |
|
518 | - } |
|
519 | - } |
|
520 | - |
|
521 | - /** |
|
522 | - * Returns the mime-type for a file |
|
523 | - * |
|
524 | - * If null is returned, we'll assume application/octet-stream |
|
525 | - * |
|
526 | - * @return string |
|
527 | - */ |
|
528 | - public function getContentType() { |
|
529 | - $mimeType = $this->info->getMimetype(); |
|
530 | - |
|
531 | - // PROPFIND needs to return the correct mime type, for consistency with the web UI |
|
532 | - if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PROPFIND') { |
|
533 | - return $mimeType; |
|
534 | - } |
|
535 | - return \OC::$server->getMimeTypeDetector()->getSecureMimeType($mimeType); |
|
536 | - } |
|
537 | - |
|
538 | - /** |
|
539 | - * @return array|bool |
|
540 | - */ |
|
541 | - public function getDirectDownload() { |
|
542 | - if (\OCP\App::isEnabled('encryption')) { |
|
543 | - return []; |
|
544 | - } |
|
545 | - /** @var \OCP\Files\Storage $storage */ |
|
546 | - [$storage, $internalPath] = $this->fileView->resolvePath($this->path); |
|
547 | - if (is_null($storage)) { |
|
548 | - return []; |
|
549 | - } |
|
550 | - |
|
551 | - return $storage->getDirectDownload($internalPath); |
|
552 | - } |
|
553 | - |
|
554 | - /** |
|
555 | - * @param resource $data |
|
556 | - * @return null|string |
|
557 | - * @throws Exception |
|
558 | - * @throws BadRequest |
|
559 | - * @throws NotImplemented |
|
560 | - * @throws ServiceUnavailable |
|
561 | - */ |
|
562 | - private function createFileChunked($data) { |
|
563 | - [$path, $name] = \Sabre\Uri\split($this->path); |
|
564 | - |
|
565 | - $info = \OC_FileChunking::decodeName($name); |
|
566 | - if (empty($info)) { |
|
567 | - throw new NotImplemented($this->l10n->t('Invalid chunk name')); |
|
568 | - } |
|
569 | - |
|
570 | - $chunk_handler = new \OC_FileChunking($info); |
|
571 | - $bytesWritten = $chunk_handler->store($info['index'], $data); |
|
572 | - |
|
573 | - //detect aborted upload |
|
574 | - if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PUT') { |
|
575 | - if (isset($_SERVER['CONTENT_LENGTH'])) { |
|
576 | - $expected = (int)$_SERVER['CONTENT_LENGTH']; |
|
577 | - if ($bytesWritten !== $expected) { |
|
578 | - $chunk_handler->remove($info['index']); |
|
579 | - throw new BadRequest( |
|
580 | - $this->l10n->t( |
|
581 | - 'Expected filesize of %1$s but read (from Nextcloud client) and wrote (to Nextcloud storage) %2$s. Could either be a network problem on the sending side or a problem writing to the storage on the server side.', |
|
582 | - [ |
|
583 | - $this->l10n->n('%n byte', '%n bytes', $expected), |
|
584 | - $this->l10n->n('%n byte', '%n bytes', $bytesWritten), |
|
585 | - ], |
|
586 | - ) |
|
587 | - ); |
|
588 | - } |
|
589 | - } |
|
590 | - } |
|
591 | - |
|
592 | - if ($chunk_handler->isComplete()) { |
|
593 | - /** @var Storage $storage */ |
|
594 | - [$storage,] = $this->fileView->resolvePath($path); |
|
595 | - $needsPartFile = $storage->needsPartFile(); |
|
596 | - $partFile = null; |
|
597 | - |
|
598 | - $targetPath = $path . '/' . $info['name']; |
|
599 | - /** @var \OC\Files\Storage\Storage $targetStorage */ |
|
600 | - [$targetStorage, $targetInternalPath] = $this->fileView->resolvePath($targetPath); |
|
601 | - |
|
602 | - $exists = $this->fileView->file_exists($targetPath); |
|
603 | - |
|
604 | - try { |
|
605 | - $this->fileView->lockFile($targetPath, ILockingProvider::LOCK_SHARED); |
|
606 | - |
|
607 | - $this->emitPreHooks($exists, $targetPath); |
|
608 | - $this->fileView->changeLock($targetPath, ILockingProvider::LOCK_EXCLUSIVE); |
|
609 | - /** @var \OC\Files\Storage\Storage $targetStorage */ |
|
610 | - [$targetStorage, $targetInternalPath] = $this->fileView->resolvePath($targetPath); |
|
611 | - |
|
612 | - if ($needsPartFile) { |
|
613 | - // we first assembly the target file as a part file |
|
614 | - $partFile = $this->getPartFileBasePath($path . '/' . $info['name']) . '.ocTransferId' . $info['transferid'] . '.part'; |
|
615 | - /** @var \OC\Files\Storage\Storage $targetStorage */ |
|
616 | - [$partStorage, $partInternalPath] = $this->fileView->resolvePath($partFile); |
|
617 | - |
|
618 | - |
|
619 | - $chunk_handler->file_assemble($partStorage, $partInternalPath); |
|
620 | - |
|
621 | - // here is the final atomic rename |
|
622 | - $renameOkay = $targetStorage->moveFromStorage($partStorage, $partInternalPath, $targetInternalPath); |
|
623 | - $fileExists = $targetStorage->file_exists($targetInternalPath); |
|
624 | - if ($renameOkay === false || $fileExists === false) { |
|
625 | - \OC::$server->getLogger()->error('\OC\Files\Filesystem::rename() failed', ['app' => 'webdav']); |
|
626 | - // only delete if an error occurred and the target file was already created |
|
627 | - if ($fileExists) { |
|
628 | - // set to null to avoid double-deletion when handling exception |
|
629 | - // stray part file |
|
630 | - $partFile = null; |
|
631 | - $targetStorage->unlink($targetInternalPath); |
|
632 | - } |
|
633 | - $this->fileView->changeLock($targetPath, ILockingProvider::LOCK_SHARED); |
|
634 | - throw new Exception($this->l10n->t('Could not rename part file assembled from chunks')); |
|
635 | - } |
|
636 | - } else { |
|
637 | - // assemble directly into the final file |
|
638 | - $chunk_handler->file_assemble($targetStorage, $targetInternalPath); |
|
639 | - } |
|
640 | - |
|
641 | - // allow sync clients to send the mtime along in a header |
|
642 | - if (isset($this->request->server['HTTP_X_OC_MTIME'])) { |
|
643 | - $mtime = $this->sanitizeMtime($this->request->server['HTTP_X_OC_MTIME']); |
|
644 | - if ($targetStorage->touch($targetInternalPath, $mtime)) { |
|
645 | - $this->header('X-OC-MTime: accepted'); |
|
646 | - } |
|
647 | - } |
|
648 | - |
|
649 | - // since we skipped the view we need to scan and emit the hooks ourselves |
|
650 | - $targetStorage->getUpdater()->update($targetInternalPath); |
|
651 | - |
|
652 | - $this->fileView->changeLock($targetPath, ILockingProvider::LOCK_SHARED); |
|
653 | - |
|
654 | - $this->emitPostHooks($exists, $targetPath); |
|
655 | - |
|
656 | - // FIXME: should call refreshInfo but can't because $this->path is not the of the final file |
|
657 | - $info = $this->fileView->getFileInfo($targetPath); |
|
658 | - |
|
659 | - if (isset($this->request->server['HTTP_OC_CHECKSUM'])) { |
|
660 | - $checksum = trim($this->request->server['HTTP_OC_CHECKSUM']); |
|
661 | - $this->fileView->putFileInfo($targetPath, ['checksum' => $checksum]); |
|
662 | - } elseif ($info->getChecksum() !== null && $info->getChecksum() !== '') { |
|
663 | - $this->fileView->putFileInfo($this->path, ['checksum' => '']); |
|
664 | - } |
|
665 | - |
|
666 | - $this->fileView->unlockFile($targetPath, ILockingProvider::LOCK_SHARED); |
|
667 | - |
|
668 | - return $info->getEtag(); |
|
669 | - } catch (\Exception $e) { |
|
670 | - if ($partFile !== null) { |
|
671 | - $targetStorage->unlink($targetInternalPath); |
|
672 | - } |
|
673 | - $this->convertToSabreException($e); |
|
674 | - } |
|
675 | - } |
|
676 | - |
|
677 | - return null; |
|
678 | - } |
|
679 | - |
|
680 | - /** |
|
681 | - * Convert the given exception to a SabreException instance |
|
682 | - * |
|
683 | - * @param \Exception $e |
|
684 | - * |
|
685 | - * @throws \Sabre\DAV\Exception |
|
686 | - */ |
|
687 | - private function convertToSabreException(\Exception $e) { |
|
688 | - if ($e instanceof \Sabre\DAV\Exception) { |
|
689 | - throw $e; |
|
690 | - } |
|
691 | - if ($e instanceof NotPermittedException) { |
|
692 | - // a more general case - due to whatever reason the content could not be written |
|
693 | - throw new Forbidden($e->getMessage(), 0, $e); |
|
694 | - } |
|
695 | - if ($e instanceof ForbiddenException) { |
|
696 | - // the path for the file was forbidden |
|
697 | - throw new DAVForbiddenException($e->getMessage(), $e->getRetry(), $e); |
|
698 | - } |
|
699 | - if ($e instanceof EntityTooLargeException) { |
|
700 | - // the file is too big to be stored |
|
701 | - throw new EntityTooLarge($e->getMessage(), 0, $e); |
|
702 | - } |
|
703 | - if ($e instanceof InvalidContentException) { |
|
704 | - // the file content is not permitted |
|
705 | - throw new UnsupportedMediaType($e->getMessage(), 0, $e); |
|
706 | - } |
|
707 | - if ($e instanceof InvalidPathException) { |
|
708 | - // the path for the file was not valid |
|
709 | - // TODO: find proper http status code for this case |
|
710 | - throw new Forbidden($e->getMessage(), 0, $e); |
|
711 | - } |
|
712 | - if ($e instanceof LockedException || $e instanceof LockNotAcquiredException) { |
|
713 | - // the file is currently being written to by another process |
|
714 | - throw new FileLocked($e->getMessage(), $e->getCode(), $e); |
|
715 | - } |
|
716 | - if ($e instanceof GenericEncryptionException) { |
|
717 | - // returning 503 will allow retry of the operation at a later point in time |
|
718 | - throw new ServiceUnavailable($this->l10n->t('Encryption not ready: %1$s', [$e->getMessage()]), 0, $e); |
|
719 | - } |
|
720 | - if ($e instanceof StorageNotAvailableException) { |
|
721 | - throw new ServiceUnavailable($this->l10n->t('Failed to write file contents: %1$s', [$e->getMessage()]), 0, $e); |
|
722 | - } |
|
723 | - if ($e instanceof NotFoundException) { |
|
724 | - throw new NotFound($this->l10n->t('File not found: %1$s', [$e->getMessage()]), 0, $e); |
|
725 | - } |
|
726 | - |
|
727 | - throw new \Sabre\DAV\Exception($e->getMessage(), 0, $e); |
|
728 | - } |
|
729 | - |
|
730 | - /** |
|
731 | - * Get the checksum for this file |
|
732 | - * |
|
733 | - * @return string|null |
|
734 | - */ |
|
735 | - public function getChecksum() { |
|
736 | - if (!$this->info) { |
|
737 | - return null; |
|
738 | - } |
|
739 | - return $this->info->getChecksum(); |
|
740 | - } |
|
741 | - |
|
742 | - public function setChecksum(string $checksum) { |
|
743 | - $this->fileView->putFileInfo($this->path, ['checksum' => $checksum]); |
|
744 | - $this->refreshInfo(); |
|
745 | - } |
|
746 | - |
|
747 | - protected function header($string) { |
|
748 | - if (!\OC::$CLI) { |
|
749 | - \header($string); |
|
750 | - } |
|
751 | - } |
|
752 | - |
|
753 | - public function hash(string $type) { |
|
754 | - return $this->fileView->hash($type, $this->path); |
|
755 | - } |
|
79 | + protected $request; |
|
80 | + |
|
81 | + protected IL10N $l10n; |
|
82 | + |
|
83 | + /** |
|
84 | + * Sets up the node, expects a full path name |
|
85 | + * |
|
86 | + * @param \OC\Files\View $view |
|
87 | + * @param \OCP\Files\FileInfo $info |
|
88 | + * @param \OCP\Share\IManager $shareManager |
|
89 | + * @param \OC\AppFramework\Http\Request $request |
|
90 | + */ |
|
91 | + public function __construct(View $view, FileInfo $info, IManager $shareManager = null, Request $request = null) { |
|
92 | + parent::__construct($view, $info, $shareManager); |
|
93 | + |
|
94 | + // Querying IL10N directly results in a dependency loop |
|
95 | + /** @var IL10NFactory $l10nFactory */ |
|
96 | + $l10nFactory = \OC::$server->get(IL10NFactory::class); |
|
97 | + $this->l10n = $l10nFactory->get(Application::APP_ID); |
|
98 | + |
|
99 | + if (isset($request)) { |
|
100 | + $this->request = $request; |
|
101 | + } else { |
|
102 | + $this->request = \OC::$server->getRequest(); |
|
103 | + } |
|
104 | + } |
|
105 | + |
|
106 | + /** |
|
107 | + * Updates the data |
|
108 | + * |
|
109 | + * The data argument is a readable stream resource. |
|
110 | + * |
|
111 | + * After a successful put operation, you may choose to return an ETag. The |
|
112 | + * etag must always be surrounded by double-quotes. These quotes must |
|
113 | + * appear in the actual string you're returning. |
|
114 | + * |
|
115 | + * Clients may use the ETag from a PUT request to later on make sure that |
|
116 | + * when they update the file, the contents haven't changed in the mean |
|
117 | + * time. |
|
118 | + * |
|
119 | + * If you don't plan to store the file byte-by-byte, and you return a |
|
120 | + * different object on a subsequent GET you are strongly recommended to not |
|
121 | + * return an ETag, and just return null. |
|
122 | + * |
|
123 | + * @param resource $data |
|
124 | + * |
|
125 | + * @throws Forbidden |
|
126 | + * @throws UnsupportedMediaType |
|
127 | + * @throws BadRequest |
|
128 | + * @throws Exception |
|
129 | + * @throws EntityTooLarge |
|
130 | + * @throws ServiceUnavailable |
|
131 | + * @throws FileLocked |
|
132 | + * @return string|null |
|
133 | + */ |
|
134 | + public function put($data) { |
|
135 | + try { |
|
136 | + $exists = $this->fileView->file_exists($this->path); |
|
137 | + if ($this->info && $exists && !$this->info->isUpdateable()) { |
|
138 | + throw new Forbidden(); |
|
139 | + } |
|
140 | + } catch (StorageNotAvailableException $e) { |
|
141 | + throw new ServiceUnavailable($this->l10n->t('File is not updatable: %1$s', [$e->getMessage()])); |
|
142 | + } |
|
143 | + |
|
144 | + // verify path of the target |
|
145 | + $this->verifyPath(); |
|
146 | + |
|
147 | + // chunked handling |
|
148 | + if (isset($_SERVER['HTTP_OC_CHUNKED'])) { |
|
149 | + try { |
|
150 | + return $this->createFileChunked($data); |
|
151 | + } catch (\Exception $e) { |
|
152 | + $this->convertToSabreException($e); |
|
153 | + } |
|
154 | + } |
|
155 | + |
|
156 | + /** @var Storage $partStorage */ |
|
157 | + [$partStorage] = $this->fileView->resolvePath($this->path); |
|
158 | + $needsPartFile = $partStorage->needsPartFile() && (strlen($this->path) > 1); |
|
159 | + |
|
160 | + $view = \OC\Files\Filesystem::getView(); |
|
161 | + |
|
162 | + if ($needsPartFile) { |
|
163 | + // mark file as partial while uploading (ignored by the scanner) |
|
164 | + $partFilePath = $this->getPartFileBasePath($this->path) . '.ocTransferId' . rand() . '.part'; |
|
165 | + |
|
166 | + if (!$view->isCreatable($partFilePath) && $view->isUpdatable($this->path)) { |
|
167 | + $needsPartFile = false; |
|
168 | + } |
|
169 | + } |
|
170 | + if (!$needsPartFile) { |
|
171 | + // upload file directly as the final path |
|
172 | + $partFilePath = $this->path; |
|
173 | + |
|
174 | + if ($view && !$this->emitPreHooks($exists)) { |
|
175 | + throw new Exception($this->l10n->t('Could not write to final file, canceled by hook')); |
|
176 | + } |
|
177 | + } |
|
178 | + |
|
179 | + // the part file and target file might be on a different storage in case of a single file storage (e.g. single file share) |
|
180 | + /** @var \OC\Files\Storage\Storage $partStorage */ |
|
181 | + [$partStorage, $internalPartPath] = $this->fileView->resolvePath($partFilePath); |
|
182 | + /** @var \OC\Files\Storage\Storage $storage */ |
|
183 | + [$storage, $internalPath] = $this->fileView->resolvePath($this->path); |
|
184 | + try { |
|
185 | + if (!$needsPartFile) { |
|
186 | + try { |
|
187 | + $this->changeLock(ILockingProvider::LOCK_EXCLUSIVE); |
|
188 | + } catch (LockedException $e) { |
|
189 | + // during very large uploads, the shared lock we got at the start might have been expired |
|
190 | + // meaning that the above lock can fail not just only because somebody else got a shared lock |
|
191 | + // or because there is no existing shared lock to make exclusive |
|
192 | + // |
|
193 | + // Thus we try to get a new exclusive lock, if the original lock failed because of a different shared |
|
194 | + // lock this will still fail, if our original shared lock expired the new lock will be successful and |
|
195 | + // the entire operation will be safe |
|
196 | + |
|
197 | + try { |
|
198 | + $this->acquireLock(ILockingProvider::LOCK_EXCLUSIVE); |
|
199 | + } catch (LockedException $ex) { |
|
200 | + throw new FileLocked($e->getMessage(), $e->getCode(), $e); |
|
201 | + } |
|
202 | + } |
|
203 | + } |
|
204 | + |
|
205 | + if (!is_resource($data)) { |
|
206 | + $tmpData = fopen('php://temp', 'r+'); |
|
207 | + if ($data !== null) { |
|
208 | + fwrite($tmpData, $data); |
|
209 | + rewind($tmpData); |
|
210 | + } |
|
211 | + $data = $tmpData; |
|
212 | + } |
|
213 | + |
|
214 | + $data = HashWrapper::wrap($data, 'md5', function ($hash) { |
|
215 | + $this->header('X-Hash-MD5: ' . $hash); |
|
216 | + }); |
|
217 | + $data = HashWrapper::wrap($data, 'sha1', function ($hash) { |
|
218 | + $this->header('X-Hash-SHA1: ' . $hash); |
|
219 | + }); |
|
220 | + $data = HashWrapper::wrap($data, 'sha256', function ($hash) { |
|
221 | + $this->header('X-Hash-SHA256: ' . $hash); |
|
222 | + }); |
|
223 | + |
|
224 | + if ($partStorage->instanceOfStorage(Storage\IWriteStreamStorage::class)) { |
|
225 | + $isEOF = false; |
|
226 | + $wrappedData = CallbackWrapper::wrap($data, null, null, null, null, function ($stream) use (&$isEOF) { |
|
227 | + $isEOF = feof($stream); |
|
228 | + }); |
|
229 | + |
|
230 | + $result = true; |
|
231 | + $count = -1; |
|
232 | + try { |
|
233 | + $count = $partStorage->writeStream($internalPartPath, $wrappedData); |
|
234 | + } catch (GenericFileException $e) { |
|
235 | + $result = false; |
|
236 | + } catch (BadGateway $e) { |
|
237 | + throw $e; |
|
238 | + } |
|
239 | + |
|
240 | + |
|
241 | + if ($result === false) { |
|
242 | + $result = $isEOF; |
|
243 | + if (is_resource($wrappedData)) { |
|
244 | + $result = feof($wrappedData); |
|
245 | + } |
|
246 | + } |
|
247 | + } else { |
|
248 | + $target = $partStorage->fopen($internalPartPath, 'wb'); |
|
249 | + if ($target === false) { |
|
250 | + \OC::$server->getLogger()->error('\OC\Files\Filesystem::fopen() failed', ['app' => 'webdav']); |
|
251 | + // because we have no clue about the cause we can only throw back a 500/Internal Server Error |
|
252 | + throw new Exception($this->l10n->t('Could not write file contents')); |
|
253 | + } |
|
254 | + [$count, $result] = \OC_Helper::streamCopy($data, $target); |
|
255 | + fclose($target); |
|
256 | + } |
|
257 | + |
|
258 | + if ($result === false) { |
|
259 | + $expected = -1; |
|
260 | + if (isset($_SERVER['CONTENT_LENGTH'])) { |
|
261 | + $expected = $_SERVER['CONTENT_LENGTH']; |
|
262 | + } |
|
263 | + if ($expected !== "0") { |
|
264 | + throw new Exception( |
|
265 | + $this->l10n->t( |
|
266 | + 'Error while copying file to target location (copied: %1$s, expected filesize: %2$s)', |
|
267 | + [ |
|
268 | + $this->l10n->n('%n byte', '%n bytes', $count), |
|
269 | + $this->l10n->n('%n byte', '%n bytes', $expected), |
|
270 | + ], |
|
271 | + ) |
|
272 | + ); |
|
273 | + } |
|
274 | + } |
|
275 | + |
|
276 | + // if content length is sent by client: |
|
277 | + // double check if the file was fully received |
|
278 | + // compare expected and actual size |
|
279 | + if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['REQUEST_METHOD'] === 'PUT') { |
|
280 | + $expected = (int)$_SERVER['CONTENT_LENGTH']; |
|
281 | + if ($count !== $expected) { |
|
282 | + throw new BadRequest( |
|
283 | + $this->l10n->t( |
|
284 | + 'Expected filesize of %1$s but read (from Nextcloud client) and wrote (to Nextcloud storage) %2$s. Could either be a network problem on the sending side or a problem writing to the storage on the server side.', |
|
285 | + [ |
|
286 | + $this->l10n->n('%n byte', '%n bytes', $expected), |
|
287 | + $this->l10n->n('%n byte', '%n bytes', $count), |
|
288 | + ], |
|
289 | + ) |
|
290 | + ); |
|
291 | + } |
|
292 | + } |
|
293 | + } catch (\Exception $e) { |
|
294 | + $context = []; |
|
295 | + |
|
296 | + if ($e instanceof LockedException) { |
|
297 | + $context['level'] = ILogger::DEBUG; |
|
298 | + } |
|
299 | + |
|
300 | + \OC::$server->getLogger()->logException($e, $context); |
|
301 | + if ($needsPartFile) { |
|
302 | + $partStorage->unlink($internalPartPath); |
|
303 | + } |
|
304 | + $this->convertToSabreException($e); |
|
305 | + } |
|
306 | + |
|
307 | + try { |
|
308 | + if ($needsPartFile) { |
|
309 | + if ($view && !$this->emitPreHooks($exists)) { |
|
310 | + $partStorage->unlink($internalPartPath); |
|
311 | + throw new Exception($this->l10n->t('Could not rename part file to final file, canceled by hook')); |
|
312 | + } |
|
313 | + try { |
|
314 | + $this->changeLock(ILockingProvider::LOCK_EXCLUSIVE); |
|
315 | + } catch (LockedException $e) { |
|
316 | + // during very large uploads, the shared lock we got at the start might have been expired |
|
317 | + // meaning that the above lock can fail not just only because somebody else got a shared lock |
|
318 | + // or because there is no existing shared lock to make exclusive |
|
319 | + // |
|
320 | + // Thus we try to get a new exclusive lock, if the original lock failed because of a different shared |
|
321 | + // lock this will still fail, if our original shared lock expired the new lock will be successful and |
|
322 | + // the entire operation will be safe |
|
323 | + |
|
324 | + try { |
|
325 | + $this->acquireLock(ILockingProvider::LOCK_EXCLUSIVE); |
|
326 | + } catch (LockedException $ex) { |
|
327 | + if ($needsPartFile) { |
|
328 | + $partStorage->unlink($internalPartPath); |
|
329 | + } |
|
330 | + throw new FileLocked($e->getMessage(), $e->getCode(), $e); |
|
331 | + } |
|
332 | + } |
|
333 | + |
|
334 | + // rename to correct path |
|
335 | + try { |
|
336 | + $renameOkay = $storage->moveFromStorage($partStorage, $internalPartPath, $internalPath); |
|
337 | + $fileExists = $storage->file_exists($internalPath); |
|
338 | + if ($renameOkay === false || $fileExists === false) { |
|
339 | + \OC::$server->getLogger()->error('renaming part file to final file failed $renameOkay: ' . ($renameOkay ? 'true' : 'false') . ', $fileExists: ' . ($fileExists ? 'true' : 'false') . ')', ['app' => 'webdav']); |
|
340 | + throw new Exception($this->l10n->t('Could not rename part file to final file')); |
|
341 | + } |
|
342 | + } catch (ForbiddenException $ex) { |
|
343 | + if (!$ex->getRetry()) { |
|
344 | + $partStorage->unlink($internalPartPath); |
|
345 | + } |
|
346 | + throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry()); |
|
347 | + } catch (\Exception $e) { |
|
348 | + $partStorage->unlink($internalPartPath); |
|
349 | + $this->convertToSabreException($e); |
|
350 | + } |
|
351 | + } |
|
352 | + |
|
353 | + // since we skipped the view we need to scan and emit the hooks ourselves |
|
354 | + $storage->getUpdater()->update($internalPath); |
|
355 | + |
|
356 | + try { |
|
357 | + $this->changeLock(ILockingProvider::LOCK_SHARED); |
|
358 | + } catch (LockedException $e) { |
|
359 | + throw new FileLocked($e->getMessage(), $e->getCode(), $e); |
|
360 | + } |
|
361 | + |
|
362 | + // allow sync clients to send the mtime along in a header |
|
363 | + if (isset($this->request->server['HTTP_X_OC_MTIME'])) { |
|
364 | + $mtime = $this->sanitizeMtime($this->request->server['HTTP_X_OC_MTIME']); |
|
365 | + if ($this->fileView->touch($this->path, $mtime)) { |
|
366 | + $this->header('X-OC-MTime: accepted'); |
|
367 | + } |
|
368 | + } |
|
369 | + |
|
370 | + $fileInfoUpdate = [ |
|
371 | + 'upload_time' => time() |
|
372 | + ]; |
|
373 | + |
|
374 | + // allow sync clients to send the creation time along in a header |
|
375 | + if (isset($this->request->server['HTTP_X_OC_CTIME'])) { |
|
376 | + $ctime = $this->sanitizeMtime($this->request->server['HTTP_X_OC_CTIME']); |
|
377 | + $fileInfoUpdate['creation_time'] = $ctime; |
|
378 | + $this->header('X-OC-CTime: accepted'); |
|
379 | + } |
|
380 | + |
|
381 | + $this->fileView->putFileInfo($this->path, $fileInfoUpdate); |
|
382 | + |
|
383 | + if ($view) { |
|
384 | + $this->emitPostHooks($exists); |
|
385 | + } |
|
386 | + |
|
387 | + $this->refreshInfo(); |
|
388 | + |
|
389 | + if (isset($this->request->server['HTTP_OC_CHECKSUM'])) { |
|
390 | + $checksum = trim($this->request->server['HTTP_OC_CHECKSUM']); |
|
391 | + $this->setChecksum($checksum); |
|
392 | + } elseif ($this->getChecksum() !== null && $this->getChecksum() !== '') { |
|
393 | + $this->setChecksum(''); |
|
394 | + } |
|
395 | + } catch (StorageNotAvailableException $e) { |
|
396 | + throw new ServiceUnavailable($this->l10n->t('Failed to check file size: %1$s', [$e->getMessage()]), 0, $e); |
|
397 | + } |
|
398 | + |
|
399 | + return '"' . $this->info->getEtag() . '"'; |
|
400 | + } |
|
401 | + |
|
402 | + private function getPartFileBasePath($path) { |
|
403 | + $partFileInStorage = \OC::$server->getConfig()->getSystemValue('part_file_in_storage', true); |
|
404 | + if ($partFileInStorage) { |
|
405 | + return $path; |
|
406 | + } else { |
|
407 | + return md5($path); // will place it in the root of the view with a unique name |
|
408 | + } |
|
409 | + } |
|
410 | + |
|
411 | + /** |
|
412 | + * @param string $path |
|
413 | + */ |
|
414 | + private function emitPreHooks($exists, $path = null) { |
|
415 | + if (is_null($path)) { |
|
416 | + $path = $this->path; |
|
417 | + } |
|
418 | + $hookPath = Filesystem::getView()->getRelativePath($this->fileView->getAbsolutePath($path)); |
|
419 | + $run = true; |
|
420 | + |
|
421 | + if (!$exists) { |
|
422 | + \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_create, [ |
|
423 | + \OC\Files\Filesystem::signal_param_path => $hookPath, |
|
424 | + \OC\Files\Filesystem::signal_param_run => &$run, |
|
425 | + ]); |
|
426 | + } else { |
|
427 | + \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_update, [ |
|
428 | + \OC\Files\Filesystem::signal_param_path => $hookPath, |
|
429 | + \OC\Files\Filesystem::signal_param_run => &$run, |
|
430 | + ]); |
|
431 | + } |
|
432 | + \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_write, [ |
|
433 | + \OC\Files\Filesystem::signal_param_path => $hookPath, |
|
434 | + \OC\Files\Filesystem::signal_param_run => &$run, |
|
435 | + ]); |
|
436 | + return $run; |
|
437 | + } |
|
438 | + |
|
439 | + /** |
|
440 | + * @param string $path |
|
441 | + */ |
|
442 | + private function emitPostHooks($exists, $path = null) { |
|
443 | + if (is_null($path)) { |
|
444 | + $path = $this->path; |
|
445 | + } |
|
446 | + $hookPath = Filesystem::getView()->getRelativePath($this->fileView->getAbsolutePath($path)); |
|
447 | + if (!$exists) { |
|
448 | + \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_create, [ |
|
449 | + \OC\Files\Filesystem::signal_param_path => $hookPath |
|
450 | + ]); |
|
451 | + } else { |
|
452 | + \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_update, [ |
|
453 | + \OC\Files\Filesystem::signal_param_path => $hookPath |
|
454 | + ]); |
|
455 | + } |
|
456 | + \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_write, [ |
|
457 | + \OC\Files\Filesystem::signal_param_path => $hookPath |
|
458 | + ]); |
|
459 | + } |
|
460 | + |
|
461 | + /** |
|
462 | + * Returns the data |
|
463 | + * |
|
464 | + * @return resource |
|
465 | + * @throws Forbidden |
|
466 | + * @throws ServiceUnavailable |
|
467 | + */ |
|
468 | + public function get() { |
|
469 | + //throw exception if encryption is disabled but files are still encrypted |
|
470 | + try { |
|
471 | + if (!$this->info->isReadable()) { |
|
472 | + // do a if the file did not exist |
|
473 | + throw new NotFound(); |
|
474 | + } |
|
475 | + try { |
|
476 | + $res = $this->fileView->fopen(ltrim($this->path, '/'), 'rb'); |
|
477 | + } catch (\Exception $e) { |
|
478 | + $this->convertToSabreException($e); |
|
479 | + } |
|
480 | + if ($res === false) { |
|
481 | + throw new ServiceUnavailable($this->l10n->t('Could not open file')); |
|
482 | + } |
|
483 | + return $res; |
|
484 | + } catch (GenericEncryptionException $e) { |
|
485 | + // returning 503 will allow retry of the operation at a later point in time |
|
486 | + throw new ServiceUnavailable($this->l10n->t('Encryption not ready: %1$s', [$e->getMessage()])); |
|
487 | + } catch (StorageNotAvailableException $e) { |
|
488 | + throw new ServiceUnavailable($this->l10n->t('Failed to open file: %1$s', [$e->getMessage()])); |
|
489 | + } catch (ForbiddenException $ex) { |
|
490 | + throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry()); |
|
491 | + } catch (LockedException $e) { |
|
492 | + throw new FileLocked($e->getMessage(), $e->getCode(), $e); |
|
493 | + } |
|
494 | + } |
|
495 | + |
|
496 | + /** |
|
497 | + * Delete the current file |
|
498 | + * |
|
499 | + * @throws Forbidden |
|
500 | + * @throws ServiceUnavailable |
|
501 | + */ |
|
502 | + public function delete() { |
|
503 | + if (!$this->info->isDeletable()) { |
|
504 | + throw new Forbidden(); |
|
505 | + } |
|
506 | + |
|
507 | + try { |
|
508 | + if (!$this->fileView->unlink($this->path)) { |
|
509 | + // assume it wasn't possible to delete due to permissions |
|
510 | + throw new Forbidden(); |
|
511 | + } |
|
512 | + } catch (StorageNotAvailableException $e) { |
|
513 | + throw new ServiceUnavailable($this->l10n->t('Failed to unlink: %1$s', [$e->getMessage()])); |
|
514 | + } catch (ForbiddenException $ex) { |
|
515 | + throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry()); |
|
516 | + } catch (LockedException $e) { |
|
517 | + throw new FileLocked($e->getMessage(), $e->getCode(), $e); |
|
518 | + } |
|
519 | + } |
|
520 | + |
|
521 | + /** |
|
522 | + * Returns the mime-type for a file |
|
523 | + * |
|
524 | + * If null is returned, we'll assume application/octet-stream |
|
525 | + * |
|
526 | + * @return string |
|
527 | + */ |
|
528 | + public function getContentType() { |
|
529 | + $mimeType = $this->info->getMimetype(); |
|
530 | + |
|
531 | + // PROPFIND needs to return the correct mime type, for consistency with the web UI |
|
532 | + if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PROPFIND') { |
|
533 | + return $mimeType; |
|
534 | + } |
|
535 | + return \OC::$server->getMimeTypeDetector()->getSecureMimeType($mimeType); |
|
536 | + } |
|
537 | + |
|
538 | + /** |
|
539 | + * @return array|bool |
|
540 | + */ |
|
541 | + public function getDirectDownload() { |
|
542 | + if (\OCP\App::isEnabled('encryption')) { |
|
543 | + return []; |
|
544 | + } |
|
545 | + /** @var \OCP\Files\Storage $storage */ |
|
546 | + [$storage, $internalPath] = $this->fileView->resolvePath($this->path); |
|
547 | + if (is_null($storage)) { |
|
548 | + return []; |
|
549 | + } |
|
550 | + |
|
551 | + return $storage->getDirectDownload($internalPath); |
|
552 | + } |
|
553 | + |
|
554 | + /** |
|
555 | + * @param resource $data |
|
556 | + * @return null|string |
|
557 | + * @throws Exception |
|
558 | + * @throws BadRequest |
|
559 | + * @throws NotImplemented |
|
560 | + * @throws ServiceUnavailable |
|
561 | + */ |
|
562 | + private function createFileChunked($data) { |
|
563 | + [$path, $name] = \Sabre\Uri\split($this->path); |
|
564 | + |
|
565 | + $info = \OC_FileChunking::decodeName($name); |
|
566 | + if (empty($info)) { |
|
567 | + throw new NotImplemented($this->l10n->t('Invalid chunk name')); |
|
568 | + } |
|
569 | + |
|
570 | + $chunk_handler = new \OC_FileChunking($info); |
|
571 | + $bytesWritten = $chunk_handler->store($info['index'], $data); |
|
572 | + |
|
573 | + //detect aborted upload |
|
574 | + if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PUT') { |
|
575 | + if (isset($_SERVER['CONTENT_LENGTH'])) { |
|
576 | + $expected = (int)$_SERVER['CONTENT_LENGTH']; |
|
577 | + if ($bytesWritten !== $expected) { |
|
578 | + $chunk_handler->remove($info['index']); |
|
579 | + throw new BadRequest( |
|
580 | + $this->l10n->t( |
|
581 | + 'Expected filesize of %1$s but read (from Nextcloud client) and wrote (to Nextcloud storage) %2$s. Could either be a network problem on the sending side or a problem writing to the storage on the server side.', |
|
582 | + [ |
|
583 | + $this->l10n->n('%n byte', '%n bytes', $expected), |
|
584 | + $this->l10n->n('%n byte', '%n bytes', $bytesWritten), |
|
585 | + ], |
|
586 | + ) |
|
587 | + ); |
|
588 | + } |
|
589 | + } |
|
590 | + } |
|
591 | + |
|
592 | + if ($chunk_handler->isComplete()) { |
|
593 | + /** @var Storage $storage */ |
|
594 | + [$storage,] = $this->fileView->resolvePath($path); |
|
595 | + $needsPartFile = $storage->needsPartFile(); |
|
596 | + $partFile = null; |
|
597 | + |
|
598 | + $targetPath = $path . '/' . $info['name']; |
|
599 | + /** @var \OC\Files\Storage\Storage $targetStorage */ |
|
600 | + [$targetStorage, $targetInternalPath] = $this->fileView->resolvePath($targetPath); |
|
601 | + |
|
602 | + $exists = $this->fileView->file_exists($targetPath); |
|
603 | + |
|
604 | + try { |
|
605 | + $this->fileView->lockFile($targetPath, ILockingProvider::LOCK_SHARED); |
|
606 | + |
|
607 | + $this->emitPreHooks($exists, $targetPath); |
|
608 | + $this->fileView->changeLock($targetPath, ILockingProvider::LOCK_EXCLUSIVE); |
|
609 | + /** @var \OC\Files\Storage\Storage $targetStorage */ |
|
610 | + [$targetStorage, $targetInternalPath] = $this->fileView->resolvePath($targetPath); |
|
611 | + |
|
612 | + if ($needsPartFile) { |
|
613 | + // we first assembly the target file as a part file |
|
614 | + $partFile = $this->getPartFileBasePath($path . '/' . $info['name']) . '.ocTransferId' . $info['transferid'] . '.part'; |
|
615 | + /** @var \OC\Files\Storage\Storage $targetStorage */ |
|
616 | + [$partStorage, $partInternalPath] = $this->fileView->resolvePath($partFile); |
|
617 | + |
|
618 | + |
|
619 | + $chunk_handler->file_assemble($partStorage, $partInternalPath); |
|
620 | + |
|
621 | + // here is the final atomic rename |
|
622 | + $renameOkay = $targetStorage->moveFromStorage($partStorage, $partInternalPath, $targetInternalPath); |
|
623 | + $fileExists = $targetStorage->file_exists($targetInternalPath); |
|
624 | + if ($renameOkay === false || $fileExists === false) { |
|
625 | + \OC::$server->getLogger()->error('\OC\Files\Filesystem::rename() failed', ['app' => 'webdav']); |
|
626 | + // only delete if an error occurred and the target file was already created |
|
627 | + if ($fileExists) { |
|
628 | + // set to null to avoid double-deletion when handling exception |
|
629 | + // stray part file |
|
630 | + $partFile = null; |
|
631 | + $targetStorage->unlink($targetInternalPath); |
|
632 | + } |
|
633 | + $this->fileView->changeLock($targetPath, ILockingProvider::LOCK_SHARED); |
|
634 | + throw new Exception($this->l10n->t('Could not rename part file assembled from chunks')); |
|
635 | + } |
|
636 | + } else { |
|
637 | + // assemble directly into the final file |
|
638 | + $chunk_handler->file_assemble($targetStorage, $targetInternalPath); |
|
639 | + } |
|
640 | + |
|
641 | + // allow sync clients to send the mtime along in a header |
|
642 | + if (isset($this->request->server['HTTP_X_OC_MTIME'])) { |
|
643 | + $mtime = $this->sanitizeMtime($this->request->server['HTTP_X_OC_MTIME']); |
|
644 | + if ($targetStorage->touch($targetInternalPath, $mtime)) { |
|
645 | + $this->header('X-OC-MTime: accepted'); |
|
646 | + } |
|
647 | + } |
|
648 | + |
|
649 | + // since we skipped the view we need to scan and emit the hooks ourselves |
|
650 | + $targetStorage->getUpdater()->update($targetInternalPath); |
|
651 | + |
|
652 | + $this->fileView->changeLock($targetPath, ILockingProvider::LOCK_SHARED); |
|
653 | + |
|
654 | + $this->emitPostHooks($exists, $targetPath); |
|
655 | + |
|
656 | + // FIXME: should call refreshInfo but can't because $this->path is not the of the final file |
|
657 | + $info = $this->fileView->getFileInfo($targetPath); |
|
658 | + |
|
659 | + if (isset($this->request->server['HTTP_OC_CHECKSUM'])) { |
|
660 | + $checksum = trim($this->request->server['HTTP_OC_CHECKSUM']); |
|
661 | + $this->fileView->putFileInfo($targetPath, ['checksum' => $checksum]); |
|
662 | + } elseif ($info->getChecksum() !== null && $info->getChecksum() !== '') { |
|
663 | + $this->fileView->putFileInfo($this->path, ['checksum' => '']); |
|
664 | + } |
|
665 | + |
|
666 | + $this->fileView->unlockFile($targetPath, ILockingProvider::LOCK_SHARED); |
|
667 | + |
|
668 | + return $info->getEtag(); |
|
669 | + } catch (\Exception $e) { |
|
670 | + if ($partFile !== null) { |
|
671 | + $targetStorage->unlink($targetInternalPath); |
|
672 | + } |
|
673 | + $this->convertToSabreException($e); |
|
674 | + } |
|
675 | + } |
|
676 | + |
|
677 | + return null; |
|
678 | + } |
|
679 | + |
|
680 | + /** |
|
681 | + * Convert the given exception to a SabreException instance |
|
682 | + * |
|
683 | + * @param \Exception $e |
|
684 | + * |
|
685 | + * @throws \Sabre\DAV\Exception |
|
686 | + */ |
|
687 | + private function convertToSabreException(\Exception $e) { |
|
688 | + if ($e instanceof \Sabre\DAV\Exception) { |
|
689 | + throw $e; |
|
690 | + } |
|
691 | + if ($e instanceof NotPermittedException) { |
|
692 | + // a more general case - due to whatever reason the content could not be written |
|
693 | + throw new Forbidden($e->getMessage(), 0, $e); |
|
694 | + } |
|
695 | + if ($e instanceof ForbiddenException) { |
|
696 | + // the path for the file was forbidden |
|
697 | + throw new DAVForbiddenException($e->getMessage(), $e->getRetry(), $e); |
|
698 | + } |
|
699 | + if ($e instanceof EntityTooLargeException) { |
|
700 | + // the file is too big to be stored |
|
701 | + throw new EntityTooLarge($e->getMessage(), 0, $e); |
|
702 | + } |
|
703 | + if ($e instanceof InvalidContentException) { |
|
704 | + // the file content is not permitted |
|
705 | + throw new UnsupportedMediaType($e->getMessage(), 0, $e); |
|
706 | + } |
|
707 | + if ($e instanceof InvalidPathException) { |
|
708 | + // the path for the file was not valid |
|
709 | + // TODO: find proper http status code for this case |
|
710 | + throw new Forbidden($e->getMessage(), 0, $e); |
|
711 | + } |
|
712 | + if ($e instanceof LockedException || $e instanceof LockNotAcquiredException) { |
|
713 | + // the file is currently being written to by another process |
|
714 | + throw new FileLocked($e->getMessage(), $e->getCode(), $e); |
|
715 | + } |
|
716 | + if ($e instanceof GenericEncryptionException) { |
|
717 | + // returning 503 will allow retry of the operation at a later point in time |
|
718 | + throw new ServiceUnavailable($this->l10n->t('Encryption not ready: %1$s', [$e->getMessage()]), 0, $e); |
|
719 | + } |
|
720 | + if ($e instanceof StorageNotAvailableException) { |
|
721 | + throw new ServiceUnavailable($this->l10n->t('Failed to write file contents: %1$s', [$e->getMessage()]), 0, $e); |
|
722 | + } |
|
723 | + if ($e instanceof NotFoundException) { |
|
724 | + throw new NotFound($this->l10n->t('File not found: %1$s', [$e->getMessage()]), 0, $e); |
|
725 | + } |
|
726 | + |
|
727 | + throw new \Sabre\DAV\Exception($e->getMessage(), 0, $e); |
|
728 | + } |
|
729 | + |
|
730 | + /** |
|
731 | + * Get the checksum for this file |
|
732 | + * |
|
733 | + * @return string|null |
|
734 | + */ |
|
735 | + public function getChecksum() { |
|
736 | + if (!$this->info) { |
|
737 | + return null; |
|
738 | + } |
|
739 | + return $this->info->getChecksum(); |
|
740 | + } |
|
741 | + |
|
742 | + public function setChecksum(string $checksum) { |
|
743 | + $this->fileView->putFileInfo($this->path, ['checksum' => $checksum]); |
|
744 | + $this->refreshInfo(); |
|
745 | + } |
|
746 | + |
|
747 | + protected function header($string) { |
|
748 | + if (!\OC::$CLI) { |
|
749 | + \header($string); |
|
750 | + } |
|
751 | + } |
|
752 | + |
|
753 | + public function hash(string $type) { |
|
754 | + return $this->fileView->hash($type, $this->path); |
|
755 | + } |
|
756 | 756 | } |
@@ -28,56 +28,56 @@ |
||
28 | 28 | use Sabre\HTTP\ResponseInterface; |
29 | 29 | |
30 | 30 | class ChecksumUpdatePlugin extends ServerPlugin { |
31 | - /** |
|
32 | - * @var \Sabre\DAV\Server |
|
33 | - */ |
|
34 | - protected $server; |
|
31 | + /** |
|
32 | + * @var \Sabre\DAV\Server |
|
33 | + */ |
|
34 | + protected $server; |
|
35 | 35 | |
36 | - public function initialize(\Sabre\DAV\Server $server) { |
|
37 | - $this->server = $server; |
|
38 | - $server->on('method:PATCH', [$this, 'httpPatch']); |
|
39 | - } |
|
36 | + public function initialize(\Sabre\DAV\Server $server) { |
|
37 | + $this->server = $server; |
|
38 | + $server->on('method:PATCH', [$this, 'httpPatch']); |
|
39 | + } |
|
40 | 40 | |
41 | - public function getPluginName(): string { |
|
42 | - return 'checksumupdate'; |
|
43 | - } |
|
41 | + public function getPluginName(): string { |
|
42 | + return 'checksumupdate'; |
|
43 | + } |
|
44 | 44 | |
45 | - public function getHTTPMethods($path): array { |
|
46 | - $tree = $this->server->tree; |
|
45 | + public function getHTTPMethods($path): array { |
|
46 | + $tree = $this->server->tree; |
|
47 | 47 | |
48 | - if ($tree->nodeExists($path)) { |
|
49 | - $node = $tree->getNodeForPath($path); |
|
50 | - if ($node instanceof File) { |
|
51 | - return ['PATCH']; |
|
52 | - } |
|
53 | - } |
|
48 | + if ($tree->nodeExists($path)) { |
|
49 | + $node = $tree->getNodeForPath($path); |
|
50 | + if ($node instanceof File) { |
|
51 | + return ['PATCH']; |
|
52 | + } |
|
53 | + } |
|
54 | 54 | |
55 | - return []; |
|
56 | - } |
|
55 | + return []; |
|
56 | + } |
|
57 | 57 | |
58 | - public function getFeatures(): array { |
|
59 | - return ['nextcloud-checksum-update']; |
|
60 | - } |
|
58 | + public function getFeatures(): array { |
|
59 | + return ['nextcloud-checksum-update']; |
|
60 | + } |
|
61 | 61 | |
62 | - public function httpPatch(RequestInterface $request, ResponseInterface $response) { |
|
63 | - $path = $request->getPath(); |
|
62 | + public function httpPatch(RequestInterface $request, ResponseInterface $response) { |
|
63 | + $path = $request->getPath(); |
|
64 | 64 | |
65 | - $node = $this->server->tree->getNodeForPath($path); |
|
66 | - if ($node instanceof File) { |
|
67 | - $type = strtolower( |
|
68 | - (string)$request->getHeader('X-Recalculate-Hash') |
|
69 | - ); |
|
65 | + $node = $this->server->tree->getNodeForPath($path); |
|
66 | + if ($node instanceof File) { |
|
67 | + $type = strtolower( |
|
68 | + (string)$request->getHeader('X-Recalculate-Hash') |
|
69 | + ); |
|
70 | 70 | |
71 | - $hash = $node->hash($type); |
|
72 | - if ($hash) { |
|
73 | - $checksum = strtoupper($type) . ':' . $hash; |
|
74 | - $node->setChecksum($checksum); |
|
75 | - $response->addHeader('OC-Checksum', $checksum); |
|
76 | - $response->setHeader('Content-Length', '0'); |
|
77 | - $response->setStatus(204); |
|
71 | + $hash = $node->hash($type); |
|
72 | + if ($hash) { |
|
73 | + $checksum = strtoupper($type) . ':' . $hash; |
|
74 | + $node->setChecksum($checksum); |
|
75 | + $response->addHeader('OC-Checksum', $checksum); |
|
76 | + $response->setHeader('Content-Length', '0'); |
|
77 | + $response->setStatus(204); |
|
78 | 78 | |
79 | - return false; |
|
80 | - } |
|
81 | - } |
|
82 | - } |
|
79 | + return false; |
|
80 | + } |
|
81 | + } |
|
82 | + } |
|
83 | 83 | } |
@@ -65,12 +65,12 @@ |
||
65 | 65 | $node = $this->server->tree->getNodeForPath($path); |
66 | 66 | if ($node instanceof File) { |
67 | 67 | $type = strtolower( |
68 | - (string)$request->getHeader('X-Recalculate-Hash') |
|
68 | + (string) $request->getHeader('X-Recalculate-Hash') |
|
69 | 69 | ); |
70 | 70 | |
71 | 71 | $hash = $node->hash($type); |
72 | 72 | if ($hash) { |
73 | - $checksum = strtoupper($type) . ':' . $hash; |
|
73 | + $checksum = strtoupper($type).':'.$hash; |
|
74 | 74 | $node->setChecksum($checksum); |
75 | 75 | $response->addHeader('OC-Checksum', $checksum); |
76 | 76 | $response->setHeader('Content-Length', '0'); |
@@ -48,184 +48,184 @@ |
||
48 | 48 | use Symfony\Component\EventDispatcher\EventDispatcherInterface; |
49 | 49 | |
50 | 50 | class ServerFactory { |
51 | - /** @var IConfig */ |
|
52 | - private $config; |
|
53 | - /** @var ILogger */ |
|
54 | - private $logger; |
|
55 | - /** @var IDBConnection */ |
|
56 | - private $databaseConnection; |
|
57 | - /** @var IUserSession */ |
|
58 | - private $userSession; |
|
59 | - /** @var IMountManager */ |
|
60 | - private $mountManager; |
|
61 | - /** @var ITagManager */ |
|
62 | - private $tagManager; |
|
63 | - /** @var IRequest */ |
|
64 | - private $request; |
|
65 | - /** @var IPreview */ |
|
66 | - private $previewManager; |
|
67 | - /** @var EventDispatcherInterface */ |
|
68 | - private $eventDispatcher; |
|
69 | - /** @var IL10N */ |
|
70 | - private $l10n; |
|
51 | + /** @var IConfig */ |
|
52 | + private $config; |
|
53 | + /** @var ILogger */ |
|
54 | + private $logger; |
|
55 | + /** @var IDBConnection */ |
|
56 | + private $databaseConnection; |
|
57 | + /** @var IUserSession */ |
|
58 | + private $userSession; |
|
59 | + /** @var IMountManager */ |
|
60 | + private $mountManager; |
|
61 | + /** @var ITagManager */ |
|
62 | + private $tagManager; |
|
63 | + /** @var IRequest */ |
|
64 | + private $request; |
|
65 | + /** @var IPreview */ |
|
66 | + private $previewManager; |
|
67 | + /** @var EventDispatcherInterface */ |
|
68 | + private $eventDispatcher; |
|
69 | + /** @var IL10N */ |
|
70 | + private $l10n; |
|
71 | 71 | |
72 | - /** |
|
73 | - * @param IConfig $config |
|
74 | - * @param ILogger $logger |
|
75 | - * @param IDBConnection $databaseConnection |
|
76 | - * @param IUserSession $userSession |
|
77 | - * @param IMountManager $mountManager |
|
78 | - * @param ITagManager $tagManager |
|
79 | - * @param IRequest $request |
|
80 | - * @param IPreview $previewManager |
|
81 | - */ |
|
82 | - public function __construct( |
|
83 | - IConfig $config, |
|
84 | - ILogger $logger, |
|
85 | - IDBConnection $databaseConnection, |
|
86 | - IUserSession $userSession, |
|
87 | - IMountManager $mountManager, |
|
88 | - ITagManager $tagManager, |
|
89 | - IRequest $request, |
|
90 | - IPreview $previewManager, |
|
91 | - EventDispatcherInterface $eventDispatcher, |
|
92 | - IL10N $l10n |
|
93 | - ) { |
|
94 | - $this->config = $config; |
|
95 | - $this->logger = $logger; |
|
96 | - $this->databaseConnection = $databaseConnection; |
|
97 | - $this->userSession = $userSession; |
|
98 | - $this->mountManager = $mountManager; |
|
99 | - $this->tagManager = $tagManager; |
|
100 | - $this->request = $request; |
|
101 | - $this->previewManager = $previewManager; |
|
102 | - $this->eventDispatcher = $eventDispatcher; |
|
103 | - $this->l10n = $l10n; |
|
104 | - } |
|
72 | + /** |
|
73 | + * @param IConfig $config |
|
74 | + * @param ILogger $logger |
|
75 | + * @param IDBConnection $databaseConnection |
|
76 | + * @param IUserSession $userSession |
|
77 | + * @param IMountManager $mountManager |
|
78 | + * @param ITagManager $tagManager |
|
79 | + * @param IRequest $request |
|
80 | + * @param IPreview $previewManager |
|
81 | + */ |
|
82 | + public function __construct( |
|
83 | + IConfig $config, |
|
84 | + ILogger $logger, |
|
85 | + IDBConnection $databaseConnection, |
|
86 | + IUserSession $userSession, |
|
87 | + IMountManager $mountManager, |
|
88 | + ITagManager $tagManager, |
|
89 | + IRequest $request, |
|
90 | + IPreview $previewManager, |
|
91 | + EventDispatcherInterface $eventDispatcher, |
|
92 | + IL10N $l10n |
|
93 | + ) { |
|
94 | + $this->config = $config; |
|
95 | + $this->logger = $logger; |
|
96 | + $this->databaseConnection = $databaseConnection; |
|
97 | + $this->userSession = $userSession; |
|
98 | + $this->mountManager = $mountManager; |
|
99 | + $this->tagManager = $tagManager; |
|
100 | + $this->request = $request; |
|
101 | + $this->previewManager = $previewManager; |
|
102 | + $this->eventDispatcher = $eventDispatcher; |
|
103 | + $this->l10n = $l10n; |
|
104 | + } |
|
105 | 105 | |
106 | - /** |
|
107 | - * @param string $baseUri |
|
108 | - * @param string $requestUri |
|
109 | - * @param Plugin $authPlugin |
|
110 | - * @param callable $viewCallBack callback that should return the view for the dav endpoint |
|
111 | - * @return Server |
|
112 | - */ |
|
113 | - public function createServer($baseUri, |
|
114 | - $requestUri, |
|
115 | - Plugin $authPlugin, |
|
116 | - callable $viewCallBack) { |
|
117 | - // Fire up server |
|
118 | - $objectTree = new \OCA\DAV\Connector\Sabre\ObjectTree(); |
|
119 | - $server = new \OCA\DAV\Connector\Sabre\Server($objectTree); |
|
120 | - // Set URL explicitly due to reverse-proxy situations |
|
121 | - $server->httpRequest->setUrl($requestUri); |
|
122 | - $server->setBaseUri($baseUri); |
|
106 | + /** |
|
107 | + * @param string $baseUri |
|
108 | + * @param string $requestUri |
|
109 | + * @param Plugin $authPlugin |
|
110 | + * @param callable $viewCallBack callback that should return the view for the dav endpoint |
|
111 | + * @return Server |
|
112 | + */ |
|
113 | + public function createServer($baseUri, |
|
114 | + $requestUri, |
|
115 | + Plugin $authPlugin, |
|
116 | + callable $viewCallBack) { |
|
117 | + // Fire up server |
|
118 | + $objectTree = new \OCA\DAV\Connector\Sabre\ObjectTree(); |
|
119 | + $server = new \OCA\DAV\Connector\Sabre\Server($objectTree); |
|
120 | + // Set URL explicitly due to reverse-proxy situations |
|
121 | + $server->httpRequest->setUrl($requestUri); |
|
122 | + $server->setBaseUri($baseUri); |
|
123 | 123 | |
124 | - // Load plugins |
|
125 | - $server->addPlugin(new \OCA\DAV\Connector\Sabre\MaintenancePlugin($this->config, $this->l10n)); |
|
126 | - $server->addPlugin(new \OCA\DAV\Connector\Sabre\BlockLegacyClientPlugin($this->config)); |
|
127 | - $server->addPlugin(new \OCA\DAV\Connector\Sabre\AnonymousOptionsPlugin()); |
|
128 | - $server->addPlugin($authPlugin); |
|
129 | - // FIXME: The following line is a workaround for legacy components relying on being able to send a GET to / |
|
130 | - $server->addPlugin(new \OCA\DAV\Connector\Sabre\DummyGetResponsePlugin()); |
|
131 | - $server->addPlugin(new \OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin('webdav', $this->logger)); |
|
132 | - $server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin()); |
|
124 | + // Load plugins |
|
125 | + $server->addPlugin(new \OCA\DAV\Connector\Sabre\MaintenancePlugin($this->config, $this->l10n)); |
|
126 | + $server->addPlugin(new \OCA\DAV\Connector\Sabre\BlockLegacyClientPlugin($this->config)); |
|
127 | + $server->addPlugin(new \OCA\DAV\Connector\Sabre\AnonymousOptionsPlugin()); |
|
128 | + $server->addPlugin($authPlugin); |
|
129 | + // FIXME: The following line is a workaround for legacy components relying on being able to send a GET to / |
|
130 | + $server->addPlugin(new \OCA\DAV\Connector\Sabre\DummyGetResponsePlugin()); |
|
131 | + $server->addPlugin(new \OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin('webdav', $this->logger)); |
|
132 | + $server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin()); |
|
133 | 133 | |
134 | - $server->addPlugin(new RequestIdHeaderPlugin(\OC::$server->get(IRequest::class))); |
|
134 | + $server->addPlugin(new RequestIdHeaderPlugin(\OC::$server->get(IRequest::class))); |
|
135 | 135 | |
136 | - // Some WebDAV clients do require Class 2 WebDAV support (locking), since |
|
137 | - // we do not provide locking we emulate it using a fake locking plugin. |
|
138 | - if ($this->request->isUserAgent([ |
|
139 | - '/WebDAVFS/', |
|
140 | - '/OneNote/', |
|
141 | - '/Microsoft-WebDAV-MiniRedir/', |
|
142 | - ])) { |
|
143 | - $server->addPlugin(new \OCA\DAV\Connector\Sabre\FakeLockerPlugin()); |
|
144 | - } |
|
136 | + // Some WebDAV clients do require Class 2 WebDAV support (locking), since |
|
137 | + // we do not provide locking we emulate it using a fake locking plugin. |
|
138 | + if ($this->request->isUserAgent([ |
|
139 | + '/WebDAVFS/', |
|
140 | + '/OneNote/', |
|
141 | + '/Microsoft-WebDAV-MiniRedir/', |
|
142 | + ])) { |
|
143 | + $server->addPlugin(new \OCA\DAV\Connector\Sabre\FakeLockerPlugin()); |
|
144 | + } |
|
145 | 145 | |
146 | - if (BrowserErrorPagePlugin::isBrowserRequest($this->request)) { |
|
147 | - $server->addPlugin(new BrowserErrorPagePlugin()); |
|
148 | - } |
|
146 | + if (BrowserErrorPagePlugin::isBrowserRequest($this->request)) { |
|
147 | + $server->addPlugin(new BrowserErrorPagePlugin()); |
|
148 | + } |
|
149 | 149 | |
150 | - // wait with registering these until auth is handled and the filesystem is setup |
|
151 | - $server->on('beforeMethod:*', function () use ($server, $objectTree, $viewCallBack) { |
|
152 | - // ensure the skeleton is copied |
|
153 | - $userFolder = \OC::$server->getUserFolder(); |
|
150 | + // wait with registering these until auth is handled and the filesystem is setup |
|
151 | + $server->on('beforeMethod:*', function () use ($server, $objectTree, $viewCallBack) { |
|
152 | + // ensure the skeleton is copied |
|
153 | + $userFolder = \OC::$server->getUserFolder(); |
|
154 | 154 | |
155 | - /** @var \OC\Files\View $view */ |
|
156 | - $view = $viewCallBack($server); |
|
157 | - if ($userFolder instanceof Folder && $userFolder->getPath() === $view->getRoot()) { |
|
158 | - $rootInfo = $userFolder; |
|
159 | - } else { |
|
160 | - $rootInfo = $view->getFileInfo(''); |
|
161 | - } |
|
155 | + /** @var \OC\Files\View $view */ |
|
156 | + $view = $viewCallBack($server); |
|
157 | + if ($userFolder instanceof Folder && $userFolder->getPath() === $view->getRoot()) { |
|
158 | + $rootInfo = $userFolder; |
|
159 | + } else { |
|
160 | + $rootInfo = $view->getFileInfo(''); |
|
161 | + } |
|
162 | 162 | |
163 | - // Create Nextcloud Dir |
|
164 | - if ($rootInfo->getType() === 'dir') { |
|
165 | - $root = new \OCA\DAV\Connector\Sabre\Directory($view, $rootInfo, $objectTree); |
|
166 | - } else { |
|
167 | - $root = new \OCA\DAV\Connector\Sabre\File($view, $rootInfo); |
|
168 | - } |
|
169 | - $objectTree->init($root, $view, $this->mountManager); |
|
163 | + // Create Nextcloud Dir |
|
164 | + if ($rootInfo->getType() === 'dir') { |
|
165 | + $root = new \OCA\DAV\Connector\Sabre\Directory($view, $rootInfo, $objectTree); |
|
166 | + } else { |
|
167 | + $root = new \OCA\DAV\Connector\Sabre\File($view, $rootInfo); |
|
168 | + } |
|
169 | + $objectTree->init($root, $view, $this->mountManager); |
|
170 | 170 | |
171 | - $server->addPlugin( |
|
172 | - new \OCA\DAV\Connector\Sabre\FilesPlugin( |
|
173 | - $objectTree, |
|
174 | - $this->config, |
|
175 | - $this->request, |
|
176 | - $this->previewManager, |
|
177 | - $this->userSession, |
|
178 | - false, |
|
179 | - !$this->config->getSystemValue('debug', false) |
|
180 | - ) |
|
181 | - ); |
|
182 | - $server->addPlugin(new \OCA\DAV\Connector\Sabre\QuotaPlugin($view, true)); |
|
183 | - $server->addPlugin(new \OCA\DAV\Connector\Sabre\ChecksumUpdatePlugin()); |
|
171 | + $server->addPlugin( |
|
172 | + new \OCA\DAV\Connector\Sabre\FilesPlugin( |
|
173 | + $objectTree, |
|
174 | + $this->config, |
|
175 | + $this->request, |
|
176 | + $this->previewManager, |
|
177 | + $this->userSession, |
|
178 | + false, |
|
179 | + !$this->config->getSystemValue('debug', false) |
|
180 | + ) |
|
181 | + ); |
|
182 | + $server->addPlugin(new \OCA\DAV\Connector\Sabre\QuotaPlugin($view, true)); |
|
183 | + $server->addPlugin(new \OCA\DAV\Connector\Sabre\ChecksumUpdatePlugin()); |
|
184 | 184 | |
185 | - if ($this->userSession->isLoggedIn()) { |
|
186 | - $server->addPlugin(new \OCA\DAV\Connector\Sabre\TagsPlugin($objectTree, $this->tagManager)); |
|
187 | - $server->addPlugin(new \OCA\DAV\Connector\Sabre\SharesPlugin( |
|
188 | - $objectTree, |
|
189 | - $this->userSession, |
|
190 | - $userFolder, |
|
191 | - \OC::$server->getShareManager() |
|
192 | - )); |
|
193 | - $server->addPlugin(new \OCA\DAV\Connector\Sabre\CommentPropertiesPlugin(\OC::$server->getCommentsManager(), $this->userSession)); |
|
194 | - $server->addPlugin(new \OCA\DAV\Connector\Sabre\FilesReportPlugin( |
|
195 | - $objectTree, |
|
196 | - $view, |
|
197 | - \OC::$server->getSystemTagManager(), |
|
198 | - \OC::$server->getSystemTagObjectMapper(), |
|
199 | - \OC::$server->getTagManager(), |
|
200 | - $this->userSession, |
|
201 | - \OC::$server->getGroupManager(), |
|
202 | - $userFolder, |
|
203 | - \OC::$server->getAppManager() |
|
204 | - )); |
|
205 | - // custom properties plugin must be the last one |
|
206 | - $server->addPlugin( |
|
207 | - new \Sabre\DAV\PropertyStorage\Plugin( |
|
208 | - new \OCA\DAV\DAV\CustomPropertiesBackend( |
|
209 | - $objectTree, |
|
210 | - $this->databaseConnection, |
|
211 | - $this->userSession->getUser() |
|
212 | - ) |
|
213 | - ) |
|
214 | - ); |
|
215 | - } |
|
216 | - $server->addPlugin(new \OCA\DAV\Connector\Sabre\CopyEtagHeaderPlugin()); |
|
185 | + if ($this->userSession->isLoggedIn()) { |
|
186 | + $server->addPlugin(new \OCA\DAV\Connector\Sabre\TagsPlugin($objectTree, $this->tagManager)); |
|
187 | + $server->addPlugin(new \OCA\DAV\Connector\Sabre\SharesPlugin( |
|
188 | + $objectTree, |
|
189 | + $this->userSession, |
|
190 | + $userFolder, |
|
191 | + \OC::$server->getShareManager() |
|
192 | + )); |
|
193 | + $server->addPlugin(new \OCA\DAV\Connector\Sabre\CommentPropertiesPlugin(\OC::$server->getCommentsManager(), $this->userSession)); |
|
194 | + $server->addPlugin(new \OCA\DAV\Connector\Sabre\FilesReportPlugin( |
|
195 | + $objectTree, |
|
196 | + $view, |
|
197 | + \OC::$server->getSystemTagManager(), |
|
198 | + \OC::$server->getSystemTagObjectMapper(), |
|
199 | + \OC::$server->getTagManager(), |
|
200 | + $this->userSession, |
|
201 | + \OC::$server->getGroupManager(), |
|
202 | + $userFolder, |
|
203 | + \OC::$server->getAppManager() |
|
204 | + )); |
|
205 | + // custom properties plugin must be the last one |
|
206 | + $server->addPlugin( |
|
207 | + new \Sabre\DAV\PropertyStorage\Plugin( |
|
208 | + new \OCA\DAV\DAV\CustomPropertiesBackend( |
|
209 | + $objectTree, |
|
210 | + $this->databaseConnection, |
|
211 | + $this->userSession->getUser() |
|
212 | + ) |
|
213 | + ) |
|
214 | + ); |
|
215 | + } |
|
216 | + $server->addPlugin(new \OCA\DAV\Connector\Sabre\CopyEtagHeaderPlugin()); |
|
217 | 217 | |
218 | - // Load dav plugins from apps |
|
219 | - $event = new SabrePluginEvent($server); |
|
220 | - $this->eventDispatcher->dispatch($event); |
|
221 | - $pluginManager = new PluginManager( |
|
222 | - \OC::$server, |
|
223 | - \OC::$server->getAppManager() |
|
224 | - ); |
|
225 | - foreach ($pluginManager->getAppPlugins() as $appPlugin) { |
|
226 | - $server->addPlugin($appPlugin); |
|
227 | - } |
|
228 | - }, 30); // priority 30: after auth (10) and acl(20), before lock(50) and handling the request |
|
229 | - return $server; |
|
230 | - } |
|
218 | + // Load dav plugins from apps |
|
219 | + $event = new SabrePluginEvent($server); |
|
220 | + $this->eventDispatcher->dispatch($event); |
|
221 | + $pluginManager = new PluginManager( |
|
222 | + \OC::$server, |
|
223 | + \OC::$server->getAppManager() |
|
224 | + ); |
|
225 | + foreach ($pluginManager->getAppPlugins() as $appPlugin) { |
|
226 | + $server->addPlugin($appPlugin); |
|
227 | + } |
|
228 | + }, 30); // priority 30: after auth (10) and acl(20), before lock(50) and handling the request |
|
229 | + return $server; |
|
230 | + } |
|
231 | 231 | } |
@@ -82,289 +82,289 @@ |
||
82 | 82 | use SearchDAV\DAV\SearchPlugin; |
83 | 83 | |
84 | 84 | class Server { |
85 | - private IRequest $request; |
|
86 | - private string $baseUri; |
|
87 | - public Connector\Sabre\Server $server; |
|
88 | - private IProfiler $profiler; |
|
89 | - |
|
90 | - public function __construct(IRequest $request, string $baseUri) { |
|
91 | - $this->profiler = \OC::$server->get(IProfiler::class); |
|
92 | - if ($this->profiler->isEnabled()) { |
|
93 | - /** @var IEventLogger $eventLogger */ |
|
94 | - $eventLogger = \OC::$server->get(IEventLogger::class); |
|
95 | - $eventLogger->start('runtime', 'DAV Runtime'); |
|
96 | - } |
|
97 | - |
|
98 | - $this->request = $request; |
|
99 | - $this->baseUri = $baseUri; |
|
100 | - $logger = \OC::$server->getLogger(); |
|
101 | - $dispatcher = \OC::$server->getEventDispatcher(); |
|
102 | - /** @var IEventDispatcher $newDispatcher */ |
|
103 | - $newDispatcher = \OC::$server->query(IEventDispatcher::class); |
|
104 | - |
|
105 | - $root = new RootCollection(); |
|
106 | - $this->server = new \OCA\DAV\Connector\Sabre\Server(new CachingTree($root)); |
|
107 | - |
|
108 | - // Add maintenance plugin |
|
109 | - $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\MaintenancePlugin(\OC::$server->getConfig(), \OC::$server->getL10N('dav'))); |
|
110 | - |
|
111 | - // Backends |
|
112 | - $authBackend = new Auth( |
|
113 | - \OC::$server->getSession(), |
|
114 | - \OC::$server->getUserSession(), |
|
115 | - \OC::$server->getRequest(), |
|
116 | - \OC::$server->getTwoFactorAuthManager(), |
|
117 | - \OC::$server->getBruteForceThrottler() |
|
118 | - ); |
|
119 | - |
|
120 | - // Set URL explicitly due to reverse-proxy situations |
|
121 | - $this->server->httpRequest->setUrl($this->request->getRequestUri()); |
|
122 | - $this->server->setBaseUri($this->baseUri); |
|
123 | - |
|
124 | - $this->server->addPlugin(new ProfilerPlugin($this->request)); |
|
125 | - $this->server->addPlugin(new BlockLegacyClientPlugin(\OC::$server->getConfig())); |
|
126 | - $this->server->addPlugin(new AnonymousOptionsPlugin()); |
|
127 | - $authPlugin = new Plugin(); |
|
128 | - $authPlugin->addBackend(new PublicAuth()); |
|
129 | - $this->server->addPlugin($authPlugin); |
|
130 | - |
|
131 | - // allow setup of additional auth backends |
|
132 | - $event = new SabrePluginEvent($this->server); |
|
133 | - $dispatcher->dispatch('OCA\DAV\Connector\Sabre::authInit', $event); |
|
134 | - |
|
135 | - $newAuthEvent = new SabrePluginAuthInitEvent($this->server); |
|
136 | - $newDispatcher->dispatchTyped($newAuthEvent); |
|
137 | - |
|
138 | - $bearerAuthBackend = new BearerAuth( |
|
139 | - \OC::$server->getUserSession(), |
|
140 | - \OC::$server->getSession(), |
|
141 | - \OC::$server->getRequest() |
|
142 | - ); |
|
143 | - $authPlugin->addBackend($bearerAuthBackend); |
|
144 | - // because we are throwing exceptions this plugin has to be the last one |
|
145 | - $authPlugin->addBackend($authBackend); |
|
146 | - |
|
147 | - // debugging |
|
148 | - if (\OC::$server->getConfig()->getSystemValue('debug', false)) { |
|
149 | - $this->server->addPlugin(new \Sabre\DAV\Browser\Plugin()); |
|
150 | - } else { |
|
151 | - $this->server->addPlugin(new DummyGetResponsePlugin()); |
|
152 | - } |
|
153 | - |
|
154 | - $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin('webdav', $logger)); |
|
155 | - $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin()); |
|
156 | - $this->server->addPlugin(new \Sabre\DAV\Sync\Plugin()); |
|
157 | - |
|
158 | - // acl |
|
159 | - $acl = new DavAclPlugin(); |
|
160 | - $acl->principalCollectionSet = [ |
|
161 | - 'principals/users', |
|
162 | - 'principals/groups', |
|
163 | - 'principals/calendar-resources', |
|
164 | - 'principals/calendar-rooms', |
|
165 | - ]; |
|
166 | - $this->server->addPlugin($acl); |
|
167 | - |
|
168 | - // calendar plugins |
|
169 | - if ($this->requestIsForSubtree(['calendars', 'public-calendars', 'system-calendars', 'principals'])) { |
|
170 | - $this->server->addPlugin(new \OCA\DAV\CalDAV\Plugin()); |
|
171 | - $this->server->addPlugin(new \OCA\DAV\CalDAV\ICSExportPlugin\ICSExportPlugin(\OC::$server->getConfig(), \OC::$server->getLogger())); |
|
172 | - $this->server->addPlugin(new \OCA\DAV\CalDAV\Schedule\Plugin(\OC::$server->getConfig())); |
|
173 | - if (\OC::$server->getConfig()->getAppValue('dav', 'sendInvitations', 'yes') === 'yes') { |
|
174 | - $this->server->addPlugin(\OC::$server->query(\OCA\DAV\CalDAV\Schedule\IMipPlugin::class)); |
|
175 | - } |
|
176 | - |
|
177 | - $this->server->addPlugin(\OC::$server->get(\OCA\DAV\CalDAV\Trashbin\Plugin::class)); |
|
178 | - $this->server->addPlugin(new \OCA\DAV\CalDAV\WebcalCaching\Plugin($request)); |
|
179 | - $this->server->addPlugin(new \Sabre\CalDAV\Subscriptions\Plugin()); |
|
180 | - |
|
181 | - $this->server->addPlugin(new \Sabre\CalDAV\Notifications\Plugin()); |
|
182 | - $this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest(), \OC::$server->getConfig())); |
|
183 | - $this->server->addPlugin(new \OCA\DAV\CalDAV\Publishing\PublishPlugin( |
|
184 | - \OC::$server->getConfig(), |
|
185 | - \OC::$server->getURLGenerator() |
|
186 | - )); |
|
187 | - } |
|
188 | - |
|
189 | - // addressbook plugins |
|
190 | - if ($this->requestIsForSubtree(['addressbooks', 'principals'])) { |
|
191 | - $this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest(), \OC::$server->getConfig())); |
|
192 | - $this->server->addPlugin(new \OCA\DAV\CardDAV\Plugin()); |
|
193 | - $this->server->addPlugin(new VCFExportPlugin()); |
|
194 | - $this->server->addPlugin(new MultiGetExportPlugin()); |
|
195 | - $this->server->addPlugin(new HasPhotoPlugin()); |
|
196 | - $this->server->addPlugin(new ImageExportPlugin(new PhotoCache( |
|
197 | - \OC::$server->getAppDataDir('dav-photocache'), |
|
198 | - \OC::$server->getLogger()) |
|
199 | - )); |
|
200 | - } |
|
201 | - |
|
202 | - // system tags plugins |
|
203 | - $this->server->addPlugin(new SystemTagPlugin( |
|
204 | - \OC::$server->getSystemTagManager(), |
|
205 | - \OC::$server->getGroupManager(), |
|
206 | - \OC::$server->getUserSession() |
|
207 | - )); |
|
208 | - |
|
209 | - // comments plugin |
|
210 | - $this->server->addPlugin(new CommentsPlugin( |
|
211 | - \OC::$server->getCommentsManager(), |
|
212 | - \OC::$server->getUserSession() |
|
213 | - )); |
|
214 | - |
|
215 | - $this->server->addPlugin(new CopyEtagHeaderPlugin()); |
|
216 | - $this->server->addPlugin(new RequestIdHeaderPlugin(\OC::$server->get(IRequest::class))); |
|
217 | - $this->server->addPlugin(new ChunkingPlugin()); |
|
218 | - |
|
219 | - // allow setup of additional plugins |
|
220 | - $dispatcher->dispatch('OCA\DAV\Connector\Sabre::addPlugin', $event); |
|
221 | - |
|
222 | - // Some WebDAV clients do require Class 2 WebDAV support (locking), since |
|
223 | - // we do not provide locking we emulate it using a fake locking plugin. |
|
224 | - if ($request->isUserAgent([ |
|
225 | - '/WebDAVFS/', |
|
226 | - '/OneNote/', |
|
227 | - '/^Microsoft-WebDAV/',// Microsoft-WebDAV-MiniRedir/6.1.7601 |
|
228 | - ])) { |
|
229 | - $this->server->addPlugin(new FakeLockerPlugin()); |
|
230 | - } |
|
231 | - |
|
232 | - if (BrowserErrorPagePlugin::isBrowserRequest($request)) { |
|
233 | - $this->server->addPlugin(new BrowserErrorPagePlugin()); |
|
234 | - } |
|
235 | - |
|
236 | - $lazySearchBackend = new LazySearchBackend(); |
|
237 | - $this->server->addPlugin(new SearchPlugin($lazySearchBackend)); |
|
238 | - |
|
239 | - // wait with registering these until auth is handled and the filesystem is setup |
|
240 | - $this->server->on('beforeMethod:*', function () use ($root, $lazySearchBackend) { |
|
241 | - // custom properties plugin must be the last one |
|
242 | - $userSession = \OC::$server->getUserSession(); |
|
243 | - $user = $userSession->getUser(); |
|
244 | - if ($user !== null) { |
|
245 | - $view = \OC\Files\Filesystem::getView(); |
|
246 | - $this->server->addPlugin( |
|
247 | - new FilesPlugin( |
|
248 | - $this->server->tree, |
|
249 | - \OC::$server->getConfig(), |
|
250 | - $this->request, |
|
251 | - \OC::$server->getPreviewManager(), |
|
252 | - \OC::$server->getUserSession(), |
|
253 | - false, |
|
254 | - !\OC::$server->getConfig()->getSystemValue('debug', false) |
|
255 | - ) |
|
256 | - ); |
|
257 | - $this->server->addPlugin(new ChecksumUpdatePlugin()); |
|
258 | - |
|
259 | - $this->server->addPlugin( |
|
260 | - new \Sabre\DAV\PropertyStorage\Plugin( |
|
261 | - new CustomPropertiesBackend( |
|
262 | - $this->server->tree, |
|
263 | - \OC::$server->getDatabaseConnection(), |
|
264 | - \OC::$server->getUserSession()->getUser() |
|
265 | - ) |
|
266 | - ) |
|
267 | - ); |
|
268 | - if ($view !== null) { |
|
269 | - $this->server->addPlugin( |
|
270 | - new QuotaPlugin($view)); |
|
271 | - } |
|
272 | - $this->server->addPlugin( |
|
273 | - new TagsPlugin( |
|
274 | - $this->server->tree, \OC::$server->getTagManager() |
|
275 | - ) |
|
276 | - ); |
|
277 | - // TODO: switch to LazyUserFolder |
|
278 | - $userFolder = \OC::$server->getUserFolder(); |
|
279 | - $this->server->addPlugin(new SharesPlugin( |
|
280 | - $this->server->tree, |
|
281 | - $userSession, |
|
282 | - $userFolder, |
|
283 | - \OC::$server->getShareManager() |
|
284 | - )); |
|
285 | - $this->server->addPlugin(new CommentPropertiesPlugin( |
|
286 | - \OC::$server->getCommentsManager(), |
|
287 | - $userSession |
|
288 | - )); |
|
289 | - $this->server->addPlugin(new \OCA\DAV\CalDAV\Search\SearchPlugin()); |
|
290 | - if ($view !== null) { |
|
291 | - $this->server->addPlugin(new FilesReportPlugin( |
|
292 | - $this->server->tree, |
|
293 | - $view, |
|
294 | - \OC::$server->getSystemTagManager(), |
|
295 | - \OC::$server->getSystemTagObjectMapper(), |
|
296 | - \OC::$server->getTagManager(), |
|
297 | - $userSession, |
|
298 | - \OC::$server->getGroupManager(), |
|
299 | - $userFolder, |
|
300 | - \OC::$server->getAppManager() |
|
301 | - )); |
|
302 | - $lazySearchBackend->setBackend(new \OCA\DAV\Files\FileSearchBackend( |
|
303 | - $this->server->tree, |
|
304 | - $user, |
|
305 | - \OC::$server->getRootFolder(), |
|
306 | - \OC::$server->getShareManager(), |
|
307 | - $view |
|
308 | - )); |
|
309 | - $logger = \OC::$server->get(LoggerInterface::class); |
|
310 | - $this->server->addPlugin( |
|
311 | - new BulkUploadPlugin($userFolder, $logger) |
|
312 | - ); |
|
313 | - } |
|
314 | - $this->server->addPlugin(new \OCA\DAV\CalDAV\BirthdayCalendar\EnablePlugin( |
|
315 | - \OC::$server->getConfig(), |
|
316 | - \OC::$server->query(BirthdayService::class) |
|
317 | - )); |
|
318 | - $this->server->addPlugin(new AppleProvisioningPlugin( |
|
319 | - \OC::$server->getUserSession(), |
|
320 | - \OC::$server->getURLGenerator(), |
|
321 | - \OC::$server->getThemingDefaults(), |
|
322 | - \OC::$server->getRequest(), |
|
323 | - \OC::$server->getL10N('dav'), |
|
324 | - function () { |
|
325 | - return UUIDUtil::getUUID(); |
|
326 | - } |
|
327 | - )); |
|
328 | - } |
|
329 | - |
|
330 | - // register plugins from apps |
|
331 | - $pluginManager = new PluginManager( |
|
332 | - \OC::$server, |
|
333 | - \OC::$server->getAppManager() |
|
334 | - ); |
|
335 | - foreach ($pluginManager->getAppPlugins() as $appPlugin) { |
|
336 | - $this->server->addPlugin($appPlugin); |
|
337 | - } |
|
338 | - foreach ($pluginManager->getAppCollections() as $appCollection) { |
|
339 | - $root->addChild($appCollection); |
|
340 | - } |
|
341 | - }); |
|
342 | - |
|
343 | - $this->server->addPlugin( |
|
344 | - new PropfindCompressionPlugin() |
|
345 | - ); |
|
346 | - } |
|
347 | - |
|
348 | - public function exec() { |
|
349 | - /** @var IEventLogger $eventLogger */ |
|
350 | - $eventLogger = \OC::$server->get(IEventLogger::class); |
|
351 | - $eventLogger->start('dav_server_exec', ''); |
|
352 | - $this->server->exec(); |
|
353 | - $eventLogger->end('dav_server_exec'); |
|
354 | - if ($this->profiler->isEnabled()) { |
|
355 | - $eventLogger->end('runtime'); |
|
356 | - $profile = $this->profiler->collect(\OC::$server->get(IRequest::class), new Response()); |
|
357 | - $this->profiler->saveProfile($profile); |
|
358 | - } |
|
359 | - } |
|
360 | - |
|
361 | - private function requestIsForSubtree(array $subTrees): bool { |
|
362 | - foreach ($subTrees as $subTree) { |
|
363 | - $subTree = trim($subTree, ' /'); |
|
364 | - if (strpos($this->server->getRequestUri(), $subTree.'/') === 0) { |
|
365 | - return true; |
|
366 | - } |
|
367 | - } |
|
368 | - return false; |
|
369 | - } |
|
85 | + private IRequest $request; |
|
86 | + private string $baseUri; |
|
87 | + public Connector\Sabre\Server $server; |
|
88 | + private IProfiler $profiler; |
|
89 | + |
|
90 | + public function __construct(IRequest $request, string $baseUri) { |
|
91 | + $this->profiler = \OC::$server->get(IProfiler::class); |
|
92 | + if ($this->profiler->isEnabled()) { |
|
93 | + /** @var IEventLogger $eventLogger */ |
|
94 | + $eventLogger = \OC::$server->get(IEventLogger::class); |
|
95 | + $eventLogger->start('runtime', 'DAV Runtime'); |
|
96 | + } |
|
97 | + |
|
98 | + $this->request = $request; |
|
99 | + $this->baseUri = $baseUri; |
|
100 | + $logger = \OC::$server->getLogger(); |
|
101 | + $dispatcher = \OC::$server->getEventDispatcher(); |
|
102 | + /** @var IEventDispatcher $newDispatcher */ |
|
103 | + $newDispatcher = \OC::$server->query(IEventDispatcher::class); |
|
104 | + |
|
105 | + $root = new RootCollection(); |
|
106 | + $this->server = new \OCA\DAV\Connector\Sabre\Server(new CachingTree($root)); |
|
107 | + |
|
108 | + // Add maintenance plugin |
|
109 | + $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\MaintenancePlugin(\OC::$server->getConfig(), \OC::$server->getL10N('dav'))); |
|
110 | + |
|
111 | + // Backends |
|
112 | + $authBackend = new Auth( |
|
113 | + \OC::$server->getSession(), |
|
114 | + \OC::$server->getUserSession(), |
|
115 | + \OC::$server->getRequest(), |
|
116 | + \OC::$server->getTwoFactorAuthManager(), |
|
117 | + \OC::$server->getBruteForceThrottler() |
|
118 | + ); |
|
119 | + |
|
120 | + // Set URL explicitly due to reverse-proxy situations |
|
121 | + $this->server->httpRequest->setUrl($this->request->getRequestUri()); |
|
122 | + $this->server->setBaseUri($this->baseUri); |
|
123 | + |
|
124 | + $this->server->addPlugin(new ProfilerPlugin($this->request)); |
|
125 | + $this->server->addPlugin(new BlockLegacyClientPlugin(\OC::$server->getConfig())); |
|
126 | + $this->server->addPlugin(new AnonymousOptionsPlugin()); |
|
127 | + $authPlugin = new Plugin(); |
|
128 | + $authPlugin->addBackend(new PublicAuth()); |
|
129 | + $this->server->addPlugin($authPlugin); |
|
130 | + |
|
131 | + // allow setup of additional auth backends |
|
132 | + $event = new SabrePluginEvent($this->server); |
|
133 | + $dispatcher->dispatch('OCA\DAV\Connector\Sabre::authInit', $event); |
|
134 | + |
|
135 | + $newAuthEvent = new SabrePluginAuthInitEvent($this->server); |
|
136 | + $newDispatcher->dispatchTyped($newAuthEvent); |
|
137 | + |
|
138 | + $bearerAuthBackend = new BearerAuth( |
|
139 | + \OC::$server->getUserSession(), |
|
140 | + \OC::$server->getSession(), |
|
141 | + \OC::$server->getRequest() |
|
142 | + ); |
|
143 | + $authPlugin->addBackend($bearerAuthBackend); |
|
144 | + // because we are throwing exceptions this plugin has to be the last one |
|
145 | + $authPlugin->addBackend($authBackend); |
|
146 | + |
|
147 | + // debugging |
|
148 | + if (\OC::$server->getConfig()->getSystemValue('debug', false)) { |
|
149 | + $this->server->addPlugin(new \Sabre\DAV\Browser\Plugin()); |
|
150 | + } else { |
|
151 | + $this->server->addPlugin(new DummyGetResponsePlugin()); |
|
152 | + } |
|
153 | + |
|
154 | + $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin('webdav', $logger)); |
|
155 | + $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin()); |
|
156 | + $this->server->addPlugin(new \Sabre\DAV\Sync\Plugin()); |
|
157 | + |
|
158 | + // acl |
|
159 | + $acl = new DavAclPlugin(); |
|
160 | + $acl->principalCollectionSet = [ |
|
161 | + 'principals/users', |
|
162 | + 'principals/groups', |
|
163 | + 'principals/calendar-resources', |
|
164 | + 'principals/calendar-rooms', |
|
165 | + ]; |
|
166 | + $this->server->addPlugin($acl); |
|
167 | + |
|
168 | + // calendar plugins |
|
169 | + if ($this->requestIsForSubtree(['calendars', 'public-calendars', 'system-calendars', 'principals'])) { |
|
170 | + $this->server->addPlugin(new \OCA\DAV\CalDAV\Plugin()); |
|
171 | + $this->server->addPlugin(new \OCA\DAV\CalDAV\ICSExportPlugin\ICSExportPlugin(\OC::$server->getConfig(), \OC::$server->getLogger())); |
|
172 | + $this->server->addPlugin(new \OCA\DAV\CalDAV\Schedule\Plugin(\OC::$server->getConfig())); |
|
173 | + if (\OC::$server->getConfig()->getAppValue('dav', 'sendInvitations', 'yes') === 'yes') { |
|
174 | + $this->server->addPlugin(\OC::$server->query(\OCA\DAV\CalDAV\Schedule\IMipPlugin::class)); |
|
175 | + } |
|
176 | + |
|
177 | + $this->server->addPlugin(\OC::$server->get(\OCA\DAV\CalDAV\Trashbin\Plugin::class)); |
|
178 | + $this->server->addPlugin(new \OCA\DAV\CalDAV\WebcalCaching\Plugin($request)); |
|
179 | + $this->server->addPlugin(new \Sabre\CalDAV\Subscriptions\Plugin()); |
|
180 | + |
|
181 | + $this->server->addPlugin(new \Sabre\CalDAV\Notifications\Plugin()); |
|
182 | + $this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest(), \OC::$server->getConfig())); |
|
183 | + $this->server->addPlugin(new \OCA\DAV\CalDAV\Publishing\PublishPlugin( |
|
184 | + \OC::$server->getConfig(), |
|
185 | + \OC::$server->getURLGenerator() |
|
186 | + )); |
|
187 | + } |
|
188 | + |
|
189 | + // addressbook plugins |
|
190 | + if ($this->requestIsForSubtree(['addressbooks', 'principals'])) { |
|
191 | + $this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest(), \OC::$server->getConfig())); |
|
192 | + $this->server->addPlugin(new \OCA\DAV\CardDAV\Plugin()); |
|
193 | + $this->server->addPlugin(new VCFExportPlugin()); |
|
194 | + $this->server->addPlugin(new MultiGetExportPlugin()); |
|
195 | + $this->server->addPlugin(new HasPhotoPlugin()); |
|
196 | + $this->server->addPlugin(new ImageExportPlugin(new PhotoCache( |
|
197 | + \OC::$server->getAppDataDir('dav-photocache'), |
|
198 | + \OC::$server->getLogger()) |
|
199 | + )); |
|
200 | + } |
|
201 | + |
|
202 | + // system tags plugins |
|
203 | + $this->server->addPlugin(new SystemTagPlugin( |
|
204 | + \OC::$server->getSystemTagManager(), |
|
205 | + \OC::$server->getGroupManager(), |
|
206 | + \OC::$server->getUserSession() |
|
207 | + )); |
|
208 | + |
|
209 | + // comments plugin |
|
210 | + $this->server->addPlugin(new CommentsPlugin( |
|
211 | + \OC::$server->getCommentsManager(), |
|
212 | + \OC::$server->getUserSession() |
|
213 | + )); |
|
214 | + |
|
215 | + $this->server->addPlugin(new CopyEtagHeaderPlugin()); |
|
216 | + $this->server->addPlugin(new RequestIdHeaderPlugin(\OC::$server->get(IRequest::class))); |
|
217 | + $this->server->addPlugin(new ChunkingPlugin()); |
|
218 | + |
|
219 | + // allow setup of additional plugins |
|
220 | + $dispatcher->dispatch('OCA\DAV\Connector\Sabre::addPlugin', $event); |
|
221 | + |
|
222 | + // Some WebDAV clients do require Class 2 WebDAV support (locking), since |
|
223 | + // we do not provide locking we emulate it using a fake locking plugin. |
|
224 | + if ($request->isUserAgent([ |
|
225 | + '/WebDAVFS/', |
|
226 | + '/OneNote/', |
|
227 | + '/^Microsoft-WebDAV/',// Microsoft-WebDAV-MiniRedir/6.1.7601 |
|
228 | + ])) { |
|
229 | + $this->server->addPlugin(new FakeLockerPlugin()); |
|
230 | + } |
|
231 | + |
|
232 | + if (BrowserErrorPagePlugin::isBrowserRequest($request)) { |
|
233 | + $this->server->addPlugin(new BrowserErrorPagePlugin()); |
|
234 | + } |
|
235 | + |
|
236 | + $lazySearchBackend = new LazySearchBackend(); |
|
237 | + $this->server->addPlugin(new SearchPlugin($lazySearchBackend)); |
|
238 | + |
|
239 | + // wait with registering these until auth is handled and the filesystem is setup |
|
240 | + $this->server->on('beforeMethod:*', function () use ($root, $lazySearchBackend) { |
|
241 | + // custom properties plugin must be the last one |
|
242 | + $userSession = \OC::$server->getUserSession(); |
|
243 | + $user = $userSession->getUser(); |
|
244 | + if ($user !== null) { |
|
245 | + $view = \OC\Files\Filesystem::getView(); |
|
246 | + $this->server->addPlugin( |
|
247 | + new FilesPlugin( |
|
248 | + $this->server->tree, |
|
249 | + \OC::$server->getConfig(), |
|
250 | + $this->request, |
|
251 | + \OC::$server->getPreviewManager(), |
|
252 | + \OC::$server->getUserSession(), |
|
253 | + false, |
|
254 | + !\OC::$server->getConfig()->getSystemValue('debug', false) |
|
255 | + ) |
|
256 | + ); |
|
257 | + $this->server->addPlugin(new ChecksumUpdatePlugin()); |
|
258 | + |
|
259 | + $this->server->addPlugin( |
|
260 | + new \Sabre\DAV\PropertyStorage\Plugin( |
|
261 | + new CustomPropertiesBackend( |
|
262 | + $this->server->tree, |
|
263 | + \OC::$server->getDatabaseConnection(), |
|
264 | + \OC::$server->getUserSession()->getUser() |
|
265 | + ) |
|
266 | + ) |
|
267 | + ); |
|
268 | + if ($view !== null) { |
|
269 | + $this->server->addPlugin( |
|
270 | + new QuotaPlugin($view)); |
|
271 | + } |
|
272 | + $this->server->addPlugin( |
|
273 | + new TagsPlugin( |
|
274 | + $this->server->tree, \OC::$server->getTagManager() |
|
275 | + ) |
|
276 | + ); |
|
277 | + // TODO: switch to LazyUserFolder |
|
278 | + $userFolder = \OC::$server->getUserFolder(); |
|
279 | + $this->server->addPlugin(new SharesPlugin( |
|
280 | + $this->server->tree, |
|
281 | + $userSession, |
|
282 | + $userFolder, |
|
283 | + \OC::$server->getShareManager() |
|
284 | + )); |
|
285 | + $this->server->addPlugin(new CommentPropertiesPlugin( |
|
286 | + \OC::$server->getCommentsManager(), |
|
287 | + $userSession |
|
288 | + )); |
|
289 | + $this->server->addPlugin(new \OCA\DAV\CalDAV\Search\SearchPlugin()); |
|
290 | + if ($view !== null) { |
|
291 | + $this->server->addPlugin(new FilesReportPlugin( |
|
292 | + $this->server->tree, |
|
293 | + $view, |
|
294 | + \OC::$server->getSystemTagManager(), |
|
295 | + \OC::$server->getSystemTagObjectMapper(), |
|
296 | + \OC::$server->getTagManager(), |
|
297 | + $userSession, |
|
298 | + \OC::$server->getGroupManager(), |
|
299 | + $userFolder, |
|
300 | + \OC::$server->getAppManager() |
|
301 | + )); |
|
302 | + $lazySearchBackend->setBackend(new \OCA\DAV\Files\FileSearchBackend( |
|
303 | + $this->server->tree, |
|
304 | + $user, |
|
305 | + \OC::$server->getRootFolder(), |
|
306 | + \OC::$server->getShareManager(), |
|
307 | + $view |
|
308 | + )); |
|
309 | + $logger = \OC::$server->get(LoggerInterface::class); |
|
310 | + $this->server->addPlugin( |
|
311 | + new BulkUploadPlugin($userFolder, $logger) |
|
312 | + ); |
|
313 | + } |
|
314 | + $this->server->addPlugin(new \OCA\DAV\CalDAV\BirthdayCalendar\EnablePlugin( |
|
315 | + \OC::$server->getConfig(), |
|
316 | + \OC::$server->query(BirthdayService::class) |
|
317 | + )); |
|
318 | + $this->server->addPlugin(new AppleProvisioningPlugin( |
|
319 | + \OC::$server->getUserSession(), |
|
320 | + \OC::$server->getURLGenerator(), |
|
321 | + \OC::$server->getThemingDefaults(), |
|
322 | + \OC::$server->getRequest(), |
|
323 | + \OC::$server->getL10N('dav'), |
|
324 | + function () { |
|
325 | + return UUIDUtil::getUUID(); |
|
326 | + } |
|
327 | + )); |
|
328 | + } |
|
329 | + |
|
330 | + // register plugins from apps |
|
331 | + $pluginManager = new PluginManager( |
|
332 | + \OC::$server, |
|
333 | + \OC::$server->getAppManager() |
|
334 | + ); |
|
335 | + foreach ($pluginManager->getAppPlugins() as $appPlugin) { |
|
336 | + $this->server->addPlugin($appPlugin); |
|
337 | + } |
|
338 | + foreach ($pluginManager->getAppCollections() as $appCollection) { |
|
339 | + $root->addChild($appCollection); |
|
340 | + } |
|
341 | + }); |
|
342 | + |
|
343 | + $this->server->addPlugin( |
|
344 | + new PropfindCompressionPlugin() |
|
345 | + ); |
|
346 | + } |
|
347 | + |
|
348 | + public function exec() { |
|
349 | + /** @var IEventLogger $eventLogger */ |
|
350 | + $eventLogger = \OC::$server->get(IEventLogger::class); |
|
351 | + $eventLogger->start('dav_server_exec', ''); |
|
352 | + $this->server->exec(); |
|
353 | + $eventLogger->end('dav_server_exec'); |
|
354 | + if ($this->profiler->isEnabled()) { |
|
355 | + $eventLogger->end('runtime'); |
|
356 | + $profile = $this->profiler->collect(\OC::$server->get(IRequest::class), new Response()); |
|
357 | + $this->profiler->saveProfile($profile); |
|
358 | + } |
|
359 | + } |
|
360 | + |
|
361 | + private function requestIsForSubtree(array $subTrees): bool { |
|
362 | + foreach ($subTrees as $subTree) { |
|
363 | + $subTree = trim($subTree, ' /'); |
|
364 | + if (strpos($this->server->getRequestUri(), $subTree.'/') === 0) { |
|
365 | + return true; |
|
366 | + } |
|
367 | + } |
|
368 | + return false; |
|
369 | + } |
|
370 | 370 | } |
@@ -6,324 +6,324 @@ |
||
6 | 6 | |
7 | 7 | class ComposerStaticInitDAV |
8 | 8 | { |
9 | - public static $prefixLengthsPsr4 = array ( |
|
9 | + public static $prefixLengthsPsr4 = array( |
|
10 | 10 | 'O' => |
11 | - array ( |
|
11 | + array( |
|
12 | 12 | 'OCA\\DAV\\' => 8, |
13 | 13 | ), |
14 | 14 | ); |
15 | 15 | |
16 | - public static $prefixDirsPsr4 = array ( |
|
16 | + public static $prefixDirsPsr4 = array( |
|
17 | 17 | 'OCA\\DAV\\' => |
18 | - array ( |
|
19 | - 0 => __DIR__ . '/..' . '/../lib', |
|
18 | + array( |
|
19 | + 0 => __DIR__.'/..'.'/../lib', |
|
20 | 20 | ), |
21 | 21 | ); |
22 | 22 | |
23 | - public static $classMap = array ( |
|
24 | - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', |
|
25 | - 'OCA\\DAV\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', |
|
26 | - 'OCA\\DAV\\AppInfo\\PluginManager' => __DIR__ . '/..' . '/../lib/AppInfo/PluginManager.php', |
|
27 | - 'OCA\\DAV\\Avatars\\AvatarHome' => __DIR__ . '/..' . '/../lib/Avatars/AvatarHome.php', |
|
28 | - 'OCA\\DAV\\Avatars\\AvatarNode' => __DIR__ . '/..' . '/../lib/Avatars/AvatarNode.php', |
|
29 | - 'OCA\\DAV\\Avatars\\RootCollection' => __DIR__ . '/..' . '/../lib/Avatars/RootCollection.php', |
|
30 | - 'OCA\\DAV\\BackgroundJob\\BuildReminderIndexBackgroundJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/BuildReminderIndexBackgroundJob.php', |
|
31 | - 'OCA\\DAV\\BackgroundJob\\CalendarRetentionJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/CalendarRetentionJob.php', |
|
32 | - 'OCA\\DAV\\BackgroundJob\\CleanupDirectLinksJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/CleanupDirectLinksJob.php', |
|
33 | - 'OCA\\DAV\\BackgroundJob\\CleanupInvitationTokenJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/CleanupInvitationTokenJob.php', |
|
34 | - 'OCA\\DAV\\BackgroundJob\\EventReminderJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/EventReminderJob.php', |
|
35 | - 'OCA\\DAV\\BackgroundJob\\GenerateBirthdayCalendarBackgroundJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/GenerateBirthdayCalendarBackgroundJob.php', |
|
36 | - 'OCA\\DAV\\BackgroundJob\\RefreshWebcalJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/RefreshWebcalJob.php', |
|
37 | - 'OCA\\DAV\\BackgroundJob\\RegisterRegenerateBirthdayCalendars' => __DIR__ . '/..' . '/../lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php', |
|
38 | - 'OCA\\DAV\\BackgroundJob\\UpdateCalendarResourcesRoomsBackgroundJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php', |
|
39 | - 'OCA\\DAV\\BackgroundJob\\UploadCleanup' => __DIR__ . '/..' . '/../lib/BackgroundJob/UploadCleanup.php', |
|
40 | - 'OCA\\DAV\\BulkUpload\\BulkUploadPlugin' => __DIR__ . '/..' . '/../lib/BulkUpload/BulkUploadPlugin.php', |
|
41 | - 'OCA\\DAV\\BulkUpload\\MultipartRequestParser' => __DIR__ . '/..' . '/../lib/BulkUpload/MultipartRequestParser.php', |
|
42 | - 'OCA\\DAV\\CalDAV\\Activity\\Backend' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Backend.php', |
|
43 | - 'OCA\\DAV\\CalDAV\\Activity\\Filter\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Filter/Calendar.php', |
|
44 | - 'OCA\\DAV\\CalDAV\\Activity\\Filter\\Todo' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Filter/Todo.php', |
|
45 | - 'OCA\\DAV\\CalDAV\\Activity\\Provider\\Base' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Base.php', |
|
46 | - 'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Calendar.php', |
|
47 | - 'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Event.php', |
|
48 | - 'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Todo.php', |
|
49 | - 'OCA\\DAV\\CalDAV\\Activity\\Setting\\CalDAVSetting' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/CalDAVSetting.php', |
|
50 | - 'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Calendar.php', |
|
51 | - 'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Event.php', |
|
52 | - 'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Todo.php', |
|
53 | - 'OCA\\DAV\\CalDAV\\Auth\\CustomPrincipalPlugin' => __DIR__ . '/..' . '/../lib/CalDAV/Auth/CustomPrincipalPlugin.php', |
|
54 | - 'OCA\\DAV\\CalDAV\\Auth\\PublicPrincipalPlugin' => __DIR__ . '/..' . '/../lib/CalDAV/Auth/PublicPrincipalPlugin.php', |
|
55 | - 'OCA\\DAV\\CalDAV\\BirthdayCalendar\\EnablePlugin' => __DIR__ . '/..' . '/../lib/CalDAV/BirthdayCalendar/EnablePlugin.php', |
|
56 | - 'OCA\\DAV\\CalDAV\\BirthdayService' => __DIR__ . '/..' . '/../lib/CalDAV/BirthdayService.php', |
|
57 | - 'OCA\\DAV\\CalDAV\\CachedSubscription' => __DIR__ . '/..' . '/../lib/CalDAV/CachedSubscription.php', |
|
58 | - 'OCA\\DAV\\CalDAV\\CachedSubscriptionObject' => __DIR__ . '/..' . '/../lib/CalDAV/CachedSubscriptionObject.php', |
|
59 | - 'OCA\\DAV\\CalDAV\\CalDavBackend' => __DIR__ . '/..' . '/../lib/CalDAV/CalDavBackend.php', |
|
60 | - 'OCA\\DAV\\CalDAV\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Calendar.php', |
|
61 | - 'OCA\\DAV\\CalDAV\\CalendarHome' => __DIR__ . '/..' . '/../lib/CalDAV/CalendarHome.php', |
|
62 | - 'OCA\\DAV\\CalDAV\\CalendarImpl' => __DIR__ . '/..' . '/../lib/CalDAV/CalendarImpl.php', |
|
63 | - 'OCA\\DAV\\CalDAV\\CalendarManager' => __DIR__ . '/..' . '/../lib/CalDAV/CalendarManager.php', |
|
64 | - 'OCA\\DAV\\CalDAV\\CalendarObject' => __DIR__ . '/..' . '/../lib/CalDAV/CalendarObject.php', |
|
65 | - 'OCA\\DAV\\CalDAV\\CalendarProvider' => __DIR__ . '/..' . '/../lib/CalDAV/CalendarProvider.php', |
|
66 | - 'OCA\\DAV\\CalDAV\\CalendarRoot' => __DIR__ . '/..' . '/../lib/CalDAV/CalendarRoot.php', |
|
67 | - 'OCA\\DAV\\CalDAV\\ICSExportPlugin\\ICSExportPlugin' => __DIR__ . '/..' . '/../lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php', |
|
68 | - 'OCA\\DAV\\CalDAV\\IRestorable' => __DIR__ . '/..' . '/../lib/CalDAV/IRestorable.php', |
|
69 | - 'OCA\\DAV\\CalDAV\\Integration\\ExternalCalendar' => __DIR__ . '/..' . '/../lib/CalDAV/Integration/ExternalCalendar.php', |
|
70 | - 'OCA\\DAV\\CalDAV\\Integration\\ICalendarProvider' => __DIR__ . '/..' . '/../lib/CalDAV/Integration/ICalendarProvider.php', |
|
71 | - 'OCA\\DAV\\CalDAV\\InvitationResponse\\InvitationResponseServer' => __DIR__ . '/..' . '/../lib/CalDAV/InvitationResponse/InvitationResponseServer.php', |
|
72 | - 'OCA\\DAV\\CalDAV\\Outbox' => __DIR__ . '/..' . '/../lib/CalDAV/Outbox.php', |
|
73 | - 'OCA\\DAV\\CalDAV\\Plugin' => __DIR__ . '/..' . '/../lib/CalDAV/Plugin.php', |
|
74 | - 'OCA\\DAV\\CalDAV\\Principal\\Collection' => __DIR__ . '/..' . '/../lib/CalDAV/Principal/Collection.php', |
|
75 | - 'OCA\\DAV\\CalDAV\\Principal\\User' => __DIR__ . '/..' . '/../lib/CalDAV/Principal/User.php', |
|
76 | - 'OCA\\DAV\\CalDAV\\Proxy\\Proxy' => __DIR__ . '/..' . '/../lib/CalDAV/Proxy/Proxy.php', |
|
77 | - 'OCA\\DAV\\CalDAV\\Proxy\\ProxyMapper' => __DIR__ . '/..' . '/../lib/CalDAV/Proxy/ProxyMapper.php', |
|
78 | - 'OCA\\DAV\\CalDAV\\PublicCalendar' => __DIR__ . '/..' . '/../lib/CalDAV/PublicCalendar.php', |
|
79 | - 'OCA\\DAV\\CalDAV\\PublicCalendarObject' => __DIR__ . '/..' . '/../lib/CalDAV/PublicCalendarObject.php', |
|
80 | - 'OCA\\DAV\\CalDAV\\PublicCalendarRoot' => __DIR__ . '/..' . '/../lib/CalDAV/PublicCalendarRoot.php', |
|
81 | - 'OCA\\DAV\\CalDAV\\Publishing\\PublishPlugin' => __DIR__ . '/..' . '/../lib/CalDAV/Publishing/PublishPlugin.php', |
|
82 | - 'OCA\\DAV\\CalDAV\\Publishing\\Xml\\Publisher' => __DIR__ . '/..' . '/../lib/CalDAV/Publishing/Xml/Publisher.php', |
|
83 | - 'OCA\\DAV\\CalDAV\\Reminder\\Backend' => __DIR__ . '/..' . '/../lib/CalDAV/Reminder/Backend.php', |
|
84 | - 'OCA\\DAV\\CalDAV\\Reminder\\INotificationProvider' => __DIR__ . '/..' . '/../lib/CalDAV/Reminder/INotificationProvider.php', |
|
85 | - 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProviderManager' => __DIR__ . '/..' . '/../lib/CalDAV/Reminder/NotificationProviderManager.php', |
|
86 | - 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\AbstractProvider' => __DIR__ . '/..' . '/../lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php', |
|
87 | - 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\AudioProvider' => __DIR__ . '/..' . '/../lib/CalDAV/Reminder/NotificationProvider/AudioProvider.php', |
|
88 | - 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\EmailProvider' => __DIR__ . '/..' . '/../lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php', |
|
89 | - 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\ProviderNotAvailableException' => __DIR__ . '/..' . '/../lib/CalDAV/Reminder/NotificationProvider/ProviderNotAvailableException.php', |
|
90 | - 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\PushProvider' => __DIR__ . '/..' . '/../lib/CalDAV/Reminder/NotificationProvider/PushProvider.php', |
|
91 | - 'OCA\\DAV\\CalDAV\\Reminder\\NotificationTypeDoesNotExistException' => __DIR__ . '/..' . '/../lib/CalDAV/Reminder/NotificationTypeDoesNotExistException.php', |
|
92 | - 'OCA\\DAV\\CalDAV\\Reminder\\Notifier' => __DIR__ . '/..' . '/../lib/CalDAV/Reminder/Notifier.php', |
|
93 | - 'OCA\\DAV\\CalDAV\\Reminder\\ReminderService' => __DIR__ . '/..' . '/../lib/CalDAV/Reminder/ReminderService.php', |
|
94 | - 'OCA\\DAV\\CalDAV\\ResourceBooking\\AbstractPrincipalBackend' => __DIR__ . '/..' . '/../lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php', |
|
95 | - 'OCA\\DAV\\CalDAV\\ResourceBooking\\ResourcePrincipalBackend' => __DIR__ . '/..' . '/../lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php', |
|
96 | - 'OCA\\DAV\\CalDAV\\ResourceBooking\\RoomPrincipalBackend' => __DIR__ . '/..' . '/../lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php', |
|
97 | - 'OCA\\DAV\\CalDAV\\RetentionService' => __DIR__ . '/..' . '/../lib/CalDAV/RetentionService.php', |
|
98 | - 'OCA\\DAV\\CalDAV\\Schedule\\IMipPlugin' => __DIR__ . '/..' . '/../lib/CalDAV/Schedule/IMipPlugin.php', |
|
99 | - 'OCA\\DAV\\CalDAV\\Schedule\\Plugin' => __DIR__ . '/..' . '/../lib/CalDAV/Schedule/Plugin.php', |
|
100 | - 'OCA\\DAV\\CalDAV\\Search\\SearchPlugin' => __DIR__ . '/..' . '/../lib/CalDAV/Search/SearchPlugin.php', |
|
101 | - 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\CompFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/CompFilter.php', |
|
102 | - 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\LimitFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/LimitFilter.php', |
|
103 | - 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\OffsetFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/OffsetFilter.php', |
|
104 | - 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\ParamFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/ParamFilter.php', |
|
105 | - 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\PropFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/PropFilter.php', |
|
106 | - 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\SearchTermFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php', |
|
107 | - 'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php', |
|
108 | - 'OCA\\DAV\\CalDAV\\Trashbin\\DeletedCalendarObject' => __DIR__ . '/..' . '/../lib/CalDAV/Trashbin/DeletedCalendarObject.php', |
|
109 | - 'OCA\\DAV\\CalDAV\\Trashbin\\DeletedCalendarObjectsCollection' => __DIR__ . '/..' . '/../lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php', |
|
110 | - 'OCA\\DAV\\CalDAV\\Trashbin\\Plugin' => __DIR__ . '/..' . '/../lib/CalDAV/Trashbin/Plugin.php', |
|
111 | - 'OCA\\DAV\\CalDAV\\Trashbin\\RestoreTarget' => __DIR__ . '/..' . '/../lib/CalDAV/Trashbin/RestoreTarget.php', |
|
112 | - 'OCA\\DAV\\CalDAV\\Trashbin\\TrashbinHome' => __DIR__ . '/..' . '/../lib/CalDAV/Trashbin/TrashbinHome.php', |
|
113 | - 'OCA\\DAV\\CalDAV\\WebcalCaching\\Plugin' => __DIR__ . '/..' . '/../lib/CalDAV/WebcalCaching/Plugin.php', |
|
114 | - 'OCA\\DAV\\CalDAV\\WebcalCaching\\RefreshWebcalService' => __DIR__ . '/..' . '/../lib/CalDAV/WebcalCaching/RefreshWebcalService.php', |
|
115 | - 'OCA\\DAV\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php', |
|
116 | - 'OCA\\DAV\\CardDAV\\Activity\\Backend' => __DIR__ . '/..' . '/../lib/CardDAV/Activity/Backend.php', |
|
117 | - 'OCA\\DAV\\CardDAV\\Activity\\Filter' => __DIR__ . '/..' . '/../lib/CardDAV/Activity/Filter.php', |
|
118 | - 'OCA\\DAV\\CardDAV\\Activity\\Provider\\Addressbook' => __DIR__ . '/..' . '/../lib/CardDAV/Activity/Provider/Addressbook.php', |
|
119 | - 'OCA\\DAV\\CardDAV\\Activity\\Provider\\Base' => __DIR__ . '/..' . '/../lib/CardDAV/Activity/Provider/Base.php', |
|
120 | - 'OCA\\DAV\\CardDAV\\Activity\\Provider\\Card' => __DIR__ . '/..' . '/../lib/CardDAV/Activity/Provider/Card.php', |
|
121 | - 'OCA\\DAV\\CardDAV\\Activity\\Setting' => __DIR__ . '/..' . '/../lib/CardDAV/Activity/Setting.php', |
|
122 | - 'OCA\\DAV\\CardDAV\\AddressBook' => __DIR__ . '/..' . '/../lib/CardDAV/AddressBook.php', |
|
123 | - 'OCA\\DAV\\CardDAV\\AddressBookImpl' => __DIR__ . '/..' . '/../lib/CardDAV/AddressBookImpl.php', |
|
124 | - 'OCA\\DAV\\CardDAV\\AddressBookRoot' => __DIR__ . '/..' . '/../lib/CardDAV/AddressBookRoot.php', |
|
125 | - 'OCA\\DAV\\CardDAV\\CardDavBackend' => __DIR__ . '/..' . '/../lib/CardDAV/CardDavBackend.php', |
|
126 | - 'OCA\\DAV\\CardDAV\\ContactsManager' => __DIR__ . '/..' . '/../lib/CardDAV/ContactsManager.php', |
|
127 | - 'OCA\\DAV\\CardDAV\\Converter' => __DIR__ . '/..' . '/../lib/CardDAV/Converter.php', |
|
128 | - 'OCA\\DAV\\CardDAV\\HasPhotoPlugin' => __DIR__ . '/..' . '/../lib/CardDAV/HasPhotoPlugin.php', |
|
129 | - 'OCA\\DAV\\CardDAV\\ImageExportPlugin' => __DIR__ . '/..' . '/../lib/CardDAV/ImageExportPlugin.php', |
|
130 | - 'OCA\\DAV\\CardDAV\\Integration\\ExternalAddressBook' => __DIR__ . '/..' . '/../lib/CardDAV/Integration/ExternalAddressBook.php', |
|
131 | - 'OCA\\DAV\\CardDAV\\Integration\\IAddressBookProvider' => __DIR__ . '/..' . '/../lib/CardDAV/Integration/IAddressBookProvider.php', |
|
132 | - 'OCA\\DAV\\CardDAV\\MultiGetExportPlugin' => __DIR__ . '/..' . '/../lib/CardDAV/MultiGetExportPlugin.php', |
|
133 | - 'OCA\\DAV\\CardDAV\\PhotoCache' => __DIR__ . '/..' . '/../lib/CardDAV/PhotoCache.php', |
|
134 | - 'OCA\\DAV\\CardDAV\\Plugin' => __DIR__ . '/..' . '/../lib/CardDAV/Plugin.php', |
|
135 | - 'OCA\\DAV\\CardDAV\\SyncService' => __DIR__ . '/..' . '/../lib/CardDAV/SyncService.php', |
|
136 | - 'OCA\\DAV\\CardDAV\\SystemAddressbook' => __DIR__ . '/..' . '/../lib/CardDAV/SystemAddressbook.php', |
|
137 | - 'OCA\\DAV\\CardDAV\\UserAddressBooks' => __DIR__ . '/..' . '/../lib/CardDAV/UserAddressBooks.php', |
|
138 | - 'OCA\\DAV\\CardDAV\\Xml\\Groups' => __DIR__ . '/..' . '/../lib/CardDAV/Xml/Groups.php', |
|
139 | - 'OCA\\DAV\\Command\\CreateAddressBook' => __DIR__ . '/..' . '/../lib/Command/CreateAddressBook.php', |
|
140 | - 'OCA\\DAV\\Command\\CreateCalendar' => __DIR__ . '/..' . '/../lib/Command/CreateCalendar.php', |
|
141 | - 'OCA\\DAV\\Command\\DeleteCalendar' => __DIR__ . '/..' . '/../lib/Command/DeleteCalendar.php', |
|
142 | - 'OCA\\DAV\\Command\\ListCalendars' => __DIR__ . '/..' . '/../lib/Command/ListCalendars.php', |
|
143 | - 'OCA\\DAV\\Command\\MoveCalendar' => __DIR__ . '/..' . '/../lib/Command/MoveCalendar.php', |
|
144 | - 'OCA\\DAV\\Command\\RemoveInvalidShares' => __DIR__ . '/..' . '/../lib/Command/RemoveInvalidShares.php', |
|
145 | - 'OCA\\DAV\\Command\\RetentionCleanupCommand' => __DIR__ . '/..' . '/../lib/Command/RetentionCleanupCommand.php', |
|
146 | - 'OCA\\DAV\\Command\\SendEventReminders' => __DIR__ . '/..' . '/../lib/Command/SendEventReminders.php', |
|
147 | - 'OCA\\DAV\\Command\\SyncBirthdayCalendar' => __DIR__ . '/..' . '/../lib/Command/SyncBirthdayCalendar.php', |
|
148 | - 'OCA\\DAV\\Command\\SyncSystemAddressBook' => __DIR__ . '/..' . '/../lib/Command/SyncSystemAddressBook.php', |
|
149 | - 'OCA\\DAV\\Comments\\CommentNode' => __DIR__ . '/..' . '/../lib/Comments/CommentNode.php', |
|
150 | - 'OCA\\DAV\\Comments\\CommentsPlugin' => __DIR__ . '/..' . '/../lib/Comments/CommentsPlugin.php', |
|
151 | - 'OCA\\DAV\\Comments\\EntityCollection' => __DIR__ . '/..' . '/../lib/Comments/EntityCollection.php', |
|
152 | - 'OCA\\DAV\\Comments\\EntityTypeCollection' => __DIR__ . '/..' . '/../lib/Comments/EntityTypeCollection.php', |
|
153 | - 'OCA\\DAV\\Comments\\RootCollection' => __DIR__ . '/..' . '/../lib/Comments/RootCollection.php', |
|
154 | - 'OCA\\DAV\\Connector\\LegacyDAVACL' => __DIR__ . '/..' . '/../lib/Connector/LegacyDAVACL.php', |
|
155 | - 'OCA\\DAV\\Connector\\PublicAuth' => __DIR__ . '/..' . '/../lib/Connector/PublicAuth.php', |
|
156 | - 'OCA\\DAV\\Connector\\Sabre\\AnonymousOptionsPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/AnonymousOptionsPlugin.php', |
|
157 | - 'OCA\\DAV\\Connector\\Sabre\\AppEnabledPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/AppEnabledPlugin.php', |
|
158 | - 'OCA\\DAV\\Connector\\Sabre\\Auth' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Auth.php', |
|
159 | - 'OCA\\DAV\\Connector\\Sabre\\BearerAuth' => __DIR__ . '/..' . '/../lib/Connector/Sabre/BearerAuth.php', |
|
160 | - 'OCA\\DAV\\Connector\\Sabre\\BlockLegacyClientPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/BlockLegacyClientPlugin.php', |
|
161 | - 'OCA\\DAV\\Connector\\Sabre\\CachingTree' => __DIR__ . '/..' . '/../lib/Connector/Sabre/CachingTree.php', |
|
162 | - 'OCA\\DAV\\Connector\\Sabre\\ChecksumList' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ChecksumList.php', |
|
163 | - 'OCA\\DAV\\Connector\\Sabre\\ChecksumUpdatePlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ChecksumUpdatePlugin.php', |
|
164 | - 'OCA\\DAV\\Connector\\Sabre\\CommentPropertiesPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/CommentPropertiesPlugin.php', |
|
165 | - 'OCA\\DAV\\Connector\\Sabre\\CopyEtagHeaderPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/CopyEtagHeaderPlugin.php', |
|
166 | - 'OCA\\DAV\\Connector\\Sabre\\DavAclPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/DavAclPlugin.php', |
|
167 | - 'OCA\\DAV\\Connector\\Sabre\\Directory' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Directory.php', |
|
168 | - 'OCA\\DAV\\Connector\\Sabre\\DummyGetResponsePlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/DummyGetResponsePlugin.php', |
|
169 | - 'OCA\\DAV\\Connector\\Sabre\\ExceptionLoggerPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ExceptionLoggerPlugin.php', |
|
170 | - 'OCA\\DAV\\Connector\\Sabre\\Exception\\BadGateway' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/BadGateway.php', |
|
171 | - 'OCA\\DAV\\Connector\\Sabre\\Exception\\EntityTooLarge' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/EntityTooLarge.php', |
|
172 | - 'OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/FileLocked.php', |
|
173 | - 'OCA\\DAV\\Connector\\Sabre\\Exception\\Forbidden' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/Forbidden.php', |
|
174 | - 'OCA\\DAV\\Connector\\Sabre\\Exception\\InvalidPath' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/InvalidPath.php', |
|
175 | - 'OCA\\DAV\\Connector\\Sabre\\Exception\\PasswordLoginForbidden' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/PasswordLoginForbidden.php', |
|
176 | - 'OCA\\DAV\\Connector\\Sabre\\Exception\\UnsupportedMediaType' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/UnsupportedMediaType.php', |
|
177 | - 'OCA\\DAV\\Connector\\Sabre\\FakeLockerPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/FakeLockerPlugin.php', |
|
178 | - 'OCA\\DAV\\Connector\\Sabre\\File' => __DIR__ . '/..' . '/../lib/Connector/Sabre/File.php', |
|
179 | - 'OCA\\DAV\\Connector\\Sabre\\FilesPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/FilesPlugin.php', |
|
180 | - 'OCA\\DAV\\Connector\\Sabre\\FilesReportPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/FilesReportPlugin.php', |
|
181 | - 'OCA\\DAV\\Connector\\Sabre\\LockPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/LockPlugin.php', |
|
182 | - 'OCA\\DAV\\Connector\\Sabre\\MaintenancePlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/MaintenancePlugin.php', |
|
183 | - 'OCA\\DAV\\Connector\\Sabre\\MtimeSanitizer' => __DIR__ . '/..' . '/../lib/Connector/Sabre/MtimeSanitizer.php', |
|
184 | - 'OCA\\DAV\\Connector\\Sabre\\Node' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Node.php', |
|
185 | - 'OCA\\DAV\\Connector\\Sabre\\ObjectTree' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ObjectTree.php', |
|
186 | - 'OCA\\DAV\\Connector\\Sabre\\Principal' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Principal.php', |
|
187 | - 'OCA\\DAV\\Connector\\Sabre\\PropfindCompressionPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/PropfindCompressionPlugin.php', |
|
188 | - 'OCA\\DAV\\Connector\\Sabre\\QuotaPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/QuotaPlugin.php', |
|
189 | - 'OCA\\DAV\\Connector\\Sabre\\RequestIdHeaderPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/RequestIdHeaderPlugin.php', |
|
190 | - 'OCA\\DAV\\Connector\\Sabre\\Server' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Server.php', |
|
191 | - 'OCA\\DAV\\Connector\\Sabre\\ServerFactory' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ServerFactory.php', |
|
192 | - 'OCA\\DAV\\Connector\\Sabre\\ShareTypeList' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ShareTypeList.php', |
|
193 | - 'OCA\\DAV\\Connector\\Sabre\\ShareeList' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ShareeList.php', |
|
194 | - 'OCA\\DAV\\Connector\\Sabre\\SharesPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/SharesPlugin.php', |
|
195 | - 'OCA\\DAV\\Connector\\Sabre\\TagList' => __DIR__ . '/..' . '/../lib/Connector/Sabre/TagList.php', |
|
196 | - 'OCA\\DAV\\Connector\\Sabre\\TagsPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/TagsPlugin.php', |
|
197 | - 'OCA\\DAV\\Controller\\BirthdayCalendarController' => __DIR__ . '/..' . '/../lib/Controller/BirthdayCalendarController.php', |
|
198 | - 'OCA\\DAV\\Controller\\DirectController' => __DIR__ . '/..' . '/../lib/Controller/DirectController.php', |
|
199 | - 'OCA\\DAV\\Controller\\InvitationResponseController' => __DIR__ . '/..' . '/../lib/Controller/InvitationResponseController.php', |
|
200 | - 'OCA\\DAV\\DAV\\CustomPropertiesBackend' => __DIR__ . '/..' . '/../lib/DAV/CustomPropertiesBackend.php', |
|
201 | - 'OCA\\DAV\\DAV\\GroupPrincipalBackend' => __DIR__ . '/..' . '/../lib/DAV/GroupPrincipalBackend.php', |
|
202 | - 'OCA\\DAV\\DAV\\PublicAuth' => __DIR__ . '/..' . '/../lib/DAV/PublicAuth.php', |
|
203 | - 'OCA\\DAV\\DAV\\Sharing\\Backend' => __DIR__ . '/..' . '/../lib/DAV/Sharing/Backend.php', |
|
204 | - 'OCA\\DAV\\DAV\\Sharing\\IShareable' => __DIR__ . '/..' . '/../lib/DAV/Sharing/IShareable.php', |
|
205 | - 'OCA\\DAV\\DAV\\Sharing\\Plugin' => __DIR__ . '/..' . '/../lib/DAV/Sharing/Plugin.php', |
|
206 | - 'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite' => __DIR__ . '/..' . '/../lib/DAV/Sharing/Xml/Invite.php', |
|
207 | - 'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest' => __DIR__ . '/..' . '/../lib/DAV/Sharing/Xml/ShareRequest.php', |
|
208 | - 'OCA\\DAV\\DAV\\SystemPrincipalBackend' => __DIR__ . '/..' . '/../lib/DAV/SystemPrincipalBackend.php', |
|
209 | - 'OCA\\DAV\\Db\\Direct' => __DIR__ . '/..' . '/../lib/Db/Direct.php', |
|
210 | - 'OCA\\DAV\\Db\\DirectMapper' => __DIR__ . '/..' . '/../lib/Db/DirectMapper.php', |
|
211 | - 'OCA\\DAV\\Direct\\DirectFile' => __DIR__ . '/..' . '/../lib/Direct/DirectFile.php', |
|
212 | - 'OCA\\DAV\\Direct\\DirectHome' => __DIR__ . '/..' . '/../lib/Direct/DirectHome.php', |
|
213 | - 'OCA\\DAV\\Direct\\Server' => __DIR__ . '/..' . '/../lib/Direct/Server.php', |
|
214 | - 'OCA\\DAV\\Direct\\ServerFactory' => __DIR__ . '/..' . '/../lib/Direct/ServerFactory.php', |
|
215 | - 'OCA\\DAV\\Events\\AddressBookCreatedEvent' => __DIR__ . '/..' . '/../lib/Events/AddressBookCreatedEvent.php', |
|
216 | - 'OCA\\DAV\\Events\\AddressBookDeletedEvent' => __DIR__ . '/..' . '/../lib/Events/AddressBookDeletedEvent.php', |
|
217 | - 'OCA\\DAV\\Events\\AddressBookShareUpdatedEvent' => __DIR__ . '/..' . '/../lib/Events/AddressBookShareUpdatedEvent.php', |
|
218 | - 'OCA\\DAV\\Events\\AddressBookUpdatedEvent' => __DIR__ . '/..' . '/../lib/Events/AddressBookUpdatedEvent.php', |
|
219 | - 'OCA\\DAV\\Events\\BeforeFileDirectDownloadedEvent' => __DIR__ . '/..' . '/../lib/Events/BeforeFileDirectDownloadedEvent.php', |
|
220 | - 'OCA\\DAV\\Events\\CachedCalendarObjectCreatedEvent' => __DIR__ . '/..' . '/../lib/Events/CachedCalendarObjectCreatedEvent.php', |
|
221 | - 'OCA\\DAV\\Events\\CachedCalendarObjectDeletedEvent' => __DIR__ . '/..' . '/../lib/Events/CachedCalendarObjectDeletedEvent.php', |
|
222 | - 'OCA\\DAV\\Events\\CachedCalendarObjectUpdatedEvent' => __DIR__ . '/..' . '/../lib/Events/CachedCalendarObjectUpdatedEvent.php', |
|
223 | - 'OCA\\DAV\\Events\\CalendarCreatedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarCreatedEvent.php', |
|
224 | - 'OCA\\DAV\\Events\\CalendarDeletedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarDeletedEvent.php', |
|
225 | - 'OCA\\DAV\\Events\\CalendarMovedToTrashEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarMovedToTrashEvent.php', |
|
226 | - 'OCA\\DAV\\Events\\CalendarObjectCreatedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarObjectCreatedEvent.php', |
|
227 | - 'OCA\\DAV\\Events\\CalendarObjectDeletedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarObjectDeletedEvent.php', |
|
228 | - 'OCA\\DAV\\Events\\CalendarObjectMovedToTrashEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarObjectMovedToTrashEvent.php', |
|
229 | - 'OCA\\DAV\\Events\\CalendarObjectRestoredEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarObjectRestoredEvent.php', |
|
230 | - 'OCA\\DAV\\Events\\CalendarObjectUpdatedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarObjectUpdatedEvent.php', |
|
231 | - 'OCA\\DAV\\Events\\CalendarPublishedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarPublishedEvent.php', |
|
232 | - 'OCA\\DAV\\Events\\CalendarRestoredEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarRestoredEvent.php', |
|
233 | - 'OCA\\DAV\\Events\\CalendarShareUpdatedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarShareUpdatedEvent.php', |
|
234 | - 'OCA\\DAV\\Events\\CalendarUnpublishedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarUnpublishedEvent.php', |
|
235 | - 'OCA\\DAV\\Events\\CalendarUpdatedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarUpdatedEvent.php', |
|
236 | - 'OCA\\DAV\\Events\\CardCreatedEvent' => __DIR__ . '/..' . '/../lib/Events/CardCreatedEvent.php', |
|
237 | - 'OCA\\DAV\\Events\\CardDeletedEvent' => __DIR__ . '/..' . '/../lib/Events/CardDeletedEvent.php', |
|
238 | - 'OCA\\DAV\\Events\\CardUpdatedEvent' => __DIR__ . '/..' . '/../lib/Events/CardUpdatedEvent.php', |
|
239 | - 'OCA\\DAV\\Events\\SabrePluginAuthInitEvent' => __DIR__ . '/..' . '/../lib/Events/SabrePluginAuthInitEvent.php', |
|
240 | - 'OCA\\DAV\\Events\\SubscriptionCreatedEvent' => __DIR__ . '/..' . '/../lib/Events/SubscriptionCreatedEvent.php', |
|
241 | - 'OCA\\DAV\\Events\\SubscriptionDeletedEvent' => __DIR__ . '/..' . '/../lib/Events/SubscriptionDeletedEvent.php', |
|
242 | - 'OCA\\DAV\\Events\\SubscriptionUpdatedEvent' => __DIR__ . '/..' . '/../lib/Events/SubscriptionUpdatedEvent.php', |
|
243 | - 'OCA\\DAV\\Exception\\UnsupportedLimitOnInitialSyncException' => __DIR__ . '/..' . '/../lib/Exception/UnsupportedLimitOnInitialSyncException.php', |
|
244 | - 'OCA\\DAV\\Files\\BrowserErrorPagePlugin' => __DIR__ . '/..' . '/../lib/Files/BrowserErrorPagePlugin.php', |
|
245 | - 'OCA\\DAV\\Files\\FileSearchBackend' => __DIR__ . '/..' . '/../lib/Files/FileSearchBackend.php', |
|
246 | - 'OCA\\DAV\\Files\\FilesHome' => __DIR__ . '/..' . '/../lib/Files/FilesHome.php', |
|
247 | - 'OCA\\DAV\\Files\\LazySearchBackend' => __DIR__ . '/..' . '/../lib/Files/LazySearchBackend.php', |
|
248 | - 'OCA\\DAV\\Files\\RootCollection' => __DIR__ . '/..' . '/../lib/Files/RootCollection.php', |
|
249 | - 'OCA\\DAV\\Files\\Sharing\\FilesDropPlugin' => __DIR__ . '/..' . '/../lib/Files/Sharing/FilesDropPlugin.php', |
|
250 | - 'OCA\\DAV\\Files\\Sharing\\PublicLinkCheckPlugin' => __DIR__ . '/..' . '/../lib/Files/Sharing/PublicLinkCheckPlugin.php', |
|
251 | - 'OCA\\DAV\\HookManager' => __DIR__ . '/..' . '/../lib/HookManager.php', |
|
252 | - 'OCA\\DAV\\Listener\\ActivityUpdaterListener' => __DIR__ . '/..' . '/../lib/Listener/ActivityUpdaterListener.php', |
|
253 | - 'OCA\\DAV\\Listener\\AddressbookListener' => __DIR__ . '/..' . '/../lib/Listener/AddressbookListener.php', |
|
254 | - 'OCA\\DAV\\Listener\\CalendarContactInteractionListener' => __DIR__ . '/..' . '/../lib/Listener/CalendarContactInteractionListener.php', |
|
255 | - 'OCA\\DAV\\Listener\\CalendarDeletionDefaultUpdaterListener' => __DIR__ . '/..' . '/../lib/Listener/CalendarDeletionDefaultUpdaterListener.php', |
|
256 | - 'OCA\\DAV\\Listener\\CalendarObjectReminderUpdaterListener' => __DIR__ . '/..' . '/../lib/Listener/CalendarObjectReminderUpdaterListener.php', |
|
257 | - 'OCA\\DAV\\Listener\\CardListener' => __DIR__ . '/..' . '/../lib/Listener/CardListener.php', |
|
258 | - 'OCA\\DAV\\Migration\\BuildCalendarSearchIndex' => __DIR__ . '/..' . '/../lib/Migration/BuildCalendarSearchIndex.php', |
|
259 | - 'OCA\\DAV\\Migration\\BuildCalendarSearchIndexBackgroundJob' => __DIR__ . '/..' . '/../lib/Migration/BuildCalendarSearchIndexBackgroundJob.php', |
|
260 | - 'OCA\\DAV\\Migration\\BuildSocialSearchIndex' => __DIR__ . '/..' . '/../lib/Migration/BuildSocialSearchIndex.php', |
|
261 | - 'OCA\\DAV\\Migration\\BuildSocialSearchIndexBackgroundJob' => __DIR__ . '/..' . '/../lib/Migration/BuildSocialSearchIndexBackgroundJob.php', |
|
262 | - 'OCA\\DAV\\Migration\\CalDAVRemoveEmptyValue' => __DIR__ . '/..' . '/../lib/Migration/CalDAVRemoveEmptyValue.php', |
|
263 | - 'OCA\\DAV\\Migration\\ChunkCleanup' => __DIR__ . '/..' . '/../lib/Migration/ChunkCleanup.php', |
|
264 | - 'OCA\\DAV\\Migration\\FixBirthdayCalendarComponent' => __DIR__ . '/..' . '/../lib/Migration/FixBirthdayCalendarComponent.php', |
|
265 | - 'OCA\\DAV\\Migration\\RefreshWebcalJobRegistrar' => __DIR__ . '/..' . '/../lib/Migration/RefreshWebcalJobRegistrar.php', |
|
266 | - 'OCA\\DAV\\Migration\\RegenerateBirthdayCalendars' => __DIR__ . '/..' . '/../lib/Migration/RegenerateBirthdayCalendars.php', |
|
267 | - 'OCA\\DAV\\Migration\\RegisterBuildReminderIndexBackgroundJob' => __DIR__ . '/..' . '/../lib/Migration/RegisterBuildReminderIndexBackgroundJob.php', |
|
268 | - 'OCA\\DAV\\Migration\\RemoveClassifiedEventActivity' => __DIR__ . '/..' . '/../lib/Migration/RemoveClassifiedEventActivity.php', |
|
269 | - 'OCA\\DAV\\Migration\\RemoveDeletedUsersCalendarSubscriptions' => __DIR__ . '/..' . '/../lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php', |
|
270 | - 'OCA\\DAV\\Migration\\RemoveOrphanEventsAndContacts' => __DIR__ . '/..' . '/../lib/Migration/RemoveOrphanEventsAndContacts.php', |
|
271 | - 'OCA\\DAV\\Migration\\Version1004Date20170825134824' => __DIR__ . '/..' . '/../lib/Migration/Version1004Date20170825134824.php', |
|
272 | - 'OCA\\DAV\\Migration\\Version1004Date20170919104507' => __DIR__ . '/..' . '/../lib/Migration/Version1004Date20170919104507.php', |
|
273 | - 'OCA\\DAV\\Migration\\Version1004Date20170924124212' => __DIR__ . '/..' . '/../lib/Migration/Version1004Date20170924124212.php', |
|
274 | - 'OCA\\DAV\\Migration\\Version1004Date20170926103422' => __DIR__ . '/..' . '/../lib/Migration/Version1004Date20170926103422.php', |
|
275 | - 'OCA\\DAV\\Migration\\Version1005Date20180413093149' => __DIR__ . '/..' . '/../lib/Migration/Version1005Date20180413093149.php', |
|
276 | - 'OCA\\DAV\\Migration\\Version1005Date20180530124431' => __DIR__ . '/..' . '/../lib/Migration/Version1005Date20180530124431.php', |
|
277 | - 'OCA\\DAV\\Migration\\Version1006Date20180619154313' => __DIR__ . '/..' . '/../lib/Migration/Version1006Date20180619154313.php', |
|
278 | - 'OCA\\DAV\\Migration\\Version1006Date20180628111625' => __DIR__ . '/..' . '/../lib/Migration/Version1006Date20180628111625.php', |
|
279 | - 'OCA\\DAV\\Migration\\Version1008Date20181030113700' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181030113700.php', |
|
280 | - 'OCA\\DAV\\Migration\\Version1008Date20181105104826' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181105104826.php', |
|
281 | - 'OCA\\DAV\\Migration\\Version1008Date20181105104833' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181105104833.php', |
|
282 | - 'OCA\\DAV\\Migration\\Version1008Date20181105110300' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181105110300.php', |
|
283 | - 'OCA\\DAV\\Migration\\Version1008Date20181105112049' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181105112049.php', |
|
284 | - 'OCA\\DAV\\Migration\\Version1008Date20181114084440' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181114084440.php', |
|
285 | - 'OCA\\DAV\\Migration\\Version1011Date20190725113607' => __DIR__ . '/..' . '/../lib/Migration/Version1011Date20190725113607.php', |
|
286 | - 'OCA\\DAV\\Migration\\Version1011Date20190806104428' => __DIR__ . '/..' . '/../lib/Migration/Version1011Date20190806104428.php', |
|
287 | - 'OCA\\DAV\\Migration\\Version1012Date20190808122342' => __DIR__ . '/..' . '/../lib/Migration/Version1012Date20190808122342.php', |
|
288 | - 'OCA\\DAV\\Migration\\Version1016Date20201109085907' => __DIR__ . '/..' . '/../lib/Migration/Version1016Date20201109085907.php', |
|
289 | - 'OCA\\DAV\\Migration\\Version1017Date20210216083742' => __DIR__ . '/..' . '/../lib/Migration/Version1017Date20210216083742.php', |
|
290 | - 'OCA\\DAV\\Migration\\Version1018Date20210312100735' => __DIR__ . '/..' . '/../lib/Migration/Version1018Date20210312100735.php', |
|
291 | - 'OCA\\DAV\\Profiler\\ProfilerPlugin' => __DIR__ . '/..' . '/../lib/Profiler/ProfilerPlugin.php', |
|
292 | - 'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningNode' => __DIR__ . '/..' . '/../lib/Provisioning/Apple/AppleProvisioningNode.php', |
|
293 | - 'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningPlugin' => __DIR__ . '/..' . '/../lib/Provisioning/Apple/AppleProvisioningPlugin.php', |
|
294 | - 'OCA\\DAV\\RootCollection' => __DIR__ . '/..' . '/../lib/RootCollection.php', |
|
295 | - 'OCA\\DAV\\Search\\ACalendarSearchProvider' => __DIR__ . '/..' . '/../lib/Search/ACalendarSearchProvider.php', |
|
296 | - 'OCA\\DAV\\Search\\ContactsSearchProvider' => __DIR__ . '/..' . '/../lib/Search/ContactsSearchProvider.php', |
|
297 | - 'OCA\\DAV\\Search\\EventsSearchProvider' => __DIR__ . '/..' . '/../lib/Search/EventsSearchProvider.php', |
|
298 | - 'OCA\\DAV\\Search\\TasksSearchProvider' => __DIR__ . '/..' . '/../lib/Search/TasksSearchProvider.php', |
|
299 | - 'OCA\\DAV\\Server' => __DIR__ . '/..' . '/../lib/Server.php', |
|
300 | - 'OCA\\DAV\\Settings\\AvailabilitySettings' => __DIR__ . '/..' . '/../lib/Settings/AvailabilitySettings.php', |
|
301 | - 'OCA\\DAV\\Settings\\CalDAVSettings' => __DIR__ . '/..' . '/../lib/Settings/CalDAVSettings.php', |
|
302 | - 'OCA\\DAV\\Storage\\PublicOwnerWrapper' => __DIR__ . '/..' . '/../lib/Storage/PublicOwnerWrapper.php', |
|
303 | - 'OCA\\DAV\\SystemTag\\SystemTagMappingNode' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagMappingNode.php', |
|
304 | - 'OCA\\DAV\\SystemTag\\SystemTagNode' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagNode.php', |
|
305 | - 'OCA\\DAV\\SystemTag\\SystemTagPlugin' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagPlugin.php', |
|
306 | - 'OCA\\DAV\\SystemTag\\SystemTagsByIdCollection' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagsByIdCollection.php', |
|
307 | - 'OCA\\DAV\\SystemTag\\SystemTagsObjectMappingCollection' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagsObjectMappingCollection.php', |
|
308 | - 'OCA\\DAV\\SystemTag\\SystemTagsObjectTypeCollection' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagsObjectTypeCollection.php', |
|
309 | - 'OCA\\DAV\\SystemTag\\SystemTagsRelationsCollection' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagsRelationsCollection.php', |
|
310 | - 'OCA\\DAV\\Traits\\PrincipalProxyTrait' => __DIR__ . '/..' . '/../lib/Traits/PrincipalProxyTrait.php', |
|
311 | - 'OCA\\DAV\\Upload\\AssemblyStream' => __DIR__ . '/..' . '/../lib/Upload/AssemblyStream.php', |
|
312 | - 'OCA\\DAV\\Upload\\ChunkingPlugin' => __DIR__ . '/..' . '/../lib/Upload/ChunkingPlugin.php', |
|
313 | - 'OCA\\DAV\\Upload\\CleanupService' => __DIR__ . '/..' . '/../lib/Upload/CleanupService.php', |
|
314 | - 'OCA\\DAV\\Upload\\FutureFile' => __DIR__ . '/..' . '/../lib/Upload/FutureFile.php', |
|
315 | - 'OCA\\DAV\\Upload\\RootCollection' => __DIR__ . '/..' . '/../lib/Upload/RootCollection.php', |
|
316 | - 'OCA\\DAV\\Upload\\UploadFile' => __DIR__ . '/..' . '/../lib/Upload/UploadFile.php', |
|
317 | - 'OCA\\DAV\\Upload\\UploadFolder' => __DIR__ . '/..' . '/../lib/Upload/UploadFolder.php', |
|
318 | - 'OCA\\DAV\\Upload\\UploadHome' => __DIR__ . '/..' . '/../lib/Upload/UploadHome.php', |
|
319 | - 'OCA\\DAV\\UserMigration\\CalendarMigrator' => __DIR__ . '/..' . '/../lib/UserMigration/CalendarMigrator.php', |
|
320 | - 'OCA\\DAV\\UserMigration\\CalendarMigratorException' => __DIR__ . '/..' . '/../lib/UserMigration/CalendarMigratorException.php', |
|
321 | - 'OCA\\DAV\\UserMigration\\InvalidCalendarException' => __DIR__ . '/..' . '/../lib/UserMigration/InvalidCalendarException.php', |
|
23 | + public static $classMap = array( |
|
24 | + 'Composer\\InstalledVersions' => __DIR__.'/..'.'/composer/InstalledVersions.php', |
|
25 | + 'OCA\\DAV\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php', |
|
26 | + 'OCA\\DAV\\AppInfo\\PluginManager' => __DIR__.'/..'.'/../lib/AppInfo/PluginManager.php', |
|
27 | + 'OCA\\DAV\\Avatars\\AvatarHome' => __DIR__.'/..'.'/../lib/Avatars/AvatarHome.php', |
|
28 | + 'OCA\\DAV\\Avatars\\AvatarNode' => __DIR__.'/..'.'/../lib/Avatars/AvatarNode.php', |
|
29 | + 'OCA\\DAV\\Avatars\\RootCollection' => __DIR__.'/..'.'/../lib/Avatars/RootCollection.php', |
|
30 | + 'OCA\\DAV\\BackgroundJob\\BuildReminderIndexBackgroundJob' => __DIR__.'/..'.'/../lib/BackgroundJob/BuildReminderIndexBackgroundJob.php', |
|
31 | + 'OCA\\DAV\\BackgroundJob\\CalendarRetentionJob' => __DIR__.'/..'.'/../lib/BackgroundJob/CalendarRetentionJob.php', |
|
32 | + 'OCA\\DAV\\BackgroundJob\\CleanupDirectLinksJob' => __DIR__.'/..'.'/../lib/BackgroundJob/CleanupDirectLinksJob.php', |
|
33 | + 'OCA\\DAV\\BackgroundJob\\CleanupInvitationTokenJob' => __DIR__.'/..'.'/../lib/BackgroundJob/CleanupInvitationTokenJob.php', |
|
34 | + 'OCA\\DAV\\BackgroundJob\\EventReminderJob' => __DIR__.'/..'.'/../lib/BackgroundJob/EventReminderJob.php', |
|
35 | + 'OCA\\DAV\\BackgroundJob\\GenerateBirthdayCalendarBackgroundJob' => __DIR__.'/..'.'/../lib/BackgroundJob/GenerateBirthdayCalendarBackgroundJob.php', |
|
36 | + 'OCA\\DAV\\BackgroundJob\\RefreshWebcalJob' => __DIR__.'/..'.'/../lib/BackgroundJob/RefreshWebcalJob.php', |
|
37 | + 'OCA\\DAV\\BackgroundJob\\RegisterRegenerateBirthdayCalendars' => __DIR__.'/..'.'/../lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php', |
|
38 | + 'OCA\\DAV\\BackgroundJob\\UpdateCalendarResourcesRoomsBackgroundJob' => __DIR__.'/..'.'/../lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php', |
|
39 | + 'OCA\\DAV\\BackgroundJob\\UploadCleanup' => __DIR__.'/..'.'/../lib/BackgroundJob/UploadCleanup.php', |
|
40 | + 'OCA\\DAV\\BulkUpload\\BulkUploadPlugin' => __DIR__.'/..'.'/../lib/BulkUpload/BulkUploadPlugin.php', |
|
41 | + 'OCA\\DAV\\BulkUpload\\MultipartRequestParser' => __DIR__.'/..'.'/../lib/BulkUpload/MultipartRequestParser.php', |
|
42 | + 'OCA\\DAV\\CalDAV\\Activity\\Backend' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Backend.php', |
|
43 | + 'OCA\\DAV\\CalDAV\\Activity\\Filter\\Calendar' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Filter/Calendar.php', |
|
44 | + 'OCA\\DAV\\CalDAV\\Activity\\Filter\\Todo' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Filter/Todo.php', |
|
45 | + 'OCA\\DAV\\CalDAV\\Activity\\Provider\\Base' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Provider/Base.php', |
|
46 | + 'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Provider/Calendar.php', |
|
47 | + 'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Provider/Event.php', |
|
48 | + 'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Provider/Todo.php', |
|
49 | + 'OCA\\DAV\\CalDAV\\Activity\\Setting\\CalDAVSetting' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Setting/CalDAVSetting.php', |
|
50 | + 'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Setting/Calendar.php', |
|
51 | + 'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Setting/Event.php', |
|
52 | + 'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Setting/Todo.php', |
|
53 | + 'OCA\\DAV\\CalDAV\\Auth\\CustomPrincipalPlugin' => __DIR__.'/..'.'/../lib/CalDAV/Auth/CustomPrincipalPlugin.php', |
|
54 | + 'OCA\\DAV\\CalDAV\\Auth\\PublicPrincipalPlugin' => __DIR__.'/..'.'/../lib/CalDAV/Auth/PublicPrincipalPlugin.php', |
|
55 | + 'OCA\\DAV\\CalDAV\\BirthdayCalendar\\EnablePlugin' => __DIR__.'/..'.'/../lib/CalDAV/BirthdayCalendar/EnablePlugin.php', |
|
56 | + 'OCA\\DAV\\CalDAV\\BirthdayService' => __DIR__.'/..'.'/../lib/CalDAV/BirthdayService.php', |
|
57 | + 'OCA\\DAV\\CalDAV\\CachedSubscription' => __DIR__.'/..'.'/../lib/CalDAV/CachedSubscription.php', |
|
58 | + 'OCA\\DAV\\CalDAV\\CachedSubscriptionObject' => __DIR__.'/..'.'/../lib/CalDAV/CachedSubscriptionObject.php', |
|
59 | + 'OCA\\DAV\\CalDAV\\CalDavBackend' => __DIR__.'/..'.'/../lib/CalDAV/CalDavBackend.php', |
|
60 | + 'OCA\\DAV\\CalDAV\\Calendar' => __DIR__.'/..'.'/../lib/CalDAV/Calendar.php', |
|
61 | + 'OCA\\DAV\\CalDAV\\CalendarHome' => __DIR__.'/..'.'/../lib/CalDAV/CalendarHome.php', |
|
62 | + 'OCA\\DAV\\CalDAV\\CalendarImpl' => __DIR__.'/..'.'/../lib/CalDAV/CalendarImpl.php', |
|
63 | + 'OCA\\DAV\\CalDAV\\CalendarManager' => __DIR__.'/..'.'/../lib/CalDAV/CalendarManager.php', |
|
64 | + 'OCA\\DAV\\CalDAV\\CalendarObject' => __DIR__.'/..'.'/../lib/CalDAV/CalendarObject.php', |
|
65 | + 'OCA\\DAV\\CalDAV\\CalendarProvider' => __DIR__.'/..'.'/../lib/CalDAV/CalendarProvider.php', |
|
66 | + 'OCA\\DAV\\CalDAV\\CalendarRoot' => __DIR__.'/..'.'/../lib/CalDAV/CalendarRoot.php', |
|
67 | + 'OCA\\DAV\\CalDAV\\ICSExportPlugin\\ICSExportPlugin' => __DIR__.'/..'.'/../lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php', |
|
68 | + 'OCA\\DAV\\CalDAV\\IRestorable' => __DIR__.'/..'.'/../lib/CalDAV/IRestorable.php', |
|
69 | + 'OCA\\DAV\\CalDAV\\Integration\\ExternalCalendar' => __DIR__.'/..'.'/../lib/CalDAV/Integration/ExternalCalendar.php', |
|
70 | + 'OCA\\DAV\\CalDAV\\Integration\\ICalendarProvider' => __DIR__.'/..'.'/../lib/CalDAV/Integration/ICalendarProvider.php', |
|
71 | + 'OCA\\DAV\\CalDAV\\InvitationResponse\\InvitationResponseServer' => __DIR__.'/..'.'/../lib/CalDAV/InvitationResponse/InvitationResponseServer.php', |
|
72 | + 'OCA\\DAV\\CalDAV\\Outbox' => __DIR__.'/..'.'/../lib/CalDAV/Outbox.php', |
|
73 | + 'OCA\\DAV\\CalDAV\\Plugin' => __DIR__.'/..'.'/../lib/CalDAV/Plugin.php', |
|
74 | + 'OCA\\DAV\\CalDAV\\Principal\\Collection' => __DIR__.'/..'.'/../lib/CalDAV/Principal/Collection.php', |
|
75 | + 'OCA\\DAV\\CalDAV\\Principal\\User' => __DIR__.'/..'.'/../lib/CalDAV/Principal/User.php', |
|
76 | + 'OCA\\DAV\\CalDAV\\Proxy\\Proxy' => __DIR__.'/..'.'/../lib/CalDAV/Proxy/Proxy.php', |
|
77 | + 'OCA\\DAV\\CalDAV\\Proxy\\ProxyMapper' => __DIR__.'/..'.'/../lib/CalDAV/Proxy/ProxyMapper.php', |
|
78 | + 'OCA\\DAV\\CalDAV\\PublicCalendar' => __DIR__.'/..'.'/../lib/CalDAV/PublicCalendar.php', |
|
79 | + 'OCA\\DAV\\CalDAV\\PublicCalendarObject' => __DIR__.'/..'.'/../lib/CalDAV/PublicCalendarObject.php', |
|
80 | + 'OCA\\DAV\\CalDAV\\PublicCalendarRoot' => __DIR__.'/..'.'/../lib/CalDAV/PublicCalendarRoot.php', |
|
81 | + 'OCA\\DAV\\CalDAV\\Publishing\\PublishPlugin' => __DIR__.'/..'.'/../lib/CalDAV/Publishing/PublishPlugin.php', |
|
82 | + 'OCA\\DAV\\CalDAV\\Publishing\\Xml\\Publisher' => __DIR__.'/..'.'/../lib/CalDAV/Publishing/Xml/Publisher.php', |
|
83 | + 'OCA\\DAV\\CalDAV\\Reminder\\Backend' => __DIR__.'/..'.'/../lib/CalDAV/Reminder/Backend.php', |
|
84 | + 'OCA\\DAV\\CalDAV\\Reminder\\INotificationProvider' => __DIR__.'/..'.'/../lib/CalDAV/Reminder/INotificationProvider.php', |
|
85 | + 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProviderManager' => __DIR__.'/..'.'/../lib/CalDAV/Reminder/NotificationProviderManager.php', |
|
86 | + 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\AbstractProvider' => __DIR__.'/..'.'/../lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php', |
|
87 | + 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\AudioProvider' => __DIR__.'/..'.'/../lib/CalDAV/Reminder/NotificationProvider/AudioProvider.php', |
|
88 | + 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\EmailProvider' => __DIR__.'/..'.'/../lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php', |
|
89 | + 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\ProviderNotAvailableException' => __DIR__.'/..'.'/../lib/CalDAV/Reminder/NotificationProvider/ProviderNotAvailableException.php', |
|
90 | + 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\PushProvider' => __DIR__.'/..'.'/../lib/CalDAV/Reminder/NotificationProvider/PushProvider.php', |
|
91 | + 'OCA\\DAV\\CalDAV\\Reminder\\NotificationTypeDoesNotExistException' => __DIR__.'/..'.'/../lib/CalDAV/Reminder/NotificationTypeDoesNotExistException.php', |
|
92 | + 'OCA\\DAV\\CalDAV\\Reminder\\Notifier' => __DIR__.'/..'.'/../lib/CalDAV/Reminder/Notifier.php', |
|
93 | + 'OCA\\DAV\\CalDAV\\Reminder\\ReminderService' => __DIR__.'/..'.'/../lib/CalDAV/Reminder/ReminderService.php', |
|
94 | + 'OCA\\DAV\\CalDAV\\ResourceBooking\\AbstractPrincipalBackend' => __DIR__.'/..'.'/../lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php', |
|
95 | + 'OCA\\DAV\\CalDAV\\ResourceBooking\\ResourcePrincipalBackend' => __DIR__.'/..'.'/../lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php', |
|
96 | + 'OCA\\DAV\\CalDAV\\ResourceBooking\\RoomPrincipalBackend' => __DIR__.'/..'.'/../lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php', |
|
97 | + 'OCA\\DAV\\CalDAV\\RetentionService' => __DIR__.'/..'.'/../lib/CalDAV/RetentionService.php', |
|
98 | + 'OCA\\DAV\\CalDAV\\Schedule\\IMipPlugin' => __DIR__.'/..'.'/../lib/CalDAV/Schedule/IMipPlugin.php', |
|
99 | + 'OCA\\DAV\\CalDAV\\Schedule\\Plugin' => __DIR__.'/..'.'/../lib/CalDAV/Schedule/Plugin.php', |
|
100 | + 'OCA\\DAV\\CalDAV\\Search\\SearchPlugin' => __DIR__.'/..'.'/../lib/CalDAV/Search/SearchPlugin.php', |
|
101 | + 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\CompFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/CompFilter.php', |
|
102 | + 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\LimitFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/LimitFilter.php', |
|
103 | + 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\OffsetFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/OffsetFilter.php', |
|
104 | + 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\ParamFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/ParamFilter.php', |
|
105 | + 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\PropFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/PropFilter.php', |
|
106 | + 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\SearchTermFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php', |
|
107 | + 'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php', |
|
108 | + 'OCA\\DAV\\CalDAV\\Trashbin\\DeletedCalendarObject' => __DIR__.'/..'.'/../lib/CalDAV/Trashbin/DeletedCalendarObject.php', |
|
109 | + 'OCA\\DAV\\CalDAV\\Trashbin\\DeletedCalendarObjectsCollection' => __DIR__.'/..'.'/../lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php', |
|
110 | + 'OCA\\DAV\\CalDAV\\Trashbin\\Plugin' => __DIR__.'/..'.'/../lib/CalDAV/Trashbin/Plugin.php', |
|
111 | + 'OCA\\DAV\\CalDAV\\Trashbin\\RestoreTarget' => __DIR__.'/..'.'/../lib/CalDAV/Trashbin/RestoreTarget.php', |
|
112 | + 'OCA\\DAV\\CalDAV\\Trashbin\\TrashbinHome' => __DIR__.'/..'.'/../lib/CalDAV/Trashbin/TrashbinHome.php', |
|
113 | + 'OCA\\DAV\\CalDAV\\WebcalCaching\\Plugin' => __DIR__.'/..'.'/../lib/CalDAV/WebcalCaching/Plugin.php', |
|
114 | + 'OCA\\DAV\\CalDAV\\WebcalCaching\\RefreshWebcalService' => __DIR__.'/..'.'/../lib/CalDAV/WebcalCaching/RefreshWebcalService.php', |
|
115 | + 'OCA\\DAV\\Capabilities' => __DIR__.'/..'.'/../lib/Capabilities.php', |
|
116 | + 'OCA\\DAV\\CardDAV\\Activity\\Backend' => __DIR__.'/..'.'/../lib/CardDAV/Activity/Backend.php', |
|
117 | + 'OCA\\DAV\\CardDAV\\Activity\\Filter' => __DIR__.'/..'.'/../lib/CardDAV/Activity/Filter.php', |
|
118 | + 'OCA\\DAV\\CardDAV\\Activity\\Provider\\Addressbook' => __DIR__.'/..'.'/../lib/CardDAV/Activity/Provider/Addressbook.php', |
|
119 | + 'OCA\\DAV\\CardDAV\\Activity\\Provider\\Base' => __DIR__.'/..'.'/../lib/CardDAV/Activity/Provider/Base.php', |
|
120 | + 'OCA\\DAV\\CardDAV\\Activity\\Provider\\Card' => __DIR__.'/..'.'/../lib/CardDAV/Activity/Provider/Card.php', |
|
121 | + 'OCA\\DAV\\CardDAV\\Activity\\Setting' => __DIR__.'/..'.'/../lib/CardDAV/Activity/Setting.php', |
|
122 | + 'OCA\\DAV\\CardDAV\\AddressBook' => __DIR__.'/..'.'/../lib/CardDAV/AddressBook.php', |
|
123 | + 'OCA\\DAV\\CardDAV\\AddressBookImpl' => __DIR__.'/..'.'/../lib/CardDAV/AddressBookImpl.php', |
|
124 | + 'OCA\\DAV\\CardDAV\\AddressBookRoot' => __DIR__.'/..'.'/../lib/CardDAV/AddressBookRoot.php', |
|
125 | + 'OCA\\DAV\\CardDAV\\CardDavBackend' => __DIR__.'/..'.'/../lib/CardDAV/CardDavBackend.php', |
|
126 | + 'OCA\\DAV\\CardDAV\\ContactsManager' => __DIR__.'/..'.'/../lib/CardDAV/ContactsManager.php', |
|
127 | + 'OCA\\DAV\\CardDAV\\Converter' => __DIR__.'/..'.'/../lib/CardDAV/Converter.php', |
|
128 | + 'OCA\\DAV\\CardDAV\\HasPhotoPlugin' => __DIR__.'/..'.'/../lib/CardDAV/HasPhotoPlugin.php', |
|
129 | + 'OCA\\DAV\\CardDAV\\ImageExportPlugin' => __DIR__.'/..'.'/../lib/CardDAV/ImageExportPlugin.php', |
|
130 | + 'OCA\\DAV\\CardDAV\\Integration\\ExternalAddressBook' => __DIR__.'/..'.'/../lib/CardDAV/Integration/ExternalAddressBook.php', |
|
131 | + 'OCA\\DAV\\CardDAV\\Integration\\IAddressBookProvider' => __DIR__.'/..'.'/../lib/CardDAV/Integration/IAddressBookProvider.php', |
|
132 | + 'OCA\\DAV\\CardDAV\\MultiGetExportPlugin' => __DIR__.'/..'.'/../lib/CardDAV/MultiGetExportPlugin.php', |
|
133 | + 'OCA\\DAV\\CardDAV\\PhotoCache' => __DIR__.'/..'.'/../lib/CardDAV/PhotoCache.php', |
|
134 | + 'OCA\\DAV\\CardDAV\\Plugin' => __DIR__.'/..'.'/../lib/CardDAV/Plugin.php', |
|
135 | + 'OCA\\DAV\\CardDAV\\SyncService' => __DIR__.'/..'.'/../lib/CardDAV/SyncService.php', |
|
136 | + 'OCA\\DAV\\CardDAV\\SystemAddressbook' => __DIR__.'/..'.'/../lib/CardDAV/SystemAddressbook.php', |
|
137 | + 'OCA\\DAV\\CardDAV\\UserAddressBooks' => __DIR__.'/..'.'/../lib/CardDAV/UserAddressBooks.php', |
|
138 | + 'OCA\\DAV\\CardDAV\\Xml\\Groups' => __DIR__.'/..'.'/../lib/CardDAV/Xml/Groups.php', |
|
139 | + 'OCA\\DAV\\Command\\CreateAddressBook' => __DIR__.'/..'.'/../lib/Command/CreateAddressBook.php', |
|
140 | + 'OCA\\DAV\\Command\\CreateCalendar' => __DIR__.'/..'.'/../lib/Command/CreateCalendar.php', |
|
141 | + 'OCA\\DAV\\Command\\DeleteCalendar' => __DIR__.'/..'.'/../lib/Command/DeleteCalendar.php', |
|
142 | + 'OCA\\DAV\\Command\\ListCalendars' => __DIR__.'/..'.'/../lib/Command/ListCalendars.php', |
|
143 | + 'OCA\\DAV\\Command\\MoveCalendar' => __DIR__.'/..'.'/../lib/Command/MoveCalendar.php', |
|
144 | + 'OCA\\DAV\\Command\\RemoveInvalidShares' => __DIR__.'/..'.'/../lib/Command/RemoveInvalidShares.php', |
|
145 | + 'OCA\\DAV\\Command\\RetentionCleanupCommand' => __DIR__.'/..'.'/../lib/Command/RetentionCleanupCommand.php', |
|
146 | + 'OCA\\DAV\\Command\\SendEventReminders' => __DIR__.'/..'.'/../lib/Command/SendEventReminders.php', |
|
147 | + 'OCA\\DAV\\Command\\SyncBirthdayCalendar' => __DIR__.'/..'.'/../lib/Command/SyncBirthdayCalendar.php', |
|
148 | + 'OCA\\DAV\\Command\\SyncSystemAddressBook' => __DIR__.'/..'.'/../lib/Command/SyncSystemAddressBook.php', |
|
149 | + 'OCA\\DAV\\Comments\\CommentNode' => __DIR__.'/..'.'/../lib/Comments/CommentNode.php', |
|
150 | + 'OCA\\DAV\\Comments\\CommentsPlugin' => __DIR__.'/..'.'/../lib/Comments/CommentsPlugin.php', |
|
151 | + 'OCA\\DAV\\Comments\\EntityCollection' => __DIR__.'/..'.'/../lib/Comments/EntityCollection.php', |
|
152 | + 'OCA\\DAV\\Comments\\EntityTypeCollection' => __DIR__.'/..'.'/../lib/Comments/EntityTypeCollection.php', |
|
153 | + 'OCA\\DAV\\Comments\\RootCollection' => __DIR__.'/..'.'/../lib/Comments/RootCollection.php', |
|
154 | + 'OCA\\DAV\\Connector\\LegacyDAVACL' => __DIR__.'/..'.'/../lib/Connector/LegacyDAVACL.php', |
|
155 | + 'OCA\\DAV\\Connector\\PublicAuth' => __DIR__.'/..'.'/../lib/Connector/PublicAuth.php', |
|
156 | + 'OCA\\DAV\\Connector\\Sabre\\AnonymousOptionsPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/AnonymousOptionsPlugin.php', |
|
157 | + 'OCA\\DAV\\Connector\\Sabre\\AppEnabledPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/AppEnabledPlugin.php', |
|
158 | + 'OCA\\DAV\\Connector\\Sabre\\Auth' => __DIR__.'/..'.'/../lib/Connector/Sabre/Auth.php', |
|
159 | + 'OCA\\DAV\\Connector\\Sabre\\BearerAuth' => __DIR__.'/..'.'/../lib/Connector/Sabre/BearerAuth.php', |
|
160 | + 'OCA\\DAV\\Connector\\Sabre\\BlockLegacyClientPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/BlockLegacyClientPlugin.php', |
|
161 | + 'OCA\\DAV\\Connector\\Sabre\\CachingTree' => __DIR__.'/..'.'/../lib/Connector/Sabre/CachingTree.php', |
|
162 | + 'OCA\\DAV\\Connector\\Sabre\\ChecksumList' => __DIR__.'/..'.'/../lib/Connector/Sabre/ChecksumList.php', |
|
163 | + 'OCA\\DAV\\Connector\\Sabre\\ChecksumUpdatePlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/ChecksumUpdatePlugin.php', |
|
164 | + 'OCA\\DAV\\Connector\\Sabre\\CommentPropertiesPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/CommentPropertiesPlugin.php', |
|
165 | + 'OCA\\DAV\\Connector\\Sabre\\CopyEtagHeaderPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/CopyEtagHeaderPlugin.php', |
|
166 | + 'OCA\\DAV\\Connector\\Sabre\\DavAclPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/DavAclPlugin.php', |
|
167 | + 'OCA\\DAV\\Connector\\Sabre\\Directory' => __DIR__.'/..'.'/../lib/Connector/Sabre/Directory.php', |
|
168 | + 'OCA\\DAV\\Connector\\Sabre\\DummyGetResponsePlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/DummyGetResponsePlugin.php', |
|
169 | + 'OCA\\DAV\\Connector\\Sabre\\ExceptionLoggerPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/ExceptionLoggerPlugin.php', |
|
170 | + 'OCA\\DAV\\Connector\\Sabre\\Exception\\BadGateway' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/BadGateway.php', |
|
171 | + 'OCA\\DAV\\Connector\\Sabre\\Exception\\EntityTooLarge' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/EntityTooLarge.php', |
|
172 | + 'OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/FileLocked.php', |
|
173 | + 'OCA\\DAV\\Connector\\Sabre\\Exception\\Forbidden' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/Forbidden.php', |
|
174 | + 'OCA\\DAV\\Connector\\Sabre\\Exception\\InvalidPath' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/InvalidPath.php', |
|
175 | + 'OCA\\DAV\\Connector\\Sabre\\Exception\\PasswordLoginForbidden' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/PasswordLoginForbidden.php', |
|
176 | + 'OCA\\DAV\\Connector\\Sabre\\Exception\\UnsupportedMediaType' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/UnsupportedMediaType.php', |
|
177 | + 'OCA\\DAV\\Connector\\Sabre\\FakeLockerPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/FakeLockerPlugin.php', |
|
178 | + 'OCA\\DAV\\Connector\\Sabre\\File' => __DIR__.'/..'.'/../lib/Connector/Sabre/File.php', |
|
179 | + 'OCA\\DAV\\Connector\\Sabre\\FilesPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/FilesPlugin.php', |
|
180 | + 'OCA\\DAV\\Connector\\Sabre\\FilesReportPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/FilesReportPlugin.php', |
|
181 | + 'OCA\\DAV\\Connector\\Sabre\\LockPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/LockPlugin.php', |
|
182 | + 'OCA\\DAV\\Connector\\Sabre\\MaintenancePlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/MaintenancePlugin.php', |
|
183 | + 'OCA\\DAV\\Connector\\Sabre\\MtimeSanitizer' => __DIR__.'/..'.'/../lib/Connector/Sabre/MtimeSanitizer.php', |
|
184 | + 'OCA\\DAV\\Connector\\Sabre\\Node' => __DIR__.'/..'.'/../lib/Connector/Sabre/Node.php', |
|
185 | + 'OCA\\DAV\\Connector\\Sabre\\ObjectTree' => __DIR__.'/..'.'/../lib/Connector/Sabre/ObjectTree.php', |
|
186 | + 'OCA\\DAV\\Connector\\Sabre\\Principal' => __DIR__.'/..'.'/../lib/Connector/Sabre/Principal.php', |
|
187 | + 'OCA\\DAV\\Connector\\Sabre\\PropfindCompressionPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/PropfindCompressionPlugin.php', |
|
188 | + 'OCA\\DAV\\Connector\\Sabre\\QuotaPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/QuotaPlugin.php', |
|
189 | + 'OCA\\DAV\\Connector\\Sabre\\RequestIdHeaderPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/RequestIdHeaderPlugin.php', |
|
190 | + 'OCA\\DAV\\Connector\\Sabre\\Server' => __DIR__.'/..'.'/../lib/Connector/Sabre/Server.php', |
|
191 | + 'OCA\\DAV\\Connector\\Sabre\\ServerFactory' => __DIR__.'/..'.'/../lib/Connector/Sabre/ServerFactory.php', |
|
192 | + 'OCA\\DAV\\Connector\\Sabre\\ShareTypeList' => __DIR__.'/..'.'/../lib/Connector/Sabre/ShareTypeList.php', |
|
193 | + 'OCA\\DAV\\Connector\\Sabre\\ShareeList' => __DIR__.'/..'.'/../lib/Connector/Sabre/ShareeList.php', |
|
194 | + 'OCA\\DAV\\Connector\\Sabre\\SharesPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/SharesPlugin.php', |
|
195 | + 'OCA\\DAV\\Connector\\Sabre\\TagList' => __DIR__.'/..'.'/../lib/Connector/Sabre/TagList.php', |
|
196 | + 'OCA\\DAV\\Connector\\Sabre\\TagsPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/TagsPlugin.php', |
|
197 | + 'OCA\\DAV\\Controller\\BirthdayCalendarController' => __DIR__.'/..'.'/../lib/Controller/BirthdayCalendarController.php', |
|
198 | + 'OCA\\DAV\\Controller\\DirectController' => __DIR__.'/..'.'/../lib/Controller/DirectController.php', |
|
199 | + 'OCA\\DAV\\Controller\\InvitationResponseController' => __DIR__.'/..'.'/../lib/Controller/InvitationResponseController.php', |
|
200 | + 'OCA\\DAV\\DAV\\CustomPropertiesBackend' => __DIR__.'/..'.'/../lib/DAV/CustomPropertiesBackend.php', |
|
201 | + 'OCA\\DAV\\DAV\\GroupPrincipalBackend' => __DIR__.'/..'.'/../lib/DAV/GroupPrincipalBackend.php', |
|
202 | + 'OCA\\DAV\\DAV\\PublicAuth' => __DIR__.'/..'.'/../lib/DAV/PublicAuth.php', |
|
203 | + 'OCA\\DAV\\DAV\\Sharing\\Backend' => __DIR__.'/..'.'/../lib/DAV/Sharing/Backend.php', |
|
204 | + 'OCA\\DAV\\DAV\\Sharing\\IShareable' => __DIR__.'/..'.'/../lib/DAV/Sharing/IShareable.php', |
|
205 | + 'OCA\\DAV\\DAV\\Sharing\\Plugin' => __DIR__.'/..'.'/../lib/DAV/Sharing/Plugin.php', |
|
206 | + 'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite' => __DIR__.'/..'.'/../lib/DAV/Sharing/Xml/Invite.php', |
|
207 | + 'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest' => __DIR__.'/..'.'/../lib/DAV/Sharing/Xml/ShareRequest.php', |
|
208 | + 'OCA\\DAV\\DAV\\SystemPrincipalBackend' => __DIR__.'/..'.'/../lib/DAV/SystemPrincipalBackend.php', |
|
209 | + 'OCA\\DAV\\Db\\Direct' => __DIR__.'/..'.'/../lib/Db/Direct.php', |
|
210 | + 'OCA\\DAV\\Db\\DirectMapper' => __DIR__.'/..'.'/../lib/Db/DirectMapper.php', |
|
211 | + 'OCA\\DAV\\Direct\\DirectFile' => __DIR__.'/..'.'/../lib/Direct/DirectFile.php', |
|
212 | + 'OCA\\DAV\\Direct\\DirectHome' => __DIR__.'/..'.'/../lib/Direct/DirectHome.php', |
|
213 | + 'OCA\\DAV\\Direct\\Server' => __DIR__.'/..'.'/../lib/Direct/Server.php', |
|
214 | + 'OCA\\DAV\\Direct\\ServerFactory' => __DIR__.'/..'.'/../lib/Direct/ServerFactory.php', |
|
215 | + 'OCA\\DAV\\Events\\AddressBookCreatedEvent' => __DIR__.'/..'.'/../lib/Events/AddressBookCreatedEvent.php', |
|
216 | + 'OCA\\DAV\\Events\\AddressBookDeletedEvent' => __DIR__.'/..'.'/../lib/Events/AddressBookDeletedEvent.php', |
|
217 | + 'OCA\\DAV\\Events\\AddressBookShareUpdatedEvent' => __DIR__.'/..'.'/../lib/Events/AddressBookShareUpdatedEvent.php', |
|
218 | + 'OCA\\DAV\\Events\\AddressBookUpdatedEvent' => __DIR__.'/..'.'/../lib/Events/AddressBookUpdatedEvent.php', |
|
219 | + 'OCA\\DAV\\Events\\BeforeFileDirectDownloadedEvent' => __DIR__.'/..'.'/../lib/Events/BeforeFileDirectDownloadedEvent.php', |
|
220 | + 'OCA\\DAV\\Events\\CachedCalendarObjectCreatedEvent' => __DIR__.'/..'.'/../lib/Events/CachedCalendarObjectCreatedEvent.php', |
|
221 | + 'OCA\\DAV\\Events\\CachedCalendarObjectDeletedEvent' => __DIR__.'/..'.'/../lib/Events/CachedCalendarObjectDeletedEvent.php', |
|
222 | + 'OCA\\DAV\\Events\\CachedCalendarObjectUpdatedEvent' => __DIR__.'/..'.'/../lib/Events/CachedCalendarObjectUpdatedEvent.php', |
|
223 | + 'OCA\\DAV\\Events\\CalendarCreatedEvent' => __DIR__.'/..'.'/../lib/Events/CalendarCreatedEvent.php', |
|
224 | + 'OCA\\DAV\\Events\\CalendarDeletedEvent' => __DIR__.'/..'.'/../lib/Events/CalendarDeletedEvent.php', |
|
225 | + 'OCA\\DAV\\Events\\CalendarMovedToTrashEvent' => __DIR__.'/..'.'/../lib/Events/CalendarMovedToTrashEvent.php', |
|
226 | + 'OCA\\DAV\\Events\\CalendarObjectCreatedEvent' => __DIR__.'/..'.'/../lib/Events/CalendarObjectCreatedEvent.php', |
|
227 | + 'OCA\\DAV\\Events\\CalendarObjectDeletedEvent' => __DIR__.'/..'.'/../lib/Events/CalendarObjectDeletedEvent.php', |
|
228 | + 'OCA\\DAV\\Events\\CalendarObjectMovedToTrashEvent' => __DIR__.'/..'.'/../lib/Events/CalendarObjectMovedToTrashEvent.php', |
|
229 | + 'OCA\\DAV\\Events\\CalendarObjectRestoredEvent' => __DIR__.'/..'.'/../lib/Events/CalendarObjectRestoredEvent.php', |
|
230 | + 'OCA\\DAV\\Events\\CalendarObjectUpdatedEvent' => __DIR__.'/..'.'/../lib/Events/CalendarObjectUpdatedEvent.php', |
|
231 | + 'OCA\\DAV\\Events\\CalendarPublishedEvent' => __DIR__.'/..'.'/../lib/Events/CalendarPublishedEvent.php', |
|
232 | + 'OCA\\DAV\\Events\\CalendarRestoredEvent' => __DIR__.'/..'.'/../lib/Events/CalendarRestoredEvent.php', |
|
233 | + 'OCA\\DAV\\Events\\CalendarShareUpdatedEvent' => __DIR__.'/..'.'/../lib/Events/CalendarShareUpdatedEvent.php', |
|
234 | + 'OCA\\DAV\\Events\\CalendarUnpublishedEvent' => __DIR__.'/..'.'/../lib/Events/CalendarUnpublishedEvent.php', |
|
235 | + 'OCA\\DAV\\Events\\CalendarUpdatedEvent' => __DIR__.'/..'.'/../lib/Events/CalendarUpdatedEvent.php', |
|
236 | + 'OCA\\DAV\\Events\\CardCreatedEvent' => __DIR__.'/..'.'/../lib/Events/CardCreatedEvent.php', |
|
237 | + 'OCA\\DAV\\Events\\CardDeletedEvent' => __DIR__.'/..'.'/../lib/Events/CardDeletedEvent.php', |
|
238 | + 'OCA\\DAV\\Events\\CardUpdatedEvent' => __DIR__.'/..'.'/../lib/Events/CardUpdatedEvent.php', |
|
239 | + 'OCA\\DAV\\Events\\SabrePluginAuthInitEvent' => __DIR__.'/..'.'/../lib/Events/SabrePluginAuthInitEvent.php', |
|
240 | + 'OCA\\DAV\\Events\\SubscriptionCreatedEvent' => __DIR__.'/..'.'/../lib/Events/SubscriptionCreatedEvent.php', |
|
241 | + 'OCA\\DAV\\Events\\SubscriptionDeletedEvent' => __DIR__.'/..'.'/../lib/Events/SubscriptionDeletedEvent.php', |
|
242 | + 'OCA\\DAV\\Events\\SubscriptionUpdatedEvent' => __DIR__.'/..'.'/../lib/Events/SubscriptionUpdatedEvent.php', |
|
243 | + 'OCA\\DAV\\Exception\\UnsupportedLimitOnInitialSyncException' => __DIR__.'/..'.'/../lib/Exception/UnsupportedLimitOnInitialSyncException.php', |
|
244 | + 'OCA\\DAV\\Files\\BrowserErrorPagePlugin' => __DIR__.'/..'.'/../lib/Files/BrowserErrorPagePlugin.php', |
|
245 | + 'OCA\\DAV\\Files\\FileSearchBackend' => __DIR__.'/..'.'/../lib/Files/FileSearchBackend.php', |
|
246 | + 'OCA\\DAV\\Files\\FilesHome' => __DIR__.'/..'.'/../lib/Files/FilesHome.php', |
|
247 | + 'OCA\\DAV\\Files\\LazySearchBackend' => __DIR__.'/..'.'/../lib/Files/LazySearchBackend.php', |
|
248 | + 'OCA\\DAV\\Files\\RootCollection' => __DIR__.'/..'.'/../lib/Files/RootCollection.php', |
|
249 | + 'OCA\\DAV\\Files\\Sharing\\FilesDropPlugin' => __DIR__.'/..'.'/../lib/Files/Sharing/FilesDropPlugin.php', |
|
250 | + 'OCA\\DAV\\Files\\Sharing\\PublicLinkCheckPlugin' => __DIR__.'/..'.'/../lib/Files/Sharing/PublicLinkCheckPlugin.php', |
|
251 | + 'OCA\\DAV\\HookManager' => __DIR__.'/..'.'/../lib/HookManager.php', |
|
252 | + 'OCA\\DAV\\Listener\\ActivityUpdaterListener' => __DIR__.'/..'.'/../lib/Listener/ActivityUpdaterListener.php', |
|
253 | + 'OCA\\DAV\\Listener\\AddressbookListener' => __DIR__.'/..'.'/../lib/Listener/AddressbookListener.php', |
|
254 | + 'OCA\\DAV\\Listener\\CalendarContactInteractionListener' => __DIR__.'/..'.'/../lib/Listener/CalendarContactInteractionListener.php', |
|
255 | + 'OCA\\DAV\\Listener\\CalendarDeletionDefaultUpdaterListener' => __DIR__.'/..'.'/../lib/Listener/CalendarDeletionDefaultUpdaterListener.php', |
|
256 | + 'OCA\\DAV\\Listener\\CalendarObjectReminderUpdaterListener' => __DIR__.'/..'.'/../lib/Listener/CalendarObjectReminderUpdaterListener.php', |
|
257 | + 'OCA\\DAV\\Listener\\CardListener' => __DIR__.'/..'.'/../lib/Listener/CardListener.php', |
|
258 | + 'OCA\\DAV\\Migration\\BuildCalendarSearchIndex' => __DIR__.'/..'.'/../lib/Migration/BuildCalendarSearchIndex.php', |
|
259 | + 'OCA\\DAV\\Migration\\BuildCalendarSearchIndexBackgroundJob' => __DIR__.'/..'.'/../lib/Migration/BuildCalendarSearchIndexBackgroundJob.php', |
|
260 | + 'OCA\\DAV\\Migration\\BuildSocialSearchIndex' => __DIR__.'/..'.'/../lib/Migration/BuildSocialSearchIndex.php', |
|
261 | + 'OCA\\DAV\\Migration\\BuildSocialSearchIndexBackgroundJob' => __DIR__.'/..'.'/../lib/Migration/BuildSocialSearchIndexBackgroundJob.php', |
|
262 | + 'OCA\\DAV\\Migration\\CalDAVRemoveEmptyValue' => __DIR__.'/..'.'/../lib/Migration/CalDAVRemoveEmptyValue.php', |
|
263 | + 'OCA\\DAV\\Migration\\ChunkCleanup' => __DIR__.'/..'.'/../lib/Migration/ChunkCleanup.php', |
|
264 | + 'OCA\\DAV\\Migration\\FixBirthdayCalendarComponent' => __DIR__.'/..'.'/../lib/Migration/FixBirthdayCalendarComponent.php', |
|
265 | + 'OCA\\DAV\\Migration\\RefreshWebcalJobRegistrar' => __DIR__.'/..'.'/../lib/Migration/RefreshWebcalJobRegistrar.php', |
|
266 | + 'OCA\\DAV\\Migration\\RegenerateBirthdayCalendars' => __DIR__.'/..'.'/../lib/Migration/RegenerateBirthdayCalendars.php', |
|
267 | + 'OCA\\DAV\\Migration\\RegisterBuildReminderIndexBackgroundJob' => __DIR__.'/..'.'/../lib/Migration/RegisterBuildReminderIndexBackgroundJob.php', |
|
268 | + 'OCA\\DAV\\Migration\\RemoveClassifiedEventActivity' => __DIR__.'/..'.'/../lib/Migration/RemoveClassifiedEventActivity.php', |
|
269 | + 'OCA\\DAV\\Migration\\RemoveDeletedUsersCalendarSubscriptions' => __DIR__.'/..'.'/../lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php', |
|
270 | + 'OCA\\DAV\\Migration\\RemoveOrphanEventsAndContacts' => __DIR__.'/..'.'/../lib/Migration/RemoveOrphanEventsAndContacts.php', |
|
271 | + 'OCA\\DAV\\Migration\\Version1004Date20170825134824' => __DIR__.'/..'.'/../lib/Migration/Version1004Date20170825134824.php', |
|
272 | + 'OCA\\DAV\\Migration\\Version1004Date20170919104507' => __DIR__.'/..'.'/../lib/Migration/Version1004Date20170919104507.php', |
|
273 | + 'OCA\\DAV\\Migration\\Version1004Date20170924124212' => __DIR__.'/..'.'/../lib/Migration/Version1004Date20170924124212.php', |
|
274 | + 'OCA\\DAV\\Migration\\Version1004Date20170926103422' => __DIR__.'/..'.'/../lib/Migration/Version1004Date20170926103422.php', |
|
275 | + 'OCA\\DAV\\Migration\\Version1005Date20180413093149' => __DIR__.'/..'.'/../lib/Migration/Version1005Date20180413093149.php', |
|
276 | + 'OCA\\DAV\\Migration\\Version1005Date20180530124431' => __DIR__.'/..'.'/../lib/Migration/Version1005Date20180530124431.php', |
|
277 | + 'OCA\\DAV\\Migration\\Version1006Date20180619154313' => __DIR__.'/..'.'/../lib/Migration/Version1006Date20180619154313.php', |
|
278 | + 'OCA\\DAV\\Migration\\Version1006Date20180628111625' => __DIR__.'/..'.'/../lib/Migration/Version1006Date20180628111625.php', |
|
279 | + 'OCA\\DAV\\Migration\\Version1008Date20181030113700' => __DIR__.'/..'.'/../lib/Migration/Version1008Date20181030113700.php', |
|
280 | + 'OCA\\DAV\\Migration\\Version1008Date20181105104826' => __DIR__.'/..'.'/../lib/Migration/Version1008Date20181105104826.php', |
|
281 | + 'OCA\\DAV\\Migration\\Version1008Date20181105104833' => __DIR__.'/..'.'/../lib/Migration/Version1008Date20181105104833.php', |
|
282 | + 'OCA\\DAV\\Migration\\Version1008Date20181105110300' => __DIR__.'/..'.'/../lib/Migration/Version1008Date20181105110300.php', |
|
283 | + 'OCA\\DAV\\Migration\\Version1008Date20181105112049' => __DIR__.'/..'.'/../lib/Migration/Version1008Date20181105112049.php', |
|
284 | + 'OCA\\DAV\\Migration\\Version1008Date20181114084440' => __DIR__.'/..'.'/../lib/Migration/Version1008Date20181114084440.php', |
|
285 | + 'OCA\\DAV\\Migration\\Version1011Date20190725113607' => __DIR__.'/..'.'/../lib/Migration/Version1011Date20190725113607.php', |
|
286 | + 'OCA\\DAV\\Migration\\Version1011Date20190806104428' => __DIR__.'/..'.'/../lib/Migration/Version1011Date20190806104428.php', |
|
287 | + 'OCA\\DAV\\Migration\\Version1012Date20190808122342' => __DIR__.'/..'.'/../lib/Migration/Version1012Date20190808122342.php', |
|
288 | + 'OCA\\DAV\\Migration\\Version1016Date20201109085907' => __DIR__.'/..'.'/../lib/Migration/Version1016Date20201109085907.php', |
|
289 | + 'OCA\\DAV\\Migration\\Version1017Date20210216083742' => __DIR__.'/..'.'/../lib/Migration/Version1017Date20210216083742.php', |
|
290 | + 'OCA\\DAV\\Migration\\Version1018Date20210312100735' => __DIR__.'/..'.'/../lib/Migration/Version1018Date20210312100735.php', |
|
291 | + 'OCA\\DAV\\Profiler\\ProfilerPlugin' => __DIR__.'/..'.'/../lib/Profiler/ProfilerPlugin.php', |
|
292 | + 'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningNode' => __DIR__.'/..'.'/../lib/Provisioning/Apple/AppleProvisioningNode.php', |
|
293 | + 'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningPlugin' => __DIR__.'/..'.'/../lib/Provisioning/Apple/AppleProvisioningPlugin.php', |
|
294 | + 'OCA\\DAV\\RootCollection' => __DIR__.'/..'.'/../lib/RootCollection.php', |
|
295 | + 'OCA\\DAV\\Search\\ACalendarSearchProvider' => __DIR__.'/..'.'/../lib/Search/ACalendarSearchProvider.php', |
|
296 | + 'OCA\\DAV\\Search\\ContactsSearchProvider' => __DIR__.'/..'.'/../lib/Search/ContactsSearchProvider.php', |
|
297 | + 'OCA\\DAV\\Search\\EventsSearchProvider' => __DIR__.'/..'.'/../lib/Search/EventsSearchProvider.php', |
|
298 | + 'OCA\\DAV\\Search\\TasksSearchProvider' => __DIR__.'/..'.'/../lib/Search/TasksSearchProvider.php', |
|
299 | + 'OCA\\DAV\\Server' => __DIR__.'/..'.'/../lib/Server.php', |
|
300 | + 'OCA\\DAV\\Settings\\AvailabilitySettings' => __DIR__.'/..'.'/../lib/Settings/AvailabilitySettings.php', |
|
301 | + 'OCA\\DAV\\Settings\\CalDAVSettings' => __DIR__.'/..'.'/../lib/Settings/CalDAVSettings.php', |
|
302 | + 'OCA\\DAV\\Storage\\PublicOwnerWrapper' => __DIR__.'/..'.'/../lib/Storage/PublicOwnerWrapper.php', |
|
303 | + 'OCA\\DAV\\SystemTag\\SystemTagMappingNode' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagMappingNode.php', |
|
304 | + 'OCA\\DAV\\SystemTag\\SystemTagNode' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagNode.php', |
|
305 | + 'OCA\\DAV\\SystemTag\\SystemTagPlugin' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagPlugin.php', |
|
306 | + 'OCA\\DAV\\SystemTag\\SystemTagsByIdCollection' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagsByIdCollection.php', |
|
307 | + 'OCA\\DAV\\SystemTag\\SystemTagsObjectMappingCollection' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagsObjectMappingCollection.php', |
|
308 | + 'OCA\\DAV\\SystemTag\\SystemTagsObjectTypeCollection' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagsObjectTypeCollection.php', |
|
309 | + 'OCA\\DAV\\SystemTag\\SystemTagsRelationsCollection' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagsRelationsCollection.php', |
|
310 | + 'OCA\\DAV\\Traits\\PrincipalProxyTrait' => __DIR__.'/..'.'/../lib/Traits/PrincipalProxyTrait.php', |
|
311 | + 'OCA\\DAV\\Upload\\AssemblyStream' => __DIR__.'/..'.'/../lib/Upload/AssemblyStream.php', |
|
312 | + 'OCA\\DAV\\Upload\\ChunkingPlugin' => __DIR__.'/..'.'/../lib/Upload/ChunkingPlugin.php', |
|
313 | + 'OCA\\DAV\\Upload\\CleanupService' => __DIR__.'/..'.'/../lib/Upload/CleanupService.php', |
|
314 | + 'OCA\\DAV\\Upload\\FutureFile' => __DIR__.'/..'.'/../lib/Upload/FutureFile.php', |
|
315 | + 'OCA\\DAV\\Upload\\RootCollection' => __DIR__.'/..'.'/../lib/Upload/RootCollection.php', |
|
316 | + 'OCA\\DAV\\Upload\\UploadFile' => __DIR__.'/..'.'/../lib/Upload/UploadFile.php', |
|
317 | + 'OCA\\DAV\\Upload\\UploadFolder' => __DIR__.'/..'.'/../lib/Upload/UploadFolder.php', |
|
318 | + 'OCA\\DAV\\Upload\\UploadHome' => __DIR__.'/..'.'/../lib/Upload/UploadHome.php', |
|
319 | + 'OCA\\DAV\\UserMigration\\CalendarMigrator' => __DIR__.'/..'.'/../lib/UserMigration/CalendarMigrator.php', |
|
320 | + 'OCA\\DAV\\UserMigration\\CalendarMigratorException' => __DIR__.'/..'.'/../lib/UserMigration/CalendarMigratorException.php', |
|
321 | + 'OCA\\DAV\\UserMigration\\InvalidCalendarException' => __DIR__.'/..'.'/../lib/UserMigration/InvalidCalendarException.php', |
|
322 | 322 | ); |
323 | 323 | |
324 | 324 | public static function getInitializer(ClassLoader $loader) |
325 | 325 | { |
326 | - return \Closure::bind(function () use ($loader) { |
|
326 | + return \Closure::bind(function() use ($loader) { |
|
327 | 327 | $loader->prefixLengthsPsr4 = ComposerStaticInitDAV::$prefixLengthsPsr4; |
328 | 328 | $loader->prefixDirsPsr4 = ComposerStaticInitDAV::$prefixDirsPsr4; |
329 | 329 | $loader->classMap = ComposerStaticInitDAV::$classMap; |
@@ -6,302 +6,302 @@ |
||
6 | 6 | $baseDir = $vendorDir; |
7 | 7 | |
8 | 8 | return array( |
9 | - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', |
|
10 | - 'OCA\\DAV\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', |
|
11 | - 'OCA\\DAV\\AppInfo\\PluginManager' => $baseDir . '/../lib/AppInfo/PluginManager.php', |
|
12 | - 'OCA\\DAV\\Avatars\\AvatarHome' => $baseDir . '/../lib/Avatars/AvatarHome.php', |
|
13 | - 'OCA\\DAV\\Avatars\\AvatarNode' => $baseDir . '/../lib/Avatars/AvatarNode.php', |
|
14 | - 'OCA\\DAV\\Avatars\\RootCollection' => $baseDir . '/../lib/Avatars/RootCollection.php', |
|
15 | - 'OCA\\DAV\\BackgroundJob\\BuildReminderIndexBackgroundJob' => $baseDir . '/../lib/BackgroundJob/BuildReminderIndexBackgroundJob.php', |
|
16 | - 'OCA\\DAV\\BackgroundJob\\CalendarRetentionJob' => $baseDir . '/../lib/BackgroundJob/CalendarRetentionJob.php', |
|
17 | - 'OCA\\DAV\\BackgroundJob\\CleanupDirectLinksJob' => $baseDir . '/../lib/BackgroundJob/CleanupDirectLinksJob.php', |
|
18 | - 'OCA\\DAV\\BackgroundJob\\CleanupInvitationTokenJob' => $baseDir . '/../lib/BackgroundJob/CleanupInvitationTokenJob.php', |
|
19 | - 'OCA\\DAV\\BackgroundJob\\EventReminderJob' => $baseDir . '/../lib/BackgroundJob/EventReminderJob.php', |
|
20 | - 'OCA\\DAV\\BackgroundJob\\GenerateBirthdayCalendarBackgroundJob' => $baseDir . '/../lib/BackgroundJob/GenerateBirthdayCalendarBackgroundJob.php', |
|
21 | - 'OCA\\DAV\\BackgroundJob\\RefreshWebcalJob' => $baseDir . '/../lib/BackgroundJob/RefreshWebcalJob.php', |
|
22 | - 'OCA\\DAV\\BackgroundJob\\RegisterRegenerateBirthdayCalendars' => $baseDir . '/../lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php', |
|
23 | - 'OCA\\DAV\\BackgroundJob\\UpdateCalendarResourcesRoomsBackgroundJob' => $baseDir . '/../lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php', |
|
24 | - 'OCA\\DAV\\BackgroundJob\\UploadCleanup' => $baseDir . '/../lib/BackgroundJob/UploadCleanup.php', |
|
25 | - 'OCA\\DAV\\BulkUpload\\BulkUploadPlugin' => $baseDir . '/../lib/BulkUpload/BulkUploadPlugin.php', |
|
26 | - 'OCA\\DAV\\BulkUpload\\MultipartRequestParser' => $baseDir . '/../lib/BulkUpload/MultipartRequestParser.php', |
|
27 | - 'OCA\\DAV\\CalDAV\\Activity\\Backend' => $baseDir . '/../lib/CalDAV/Activity/Backend.php', |
|
28 | - 'OCA\\DAV\\CalDAV\\Activity\\Filter\\Calendar' => $baseDir . '/../lib/CalDAV/Activity/Filter/Calendar.php', |
|
29 | - 'OCA\\DAV\\CalDAV\\Activity\\Filter\\Todo' => $baseDir . '/../lib/CalDAV/Activity/Filter/Todo.php', |
|
30 | - 'OCA\\DAV\\CalDAV\\Activity\\Provider\\Base' => $baseDir . '/../lib/CalDAV/Activity/Provider/Base.php', |
|
31 | - 'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => $baseDir . '/../lib/CalDAV/Activity/Provider/Calendar.php', |
|
32 | - 'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => $baseDir . '/../lib/CalDAV/Activity/Provider/Event.php', |
|
33 | - 'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => $baseDir . '/../lib/CalDAV/Activity/Provider/Todo.php', |
|
34 | - 'OCA\\DAV\\CalDAV\\Activity\\Setting\\CalDAVSetting' => $baseDir . '/../lib/CalDAV/Activity/Setting/CalDAVSetting.php', |
|
35 | - 'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => $baseDir . '/../lib/CalDAV/Activity/Setting/Calendar.php', |
|
36 | - 'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => $baseDir . '/../lib/CalDAV/Activity/Setting/Event.php', |
|
37 | - 'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => $baseDir . '/../lib/CalDAV/Activity/Setting/Todo.php', |
|
38 | - 'OCA\\DAV\\CalDAV\\Auth\\CustomPrincipalPlugin' => $baseDir . '/../lib/CalDAV/Auth/CustomPrincipalPlugin.php', |
|
39 | - 'OCA\\DAV\\CalDAV\\Auth\\PublicPrincipalPlugin' => $baseDir . '/../lib/CalDAV/Auth/PublicPrincipalPlugin.php', |
|
40 | - 'OCA\\DAV\\CalDAV\\BirthdayCalendar\\EnablePlugin' => $baseDir . '/../lib/CalDAV/BirthdayCalendar/EnablePlugin.php', |
|
41 | - 'OCA\\DAV\\CalDAV\\BirthdayService' => $baseDir . '/../lib/CalDAV/BirthdayService.php', |
|
42 | - 'OCA\\DAV\\CalDAV\\CachedSubscription' => $baseDir . '/../lib/CalDAV/CachedSubscription.php', |
|
43 | - 'OCA\\DAV\\CalDAV\\CachedSubscriptionObject' => $baseDir . '/../lib/CalDAV/CachedSubscriptionObject.php', |
|
44 | - 'OCA\\DAV\\CalDAV\\CalDavBackend' => $baseDir . '/../lib/CalDAV/CalDavBackend.php', |
|
45 | - 'OCA\\DAV\\CalDAV\\Calendar' => $baseDir . '/../lib/CalDAV/Calendar.php', |
|
46 | - 'OCA\\DAV\\CalDAV\\CalendarHome' => $baseDir . '/../lib/CalDAV/CalendarHome.php', |
|
47 | - 'OCA\\DAV\\CalDAV\\CalendarImpl' => $baseDir . '/../lib/CalDAV/CalendarImpl.php', |
|
48 | - 'OCA\\DAV\\CalDAV\\CalendarManager' => $baseDir . '/../lib/CalDAV/CalendarManager.php', |
|
49 | - 'OCA\\DAV\\CalDAV\\CalendarObject' => $baseDir . '/../lib/CalDAV/CalendarObject.php', |
|
50 | - 'OCA\\DAV\\CalDAV\\CalendarProvider' => $baseDir . '/../lib/CalDAV/CalendarProvider.php', |
|
51 | - 'OCA\\DAV\\CalDAV\\CalendarRoot' => $baseDir . '/../lib/CalDAV/CalendarRoot.php', |
|
52 | - 'OCA\\DAV\\CalDAV\\ICSExportPlugin\\ICSExportPlugin' => $baseDir . '/../lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php', |
|
53 | - 'OCA\\DAV\\CalDAV\\IRestorable' => $baseDir . '/../lib/CalDAV/IRestorable.php', |
|
54 | - 'OCA\\DAV\\CalDAV\\Integration\\ExternalCalendar' => $baseDir . '/../lib/CalDAV/Integration/ExternalCalendar.php', |
|
55 | - 'OCA\\DAV\\CalDAV\\Integration\\ICalendarProvider' => $baseDir . '/../lib/CalDAV/Integration/ICalendarProvider.php', |
|
56 | - 'OCA\\DAV\\CalDAV\\InvitationResponse\\InvitationResponseServer' => $baseDir . '/../lib/CalDAV/InvitationResponse/InvitationResponseServer.php', |
|
57 | - 'OCA\\DAV\\CalDAV\\Outbox' => $baseDir . '/../lib/CalDAV/Outbox.php', |
|
58 | - 'OCA\\DAV\\CalDAV\\Plugin' => $baseDir . '/../lib/CalDAV/Plugin.php', |
|
59 | - 'OCA\\DAV\\CalDAV\\Principal\\Collection' => $baseDir . '/../lib/CalDAV/Principal/Collection.php', |
|
60 | - 'OCA\\DAV\\CalDAV\\Principal\\User' => $baseDir . '/../lib/CalDAV/Principal/User.php', |
|
61 | - 'OCA\\DAV\\CalDAV\\Proxy\\Proxy' => $baseDir . '/../lib/CalDAV/Proxy/Proxy.php', |
|
62 | - 'OCA\\DAV\\CalDAV\\Proxy\\ProxyMapper' => $baseDir . '/../lib/CalDAV/Proxy/ProxyMapper.php', |
|
63 | - 'OCA\\DAV\\CalDAV\\PublicCalendar' => $baseDir . '/../lib/CalDAV/PublicCalendar.php', |
|
64 | - 'OCA\\DAV\\CalDAV\\PublicCalendarObject' => $baseDir . '/../lib/CalDAV/PublicCalendarObject.php', |
|
65 | - 'OCA\\DAV\\CalDAV\\PublicCalendarRoot' => $baseDir . '/../lib/CalDAV/PublicCalendarRoot.php', |
|
66 | - 'OCA\\DAV\\CalDAV\\Publishing\\PublishPlugin' => $baseDir . '/../lib/CalDAV/Publishing/PublishPlugin.php', |
|
67 | - 'OCA\\DAV\\CalDAV\\Publishing\\Xml\\Publisher' => $baseDir . '/../lib/CalDAV/Publishing/Xml/Publisher.php', |
|
68 | - 'OCA\\DAV\\CalDAV\\Reminder\\Backend' => $baseDir . '/../lib/CalDAV/Reminder/Backend.php', |
|
69 | - 'OCA\\DAV\\CalDAV\\Reminder\\INotificationProvider' => $baseDir . '/../lib/CalDAV/Reminder/INotificationProvider.php', |
|
70 | - 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProviderManager' => $baseDir . '/../lib/CalDAV/Reminder/NotificationProviderManager.php', |
|
71 | - 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\AbstractProvider' => $baseDir . '/../lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php', |
|
72 | - 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\AudioProvider' => $baseDir . '/../lib/CalDAV/Reminder/NotificationProvider/AudioProvider.php', |
|
73 | - 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\EmailProvider' => $baseDir . '/../lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php', |
|
74 | - 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\ProviderNotAvailableException' => $baseDir . '/../lib/CalDAV/Reminder/NotificationProvider/ProviderNotAvailableException.php', |
|
75 | - 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\PushProvider' => $baseDir . '/../lib/CalDAV/Reminder/NotificationProvider/PushProvider.php', |
|
76 | - 'OCA\\DAV\\CalDAV\\Reminder\\NotificationTypeDoesNotExistException' => $baseDir . '/../lib/CalDAV/Reminder/NotificationTypeDoesNotExistException.php', |
|
77 | - 'OCA\\DAV\\CalDAV\\Reminder\\Notifier' => $baseDir . '/../lib/CalDAV/Reminder/Notifier.php', |
|
78 | - 'OCA\\DAV\\CalDAV\\Reminder\\ReminderService' => $baseDir . '/../lib/CalDAV/Reminder/ReminderService.php', |
|
79 | - 'OCA\\DAV\\CalDAV\\ResourceBooking\\AbstractPrincipalBackend' => $baseDir . '/../lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php', |
|
80 | - 'OCA\\DAV\\CalDAV\\ResourceBooking\\ResourcePrincipalBackend' => $baseDir . '/../lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php', |
|
81 | - 'OCA\\DAV\\CalDAV\\ResourceBooking\\RoomPrincipalBackend' => $baseDir . '/../lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php', |
|
82 | - 'OCA\\DAV\\CalDAV\\RetentionService' => $baseDir . '/../lib/CalDAV/RetentionService.php', |
|
83 | - 'OCA\\DAV\\CalDAV\\Schedule\\IMipPlugin' => $baseDir . '/../lib/CalDAV/Schedule/IMipPlugin.php', |
|
84 | - 'OCA\\DAV\\CalDAV\\Schedule\\Plugin' => $baseDir . '/../lib/CalDAV/Schedule/Plugin.php', |
|
85 | - 'OCA\\DAV\\CalDAV\\Search\\SearchPlugin' => $baseDir . '/../lib/CalDAV/Search/SearchPlugin.php', |
|
86 | - 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\CompFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/CompFilter.php', |
|
87 | - 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\LimitFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/LimitFilter.php', |
|
88 | - 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\OffsetFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/OffsetFilter.php', |
|
89 | - 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\ParamFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/ParamFilter.php', |
|
90 | - 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\PropFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/PropFilter.php', |
|
91 | - 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\SearchTermFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php', |
|
92 | - 'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport' => $baseDir . '/../lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php', |
|
93 | - 'OCA\\DAV\\CalDAV\\Trashbin\\DeletedCalendarObject' => $baseDir . '/../lib/CalDAV/Trashbin/DeletedCalendarObject.php', |
|
94 | - 'OCA\\DAV\\CalDAV\\Trashbin\\DeletedCalendarObjectsCollection' => $baseDir . '/../lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php', |
|
95 | - 'OCA\\DAV\\CalDAV\\Trashbin\\Plugin' => $baseDir . '/../lib/CalDAV/Trashbin/Plugin.php', |
|
96 | - 'OCA\\DAV\\CalDAV\\Trashbin\\RestoreTarget' => $baseDir . '/../lib/CalDAV/Trashbin/RestoreTarget.php', |
|
97 | - 'OCA\\DAV\\CalDAV\\Trashbin\\TrashbinHome' => $baseDir . '/../lib/CalDAV/Trashbin/TrashbinHome.php', |
|
98 | - 'OCA\\DAV\\CalDAV\\WebcalCaching\\Plugin' => $baseDir . '/../lib/CalDAV/WebcalCaching/Plugin.php', |
|
99 | - 'OCA\\DAV\\CalDAV\\WebcalCaching\\RefreshWebcalService' => $baseDir . '/../lib/CalDAV/WebcalCaching/RefreshWebcalService.php', |
|
100 | - 'OCA\\DAV\\Capabilities' => $baseDir . '/../lib/Capabilities.php', |
|
101 | - 'OCA\\DAV\\CardDAV\\Activity\\Backend' => $baseDir . '/../lib/CardDAV/Activity/Backend.php', |
|
102 | - 'OCA\\DAV\\CardDAV\\Activity\\Filter' => $baseDir . '/../lib/CardDAV/Activity/Filter.php', |
|
103 | - 'OCA\\DAV\\CardDAV\\Activity\\Provider\\Addressbook' => $baseDir . '/../lib/CardDAV/Activity/Provider/Addressbook.php', |
|
104 | - 'OCA\\DAV\\CardDAV\\Activity\\Provider\\Base' => $baseDir . '/../lib/CardDAV/Activity/Provider/Base.php', |
|
105 | - 'OCA\\DAV\\CardDAV\\Activity\\Provider\\Card' => $baseDir . '/../lib/CardDAV/Activity/Provider/Card.php', |
|
106 | - 'OCA\\DAV\\CardDAV\\Activity\\Setting' => $baseDir . '/../lib/CardDAV/Activity/Setting.php', |
|
107 | - 'OCA\\DAV\\CardDAV\\AddressBook' => $baseDir . '/../lib/CardDAV/AddressBook.php', |
|
108 | - 'OCA\\DAV\\CardDAV\\AddressBookImpl' => $baseDir . '/../lib/CardDAV/AddressBookImpl.php', |
|
109 | - 'OCA\\DAV\\CardDAV\\AddressBookRoot' => $baseDir . '/../lib/CardDAV/AddressBookRoot.php', |
|
110 | - 'OCA\\DAV\\CardDAV\\CardDavBackend' => $baseDir . '/../lib/CardDAV/CardDavBackend.php', |
|
111 | - 'OCA\\DAV\\CardDAV\\ContactsManager' => $baseDir . '/../lib/CardDAV/ContactsManager.php', |
|
112 | - 'OCA\\DAV\\CardDAV\\Converter' => $baseDir . '/../lib/CardDAV/Converter.php', |
|
113 | - 'OCA\\DAV\\CardDAV\\HasPhotoPlugin' => $baseDir . '/../lib/CardDAV/HasPhotoPlugin.php', |
|
114 | - 'OCA\\DAV\\CardDAV\\ImageExportPlugin' => $baseDir . '/../lib/CardDAV/ImageExportPlugin.php', |
|
115 | - 'OCA\\DAV\\CardDAV\\Integration\\ExternalAddressBook' => $baseDir . '/../lib/CardDAV/Integration/ExternalAddressBook.php', |
|
116 | - 'OCA\\DAV\\CardDAV\\Integration\\IAddressBookProvider' => $baseDir . '/../lib/CardDAV/Integration/IAddressBookProvider.php', |
|
117 | - 'OCA\\DAV\\CardDAV\\MultiGetExportPlugin' => $baseDir . '/../lib/CardDAV/MultiGetExportPlugin.php', |
|
118 | - 'OCA\\DAV\\CardDAV\\PhotoCache' => $baseDir . '/../lib/CardDAV/PhotoCache.php', |
|
119 | - 'OCA\\DAV\\CardDAV\\Plugin' => $baseDir . '/../lib/CardDAV/Plugin.php', |
|
120 | - 'OCA\\DAV\\CardDAV\\SyncService' => $baseDir . '/../lib/CardDAV/SyncService.php', |
|
121 | - 'OCA\\DAV\\CardDAV\\SystemAddressbook' => $baseDir . '/../lib/CardDAV/SystemAddressbook.php', |
|
122 | - 'OCA\\DAV\\CardDAV\\UserAddressBooks' => $baseDir . '/../lib/CardDAV/UserAddressBooks.php', |
|
123 | - 'OCA\\DAV\\CardDAV\\Xml\\Groups' => $baseDir . '/../lib/CardDAV/Xml/Groups.php', |
|
124 | - 'OCA\\DAV\\Command\\CreateAddressBook' => $baseDir . '/../lib/Command/CreateAddressBook.php', |
|
125 | - 'OCA\\DAV\\Command\\CreateCalendar' => $baseDir . '/../lib/Command/CreateCalendar.php', |
|
126 | - 'OCA\\DAV\\Command\\DeleteCalendar' => $baseDir . '/../lib/Command/DeleteCalendar.php', |
|
127 | - 'OCA\\DAV\\Command\\ListCalendars' => $baseDir . '/../lib/Command/ListCalendars.php', |
|
128 | - 'OCA\\DAV\\Command\\MoveCalendar' => $baseDir . '/../lib/Command/MoveCalendar.php', |
|
129 | - 'OCA\\DAV\\Command\\RemoveInvalidShares' => $baseDir . '/../lib/Command/RemoveInvalidShares.php', |
|
130 | - 'OCA\\DAV\\Command\\RetentionCleanupCommand' => $baseDir . '/../lib/Command/RetentionCleanupCommand.php', |
|
131 | - 'OCA\\DAV\\Command\\SendEventReminders' => $baseDir . '/../lib/Command/SendEventReminders.php', |
|
132 | - 'OCA\\DAV\\Command\\SyncBirthdayCalendar' => $baseDir . '/../lib/Command/SyncBirthdayCalendar.php', |
|
133 | - 'OCA\\DAV\\Command\\SyncSystemAddressBook' => $baseDir . '/../lib/Command/SyncSystemAddressBook.php', |
|
134 | - 'OCA\\DAV\\Comments\\CommentNode' => $baseDir . '/../lib/Comments/CommentNode.php', |
|
135 | - 'OCA\\DAV\\Comments\\CommentsPlugin' => $baseDir . '/../lib/Comments/CommentsPlugin.php', |
|
136 | - 'OCA\\DAV\\Comments\\EntityCollection' => $baseDir . '/../lib/Comments/EntityCollection.php', |
|
137 | - 'OCA\\DAV\\Comments\\EntityTypeCollection' => $baseDir . '/../lib/Comments/EntityTypeCollection.php', |
|
138 | - 'OCA\\DAV\\Comments\\RootCollection' => $baseDir . '/../lib/Comments/RootCollection.php', |
|
139 | - 'OCA\\DAV\\Connector\\LegacyDAVACL' => $baseDir . '/../lib/Connector/LegacyDAVACL.php', |
|
140 | - 'OCA\\DAV\\Connector\\PublicAuth' => $baseDir . '/../lib/Connector/PublicAuth.php', |
|
141 | - 'OCA\\DAV\\Connector\\Sabre\\AnonymousOptionsPlugin' => $baseDir . '/../lib/Connector/Sabre/AnonymousOptionsPlugin.php', |
|
142 | - 'OCA\\DAV\\Connector\\Sabre\\AppEnabledPlugin' => $baseDir . '/../lib/Connector/Sabre/AppEnabledPlugin.php', |
|
143 | - 'OCA\\DAV\\Connector\\Sabre\\Auth' => $baseDir . '/../lib/Connector/Sabre/Auth.php', |
|
144 | - 'OCA\\DAV\\Connector\\Sabre\\BearerAuth' => $baseDir . '/../lib/Connector/Sabre/BearerAuth.php', |
|
145 | - 'OCA\\DAV\\Connector\\Sabre\\BlockLegacyClientPlugin' => $baseDir . '/../lib/Connector/Sabre/BlockLegacyClientPlugin.php', |
|
146 | - 'OCA\\DAV\\Connector\\Sabre\\CachingTree' => $baseDir . '/../lib/Connector/Sabre/CachingTree.php', |
|
147 | - 'OCA\\DAV\\Connector\\Sabre\\ChecksumList' => $baseDir . '/../lib/Connector/Sabre/ChecksumList.php', |
|
148 | - 'OCA\\DAV\\Connector\\Sabre\\ChecksumUpdatePlugin' => $baseDir . '/../lib/Connector/Sabre/ChecksumUpdatePlugin.php', |
|
149 | - 'OCA\\DAV\\Connector\\Sabre\\CommentPropertiesPlugin' => $baseDir . '/../lib/Connector/Sabre/CommentPropertiesPlugin.php', |
|
150 | - 'OCA\\DAV\\Connector\\Sabre\\CopyEtagHeaderPlugin' => $baseDir . '/../lib/Connector/Sabre/CopyEtagHeaderPlugin.php', |
|
151 | - 'OCA\\DAV\\Connector\\Sabre\\DavAclPlugin' => $baseDir . '/../lib/Connector/Sabre/DavAclPlugin.php', |
|
152 | - 'OCA\\DAV\\Connector\\Sabre\\Directory' => $baseDir . '/../lib/Connector/Sabre/Directory.php', |
|
153 | - 'OCA\\DAV\\Connector\\Sabre\\DummyGetResponsePlugin' => $baseDir . '/../lib/Connector/Sabre/DummyGetResponsePlugin.php', |
|
154 | - 'OCA\\DAV\\Connector\\Sabre\\ExceptionLoggerPlugin' => $baseDir . '/../lib/Connector/Sabre/ExceptionLoggerPlugin.php', |
|
155 | - 'OCA\\DAV\\Connector\\Sabre\\Exception\\BadGateway' => $baseDir . '/../lib/Connector/Sabre/Exception/BadGateway.php', |
|
156 | - 'OCA\\DAV\\Connector\\Sabre\\Exception\\EntityTooLarge' => $baseDir . '/../lib/Connector/Sabre/Exception/EntityTooLarge.php', |
|
157 | - 'OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked' => $baseDir . '/../lib/Connector/Sabre/Exception/FileLocked.php', |
|
158 | - 'OCA\\DAV\\Connector\\Sabre\\Exception\\Forbidden' => $baseDir . '/../lib/Connector/Sabre/Exception/Forbidden.php', |
|
159 | - 'OCA\\DAV\\Connector\\Sabre\\Exception\\InvalidPath' => $baseDir . '/../lib/Connector/Sabre/Exception/InvalidPath.php', |
|
160 | - 'OCA\\DAV\\Connector\\Sabre\\Exception\\PasswordLoginForbidden' => $baseDir . '/../lib/Connector/Sabre/Exception/PasswordLoginForbidden.php', |
|
161 | - 'OCA\\DAV\\Connector\\Sabre\\Exception\\UnsupportedMediaType' => $baseDir . '/../lib/Connector/Sabre/Exception/UnsupportedMediaType.php', |
|
162 | - 'OCA\\DAV\\Connector\\Sabre\\FakeLockerPlugin' => $baseDir . '/../lib/Connector/Sabre/FakeLockerPlugin.php', |
|
163 | - 'OCA\\DAV\\Connector\\Sabre\\File' => $baseDir . '/../lib/Connector/Sabre/File.php', |
|
164 | - 'OCA\\DAV\\Connector\\Sabre\\FilesPlugin' => $baseDir . '/../lib/Connector/Sabre/FilesPlugin.php', |
|
165 | - 'OCA\\DAV\\Connector\\Sabre\\FilesReportPlugin' => $baseDir . '/../lib/Connector/Sabre/FilesReportPlugin.php', |
|
166 | - 'OCA\\DAV\\Connector\\Sabre\\LockPlugin' => $baseDir . '/../lib/Connector/Sabre/LockPlugin.php', |
|
167 | - 'OCA\\DAV\\Connector\\Sabre\\MaintenancePlugin' => $baseDir . '/../lib/Connector/Sabre/MaintenancePlugin.php', |
|
168 | - 'OCA\\DAV\\Connector\\Sabre\\MtimeSanitizer' => $baseDir . '/../lib/Connector/Sabre/MtimeSanitizer.php', |
|
169 | - 'OCA\\DAV\\Connector\\Sabre\\Node' => $baseDir . '/../lib/Connector/Sabre/Node.php', |
|
170 | - 'OCA\\DAV\\Connector\\Sabre\\ObjectTree' => $baseDir . '/../lib/Connector/Sabre/ObjectTree.php', |
|
171 | - 'OCA\\DAV\\Connector\\Sabre\\Principal' => $baseDir . '/../lib/Connector/Sabre/Principal.php', |
|
172 | - 'OCA\\DAV\\Connector\\Sabre\\PropfindCompressionPlugin' => $baseDir . '/../lib/Connector/Sabre/PropfindCompressionPlugin.php', |
|
173 | - 'OCA\\DAV\\Connector\\Sabre\\QuotaPlugin' => $baseDir . '/../lib/Connector/Sabre/QuotaPlugin.php', |
|
174 | - 'OCA\\DAV\\Connector\\Sabre\\RequestIdHeaderPlugin' => $baseDir . '/../lib/Connector/Sabre/RequestIdHeaderPlugin.php', |
|
175 | - 'OCA\\DAV\\Connector\\Sabre\\Server' => $baseDir . '/../lib/Connector/Sabre/Server.php', |
|
176 | - 'OCA\\DAV\\Connector\\Sabre\\ServerFactory' => $baseDir . '/../lib/Connector/Sabre/ServerFactory.php', |
|
177 | - 'OCA\\DAV\\Connector\\Sabre\\ShareTypeList' => $baseDir . '/../lib/Connector/Sabre/ShareTypeList.php', |
|
178 | - 'OCA\\DAV\\Connector\\Sabre\\ShareeList' => $baseDir . '/../lib/Connector/Sabre/ShareeList.php', |
|
179 | - 'OCA\\DAV\\Connector\\Sabre\\SharesPlugin' => $baseDir . '/../lib/Connector/Sabre/SharesPlugin.php', |
|
180 | - 'OCA\\DAV\\Connector\\Sabre\\TagList' => $baseDir . '/../lib/Connector/Sabre/TagList.php', |
|
181 | - 'OCA\\DAV\\Connector\\Sabre\\TagsPlugin' => $baseDir . '/../lib/Connector/Sabre/TagsPlugin.php', |
|
182 | - 'OCA\\DAV\\Controller\\BirthdayCalendarController' => $baseDir . '/../lib/Controller/BirthdayCalendarController.php', |
|
183 | - 'OCA\\DAV\\Controller\\DirectController' => $baseDir . '/../lib/Controller/DirectController.php', |
|
184 | - 'OCA\\DAV\\Controller\\InvitationResponseController' => $baseDir . '/../lib/Controller/InvitationResponseController.php', |
|
185 | - 'OCA\\DAV\\DAV\\CustomPropertiesBackend' => $baseDir . '/../lib/DAV/CustomPropertiesBackend.php', |
|
186 | - 'OCA\\DAV\\DAV\\GroupPrincipalBackend' => $baseDir . '/../lib/DAV/GroupPrincipalBackend.php', |
|
187 | - 'OCA\\DAV\\DAV\\PublicAuth' => $baseDir . '/../lib/DAV/PublicAuth.php', |
|
188 | - 'OCA\\DAV\\DAV\\Sharing\\Backend' => $baseDir . '/../lib/DAV/Sharing/Backend.php', |
|
189 | - 'OCA\\DAV\\DAV\\Sharing\\IShareable' => $baseDir . '/../lib/DAV/Sharing/IShareable.php', |
|
190 | - 'OCA\\DAV\\DAV\\Sharing\\Plugin' => $baseDir . '/../lib/DAV/Sharing/Plugin.php', |
|
191 | - 'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite' => $baseDir . '/../lib/DAV/Sharing/Xml/Invite.php', |
|
192 | - 'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest' => $baseDir . '/../lib/DAV/Sharing/Xml/ShareRequest.php', |
|
193 | - 'OCA\\DAV\\DAV\\SystemPrincipalBackend' => $baseDir . '/../lib/DAV/SystemPrincipalBackend.php', |
|
194 | - 'OCA\\DAV\\Db\\Direct' => $baseDir . '/../lib/Db/Direct.php', |
|
195 | - 'OCA\\DAV\\Db\\DirectMapper' => $baseDir . '/../lib/Db/DirectMapper.php', |
|
196 | - 'OCA\\DAV\\Direct\\DirectFile' => $baseDir . '/../lib/Direct/DirectFile.php', |
|
197 | - 'OCA\\DAV\\Direct\\DirectHome' => $baseDir . '/../lib/Direct/DirectHome.php', |
|
198 | - 'OCA\\DAV\\Direct\\Server' => $baseDir . '/../lib/Direct/Server.php', |
|
199 | - 'OCA\\DAV\\Direct\\ServerFactory' => $baseDir . '/../lib/Direct/ServerFactory.php', |
|
200 | - 'OCA\\DAV\\Events\\AddressBookCreatedEvent' => $baseDir . '/../lib/Events/AddressBookCreatedEvent.php', |
|
201 | - 'OCA\\DAV\\Events\\AddressBookDeletedEvent' => $baseDir . '/../lib/Events/AddressBookDeletedEvent.php', |
|
202 | - 'OCA\\DAV\\Events\\AddressBookShareUpdatedEvent' => $baseDir . '/../lib/Events/AddressBookShareUpdatedEvent.php', |
|
203 | - 'OCA\\DAV\\Events\\AddressBookUpdatedEvent' => $baseDir . '/../lib/Events/AddressBookUpdatedEvent.php', |
|
204 | - 'OCA\\DAV\\Events\\BeforeFileDirectDownloadedEvent' => $baseDir . '/../lib/Events/BeforeFileDirectDownloadedEvent.php', |
|
205 | - 'OCA\\DAV\\Events\\CachedCalendarObjectCreatedEvent' => $baseDir . '/../lib/Events/CachedCalendarObjectCreatedEvent.php', |
|
206 | - 'OCA\\DAV\\Events\\CachedCalendarObjectDeletedEvent' => $baseDir . '/../lib/Events/CachedCalendarObjectDeletedEvent.php', |
|
207 | - 'OCA\\DAV\\Events\\CachedCalendarObjectUpdatedEvent' => $baseDir . '/../lib/Events/CachedCalendarObjectUpdatedEvent.php', |
|
208 | - 'OCA\\DAV\\Events\\CalendarCreatedEvent' => $baseDir . '/../lib/Events/CalendarCreatedEvent.php', |
|
209 | - 'OCA\\DAV\\Events\\CalendarDeletedEvent' => $baseDir . '/../lib/Events/CalendarDeletedEvent.php', |
|
210 | - 'OCA\\DAV\\Events\\CalendarMovedToTrashEvent' => $baseDir . '/../lib/Events/CalendarMovedToTrashEvent.php', |
|
211 | - 'OCA\\DAV\\Events\\CalendarObjectCreatedEvent' => $baseDir . '/../lib/Events/CalendarObjectCreatedEvent.php', |
|
212 | - 'OCA\\DAV\\Events\\CalendarObjectDeletedEvent' => $baseDir . '/../lib/Events/CalendarObjectDeletedEvent.php', |
|
213 | - 'OCA\\DAV\\Events\\CalendarObjectMovedToTrashEvent' => $baseDir . '/../lib/Events/CalendarObjectMovedToTrashEvent.php', |
|
214 | - 'OCA\\DAV\\Events\\CalendarObjectRestoredEvent' => $baseDir . '/../lib/Events/CalendarObjectRestoredEvent.php', |
|
215 | - 'OCA\\DAV\\Events\\CalendarObjectUpdatedEvent' => $baseDir . '/../lib/Events/CalendarObjectUpdatedEvent.php', |
|
216 | - 'OCA\\DAV\\Events\\CalendarPublishedEvent' => $baseDir . '/../lib/Events/CalendarPublishedEvent.php', |
|
217 | - 'OCA\\DAV\\Events\\CalendarRestoredEvent' => $baseDir . '/../lib/Events/CalendarRestoredEvent.php', |
|
218 | - 'OCA\\DAV\\Events\\CalendarShareUpdatedEvent' => $baseDir . '/../lib/Events/CalendarShareUpdatedEvent.php', |
|
219 | - 'OCA\\DAV\\Events\\CalendarUnpublishedEvent' => $baseDir . '/../lib/Events/CalendarUnpublishedEvent.php', |
|
220 | - 'OCA\\DAV\\Events\\CalendarUpdatedEvent' => $baseDir . '/../lib/Events/CalendarUpdatedEvent.php', |
|
221 | - 'OCA\\DAV\\Events\\CardCreatedEvent' => $baseDir . '/../lib/Events/CardCreatedEvent.php', |
|
222 | - 'OCA\\DAV\\Events\\CardDeletedEvent' => $baseDir . '/../lib/Events/CardDeletedEvent.php', |
|
223 | - 'OCA\\DAV\\Events\\CardUpdatedEvent' => $baseDir . '/../lib/Events/CardUpdatedEvent.php', |
|
224 | - 'OCA\\DAV\\Events\\SabrePluginAuthInitEvent' => $baseDir . '/../lib/Events/SabrePluginAuthInitEvent.php', |
|
225 | - 'OCA\\DAV\\Events\\SubscriptionCreatedEvent' => $baseDir . '/../lib/Events/SubscriptionCreatedEvent.php', |
|
226 | - 'OCA\\DAV\\Events\\SubscriptionDeletedEvent' => $baseDir . '/../lib/Events/SubscriptionDeletedEvent.php', |
|
227 | - 'OCA\\DAV\\Events\\SubscriptionUpdatedEvent' => $baseDir . '/../lib/Events/SubscriptionUpdatedEvent.php', |
|
228 | - 'OCA\\DAV\\Exception\\UnsupportedLimitOnInitialSyncException' => $baseDir . '/../lib/Exception/UnsupportedLimitOnInitialSyncException.php', |
|
229 | - 'OCA\\DAV\\Files\\BrowserErrorPagePlugin' => $baseDir . '/../lib/Files/BrowserErrorPagePlugin.php', |
|
230 | - 'OCA\\DAV\\Files\\FileSearchBackend' => $baseDir . '/../lib/Files/FileSearchBackend.php', |
|
231 | - 'OCA\\DAV\\Files\\FilesHome' => $baseDir . '/../lib/Files/FilesHome.php', |
|
232 | - 'OCA\\DAV\\Files\\LazySearchBackend' => $baseDir . '/../lib/Files/LazySearchBackend.php', |
|
233 | - 'OCA\\DAV\\Files\\RootCollection' => $baseDir . '/../lib/Files/RootCollection.php', |
|
234 | - 'OCA\\DAV\\Files\\Sharing\\FilesDropPlugin' => $baseDir . '/../lib/Files/Sharing/FilesDropPlugin.php', |
|
235 | - 'OCA\\DAV\\Files\\Sharing\\PublicLinkCheckPlugin' => $baseDir . '/../lib/Files/Sharing/PublicLinkCheckPlugin.php', |
|
236 | - 'OCA\\DAV\\HookManager' => $baseDir . '/../lib/HookManager.php', |
|
237 | - 'OCA\\DAV\\Listener\\ActivityUpdaterListener' => $baseDir . '/../lib/Listener/ActivityUpdaterListener.php', |
|
238 | - 'OCA\\DAV\\Listener\\AddressbookListener' => $baseDir . '/../lib/Listener/AddressbookListener.php', |
|
239 | - 'OCA\\DAV\\Listener\\CalendarContactInteractionListener' => $baseDir . '/../lib/Listener/CalendarContactInteractionListener.php', |
|
240 | - 'OCA\\DAV\\Listener\\CalendarDeletionDefaultUpdaterListener' => $baseDir . '/../lib/Listener/CalendarDeletionDefaultUpdaterListener.php', |
|
241 | - 'OCA\\DAV\\Listener\\CalendarObjectReminderUpdaterListener' => $baseDir . '/../lib/Listener/CalendarObjectReminderUpdaterListener.php', |
|
242 | - 'OCA\\DAV\\Listener\\CardListener' => $baseDir . '/../lib/Listener/CardListener.php', |
|
243 | - 'OCA\\DAV\\Migration\\BuildCalendarSearchIndex' => $baseDir . '/../lib/Migration/BuildCalendarSearchIndex.php', |
|
244 | - 'OCA\\DAV\\Migration\\BuildCalendarSearchIndexBackgroundJob' => $baseDir . '/../lib/Migration/BuildCalendarSearchIndexBackgroundJob.php', |
|
245 | - 'OCA\\DAV\\Migration\\BuildSocialSearchIndex' => $baseDir . '/../lib/Migration/BuildSocialSearchIndex.php', |
|
246 | - 'OCA\\DAV\\Migration\\BuildSocialSearchIndexBackgroundJob' => $baseDir . '/../lib/Migration/BuildSocialSearchIndexBackgroundJob.php', |
|
247 | - 'OCA\\DAV\\Migration\\CalDAVRemoveEmptyValue' => $baseDir . '/../lib/Migration/CalDAVRemoveEmptyValue.php', |
|
248 | - 'OCA\\DAV\\Migration\\ChunkCleanup' => $baseDir . '/../lib/Migration/ChunkCleanup.php', |
|
249 | - 'OCA\\DAV\\Migration\\FixBirthdayCalendarComponent' => $baseDir . '/../lib/Migration/FixBirthdayCalendarComponent.php', |
|
250 | - 'OCA\\DAV\\Migration\\RefreshWebcalJobRegistrar' => $baseDir . '/../lib/Migration/RefreshWebcalJobRegistrar.php', |
|
251 | - 'OCA\\DAV\\Migration\\RegenerateBirthdayCalendars' => $baseDir . '/../lib/Migration/RegenerateBirthdayCalendars.php', |
|
252 | - 'OCA\\DAV\\Migration\\RegisterBuildReminderIndexBackgroundJob' => $baseDir . '/../lib/Migration/RegisterBuildReminderIndexBackgroundJob.php', |
|
253 | - 'OCA\\DAV\\Migration\\RemoveClassifiedEventActivity' => $baseDir . '/../lib/Migration/RemoveClassifiedEventActivity.php', |
|
254 | - 'OCA\\DAV\\Migration\\RemoveDeletedUsersCalendarSubscriptions' => $baseDir . '/../lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php', |
|
255 | - 'OCA\\DAV\\Migration\\RemoveOrphanEventsAndContacts' => $baseDir . '/../lib/Migration/RemoveOrphanEventsAndContacts.php', |
|
256 | - 'OCA\\DAV\\Migration\\Version1004Date20170825134824' => $baseDir . '/../lib/Migration/Version1004Date20170825134824.php', |
|
257 | - 'OCA\\DAV\\Migration\\Version1004Date20170919104507' => $baseDir . '/../lib/Migration/Version1004Date20170919104507.php', |
|
258 | - 'OCA\\DAV\\Migration\\Version1004Date20170924124212' => $baseDir . '/../lib/Migration/Version1004Date20170924124212.php', |
|
259 | - 'OCA\\DAV\\Migration\\Version1004Date20170926103422' => $baseDir . '/../lib/Migration/Version1004Date20170926103422.php', |
|
260 | - 'OCA\\DAV\\Migration\\Version1005Date20180413093149' => $baseDir . '/../lib/Migration/Version1005Date20180413093149.php', |
|
261 | - 'OCA\\DAV\\Migration\\Version1005Date20180530124431' => $baseDir . '/../lib/Migration/Version1005Date20180530124431.php', |
|
262 | - 'OCA\\DAV\\Migration\\Version1006Date20180619154313' => $baseDir . '/../lib/Migration/Version1006Date20180619154313.php', |
|
263 | - 'OCA\\DAV\\Migration\\Version1006Date20180628111625' => $baseDir . '/../lib/Migration/Version1006Date20180628111625.php', |
|
264 | - 'OCA\\DAV\\Migration\\Version1008Date20181030113700' => $baseDir . '/../lib/Migration/Version1008Date20181030113700.php', |
|
265 | - 'OCA\\DAV\\Migration\\Version1008Date20181105104826' => $baseDir . '/../lib/Migration/Version1008Date20181105104826.php', |
|
266 | - 'OCA\\DAV\\Migration\\Version1008Date20181105104833' => $baseDir . '/../lib/Migration/Version1008Date20181105104833.php', |
|
267 | - 'OCA\\DAV\\Migration\\Version1008Date20181105110300' => $baseDir . '/../lib/Migration/Version1008Date20181105110300.php', |
|
268 | - 'OCA\\DAV\\Migration\\Version1008Date20181105112049' => $baseDir . '/../lib/Migration/Version1008Date20181105112049.php', |
|
269 | - 'OCA\\DAV\\Migration\\Version1008Date20181114084440' => $baseDir . '/../lib/Migration/Version1008Date20181114084440.php', |
|
270 | - 'OCA\\DAV\\Migration\\Version1011Date20190725113607' => $baseDir . '/../lib/Migration/Version1011Date20190725113607.php', |
|
271 | - 'OCA\\DAV\\Migration\\Version1011Date20190806104428' => $baseDir . '/../lib/Migration/Version1011Date20190806104428.php', |
|
272 | - 'OCA\\DAV\\Migration\\Version1012Date20190808122342' => $baseDir . '/../lib/Migration/Version1012Date20190808122342.php', |
|
273 | - 'OCA\\DAV\\Migration\\Version1016Date20201109085907' => $baseDir . '/../lib/Migration/Version1016Date20201109085907.php', |
|
274 | - 'OCA\\DAV\\Migration\\Version1017Date20210216083742' => $baseDir . '/../lib/Migration/Version1017Date20210216083742.php', |
|
275 | - 'OCA\\DAV\\Migration\\Version1018Date20210312100735' => $baseDir . '/../lib/Migration/Version1018Date20210312100735.php', |
|
276 | - 'OCA\\DAV\\Profiler\\ProfilerPlugin' => $baseDir . '/../lib/Profiler/ProfilerPlugin.php', |
|
277 | - 'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningNode' => $baseDir . '/../lib/Provisioning/Apple/AppleProvisioningNode.php', |
|
278 | - 'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningPlugin' => $baseDir . '/../lib/Provisioning/Apple/AppleProvisioningPlugin.php', |
|
279 | - 'OCA\\DAV\\RootCollection' => $baseDir . '/../lib/RootCollection.php', |
|
280 | - 'OCA\\DAV\\Search\\ACalendarSearchProvider' => $baseDir . '/../lib/Search/ACalendarSearchProvider.php', |
|
281 | - 'OCA\\DAV\\Search\\ContactsSearchProvider' => $baseDir . '/../lib/Search/ContactsSearchProvider.php', |
|
282 | - 'OCA\\DAV\\Search\\EventsSearchProvider' => $baseDir . '/../lib/Search/EventsSearchProvider.php', |
|
283 | - 'OCA\\DAV\\Search\\TasksSearchProvider' => $baseDir . '/../lib/Search/TasksSearchProvider.php', |
|
284 | - 'OCA\\DAV\\Server' => $baseDir . '/../lib/Server.php', |
|
285 | - 'OCA\\DAV\\Settings\\AvailabilitySettings' => $baseDir . '/../lib/Settings/AvailabilitySettings.php', |
|
286 | - 'OCA\\DAV\\Settings\\CalDAVSettings' => $baseDir . '/../lib/Settings/CalDAVSettings.php', |
|
287 | - 'OCA\\DAV\\Storage\\PublicOwnerWrapper' => $baseDir . '/../lib/Storage/PublicOwnerWrapper.php', |
|
288 | - 'OCA\\DAV\\SystemTag\\SystemTagMappingNode' => $baseDir . '/../lib/SystemTag/SystemTagMappingNode.php', |
|
289 | - 'OCA\\DAV\\SystemTag\\SystemTagNode' => $baseDir . '/../lib/SystemTag/SystemTagNode.php', |
|
290 | - 'OCA\\DAV\\SystemTag\\SystemTagPlugin' => $baseDir . '/../lib/SystemTag/SystemTagPlugin.php', |
|
291 | - 'OCA\\DAV\\SystemTag\\SystemTagsByIdCollection' => $baseDir . '/../lib/SystemTag/SystemTagsByIdCollection.php', |
|
292 | - 'OCA\\DAV\\SystemTag\\SystemTagsObjectMappingCollection' => $baseDir . '/../lib/SystemTag/SystemTagsObjectMappingCollection.php', |
|
293 | - 'OCA\\DAV\\SystemTag\\SystemTagsObjectTypeCollection' => $baseDir . '/../lib/SystemTag/SystemTagsObjectTypeCollection.php', |
|
294 | - 'OCA\\DAV\\SystemTag\\SystemTagsRelationsCollection' => $baseDir . '/../lib/SystemTag/SystemTagsRelationsCollection.php', |
|
295 | - 'OCA\\DAV\\Traits\\PrincipalProxyTrait' => $baseDir . '/../lib/Traits/PrincipalProxyTrait.php', |
|
296 | - 'OCA\\DAV\\Upload\\AssemblyStream' => $baseDir . '/../lib/Upload/AssemblyStream.php', |
|
297 | - 'OCA\\DAV\\Upload\\ChunkingPlugin' => $baseDir . '/../lib/Upload/ChunkingPlugin.php', |
|
298 | - 'OCA\\DAV\\Upload\\CleanupService' => $baseDir . '/../lib/Upload/CleanupService.php', |
|
299 | - 'OCA\\DAV\\Upload\\FutureFile' => $baseDir . '/../lib/Upload/FutureFile.php', |
|
300 | - 'OCA\\DAV\\Upload\\RootCollection' => $baseDir . '/../lib/Upload/RootCollection.php', |
|
301 | - 'OCA\\DAV\\Upload\\UploadFile' => $baseDir . '/../lib/Upload/UploadFile.php', |
|
302 | - 'OCA\\DAV\\Upload\\UploadFolder' => $baseDir . '/../lib/Upload/UploadFolder.php', |
|
303 | - 'OCA\\DAV\\Upload\\UploadHome' => $baseDir . '/../lib/Upload/UploadHome.php', |
|
304 | - 'OCA\\DAV\\UserMigration\\CalendarMigrator' => $baseDir . '/../lib/UserMigration/CalendarMigrator.php', |
|
305 | - 'OCA\\DAV\\UserMigration\\CalendarMigratorException' => $baseDir . '/../lib/UserMigration/CalendarMigratorException.php', |
|
306 | - 'OCA\\DAV\\UserMigration\\InvalidCalendarException' => $baseDir . '/../lib/UserMigration/InvalidCalendarException.php', |
|
9 | + 'Composer\\InstalledVersions' => $vendorDir.'/composer/InstalledVersions.php', |
|
10 | + 'OCA\\DAV\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php', |
|
11 | + 'OCA\\DAV\\AppInfo\\PluginManager' => $baseDir.'/../lib/AppInfo/PluginManager.php', |
|
12 | + 'OCA\\DAV\\Avatars\\AvatarHome' => $baseDir.'/../lib/Avatars/AvatarHome.php', |
|
13 | + 'OCA\\DAV\\Avatars\\AvatarNode' => $baseDir.'/../lib/Avatars/AvatarNode.php', |
|
14 | + 'OCA\\DAV\\Avatars\\RootCollection' => $baseDir.'/../lib/Avatars/RootCollection.php', |
|
15 | + 'OCA\\DAV\\BackgroundJob\\BuildReminderIndexBackgroundJob' => $baseDir.'/../lib/BackgroundJob/BuildReminderIndexBackgroundJob.php', |
|
16 | + 'OCA\\DAV\\BackgroundJob\\CalendarRetentionJob' => $baseDir.'/../lib/BackgroundJob/CalendarRetentionJob.php', |
|
17 | + 'OCA\\DAV\\BackgroundJob\\CleanupDirectLinksJob' => $baseDir.'/../lib/BackgroundJob/CleanupDirectLinksJob.php', |
|
18 | + 'OCA\\DAV\\BackgroundJob\\CleanupInvitationTokenJob' => $baseDir.'/../lib/BackgroundJob/CleanupInvitationTokenJob.php', |
|
19 | + 'OCA\\DAV\\BackgroundJob\\EventReminderJob' => $baseDir.'/../lib/BackgroundJob/EventReminderJob.php', |
|
20 | + 'OCA\\DAV\\BackgroundJob\\GenerateBirthdayCalendarBackgroundJob' => $baseDir.'/../lib/BackgroundJob/GenerateBirthdayCalendarBackgroundJob.php', |
|
21 | + 'OCA\\DAV\\BackgroundJob\\RefreshWebcalJob' => $baseDir.'/../lib/BackgroundJob/RefreshWebcalJob.php', |
|
22 | + 'OCA\\DAV\\BackgroundJob\\RegisterRegenerateBirthdayCalendars' => $baseDir.'/../lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php', |
|
23 | + 'OCA\\DAV\\BackgroundJob\\UpdateCalendarResourcesRoomsBackgroundJob' => $baseDir.'/../lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php', |
|
24 | + 'OCA\\DAV\\BackgroundJob\\UploadCleanup' => $baseDir.'/../lib/BackgroundJob/UploadCleanup.php', |
|
25 | + 'OCA\\DAV\\BulkUpload\\BulkUploadPlugin' => $baseDir.'/../lib/BulkUpload/BulkUploadPlugin.php', |
|
26 | + 'OCA\\DAV\\BulkUpload\\MultipartRequestParser' => $baseDir.'/../lib/BulkUpload/MultipartRequestParser.php', |
|
27 | + 'OCA\\DAV\\CalDAV\\Activity\\Backend' => $baseDir.'/../lib/CalDAV/Activity/Backend.php', |
|
28 | + 'OCA\\DAV\\CalDAV\\Activity\\Filter\\Calendar' => $baseDir.'/../lib/CalDAV/Activity/Filter/Calendar.php', |
|
29 | + 'OCA\\DAV\\CalDAV\\Activity\\Filter\\Todo' => $baseDir.'/../lib/CalDAV/Activity/Filter/Todo.php', |
|
30 | + 'OCA\\DAV\\CalDAV\\Activity\\Provider\\Base' => $baseDir.'/../lib/CalDAV/Activity/Provider/Base.php', |
|
31 | + 'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => $baseDir.'/../lib/CalDAV/Activity/Provider/Calendar.php', |
|
32 | + 'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => $baseDir.'/../lib/CalDAV/Activity/Provider/Event.php', |
|
33 | + 'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => $baseDir.'/../lib/CalDAV/Activity/Provider/Todo.php', |
|
34 | + 'OCA\\DAV\\CalDAV\\Activity\\Setting\\CalDAVSetting' => $baseDir.'/../lib/CalDAV/Activity/Setting/CalDAVSetting.php', |
|
35 | + 'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => $baseDir.'/../lib/CalDAV/Activity/Setting/Calendar.php', |
|
36 | + 'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => $baseDir.'/../lib/CalDAV/Activity/Setting/Event.php', |
|
37 | + 'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => $baseDir.'/../lib/CalDAV/Activity/Setting/Todo.php', |
|
38 | + 'OCA\\DAV\\CalDAV\\Auth\\CustomPrincipalPlugin' => $baseDir.'/../lib/CalDAV/Auth/CustomPrincipalPlugin.php', |
|
39 | + 'OCA\\DAV\\CalDAV\\Auth\\PublicPrincipalPlugin' => $baseDir.'/../lib/CalDAV/Auth/PublicPrincipalPlugin.php', |
|
40 | + 'OCA\\DAV\\CalDAV\\BirthdayCalendar\\EnablePlugin' => $baseDir.'/../lib/CalDAV/BirthdayCalendar/EnablePlugin.php', |
|
41 | + 'OCA\\DAV\\CalDAV\\BirthdayService' => $baseDir.'/../lib/CalDAV/BirthdayService.php', |
|
42 | + 'OCA\\DAV\\CalDAV\\CachedSubscription' => $baseDir.'/../lib/CalDAV/CachedSubscription.php', |
|
43 | + 'OCA\\DAV\\CalDAV\\CachedSubscriptionObject' => $baseDir.'/../lib/CalDAV/CachedSubscriptionObject.php', |
|
44 | + 'OCA\\DAV\\CalDAV\\CalDavBackend' => $baseDir.'/../lib/CalDAV/CalDavBackend.php', |
|
45 | + 'OCA\\DAV\\CalDAV\\Calendar' => $baseDir.'/../lib/CalDAV/Calendar.php', |
|
46 | + 'OCA\\DAV\\CalDAV\\CalendarHome' => $baseDir.'/../lib/CalDAV/CalendarHome.php', |
|
47 | + 'OCA\\DAV\\CalDAV\\CalendarImpl' => $baseDir.'/../lib/CalDAV/CalendarImpl.php', |
|
48 | + 'OCA\\DAV\\CalDAV\\CalendarManager' => $baseDir.'/../lib/CalDAV/CalendarManager.php', |
|
49 | + 'OCA\\DAV\\CalDAV\\CalendarObject' => $baseDir.'/../lib/CalDAV/CalendarObject.php', |
|
50 | + 'OCA\\DAV\\CalDAV\\CalendarProvider' => $baseDir.'/../lib/CalDAV/CalendarProvider.php', |
|
51 | + 'OCA\\DAV\\CalDAV\\CalendarRoot' => $baseDir.'/../lib/CalDAV/CalendarRoot.php', |
|
52 | + 'OCA\\DAV\\CalDAV\\ICSExportPlugin\\ICSExportPlugin' => $baseDir.'/../lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php', |
|
53 | + 'OCA\\DAV\\CalDAV\\IRestorable' => $baseDir.'/../lib/CalDAV/IRestorable.php', |
|
54 | + 'OCA\\DAV\\CalDAV\\Integration\\ExternalCalendar' => $baseDir.'/../lib/CalDAV/Integration/ExternalCalendar.php', |
|
55 | + 'OCA\\DAV\\CalDAV\\Integration\\ICalendarProvider' => $baseDir.'/../lib/CalDAV/Integration/ICalendarProvider.php', |
|
56 | + 'OCA\\DAV\\CalDAV\\InvitationResponse\\InvitationResponseServer' => $baseDir.'/../lib/CalDAV/InvitationResponse/InvitationResponseServer.php', |
|
57 | + 'OCA\\DAV\\CalDAV\\Outbox' => $baseDir.'/../lib/CalDAV/Outbox.php', |
|
58 | + 'OCA\\DAV\\CalDAV\\Plugin' => $baseDir.'/../lib/CalDAV/Plugin.php', |
|
59 | + 'OCA\\DAV\\CalDAV\\Principal\\Collection' => $baseDir.'/../lib/CalDAV/Principal/Collection.php', |
|
60 | + 'OCA\\DAV\\CalDAV\\Principal\\User' => $baseDir.'/../lib/CalDAV/Principal/User.php', |
|
61 | + 'OCA\\DAV\\CalDAV\\Proxy\\Proxy' => $baseDir.'/../lib/CalDAV/Proxy/Proxy.php', |
|
62 | + 'OCA\\DAV\\CalDAV\\Proxy\\ProxyMapper' => $baseDir.'/../lib/CalDAV/Proxy/ProxyMapper.php', |
|
63 | + 'OCA\\DAV\\CalDAV\\PublicCalendar' => $baseDir.'/../lib/CalDAV/PublicCalendar.php', |
|
64 | + 'OCA\\DAV\\CalDAV\\PublicCalendarObject' => $baseDir.'/../lib/CalDAV/PublicCalendarObject.php', |
|
65 | + 'OCA\\DAV\\CalDAV\\PublicCalendarRoot' => $baseDir.'/../lib/CalDAV/PublicCalendarRoot.php', |
|
66 | + 'OCA\\DAV\\CalDAV\\Publishing\\PublishPlugin' => $baseDir.'/../lib/CalDAV/Publishing/PublishPlugin.php', |
|
67 | + 'OCA\\DAV\\CalDAV\\Publishing\\Xml\\Publisher' => $baseDir.'/../lib/CalDAV/Publishing/Xml/Publisher.php', |
|
68 | + 'OCA\\DAV\\CalDAV\\Reminder\\Backend' => $baseDir.'/../lib/CalDAV/Reminder/Backend.php', |
|
69 | + 'OCA\\DAV\\CalDAV\\Reminder\\INotificationProvider' => $baseDir.'/../lib/CalDAV/Reminder/INotificationProvider.php', |
|
70 | + 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProviderManager' => $baseDir.'/../lib/CalDAV/Reminder/NotificationProviderManager.php', |
|
71 | + 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\AbstractProvider' => $baseDir.'/../lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php', |
|
72 | + 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\AudioProvider' => $baseDir.'/../lib/CalDAV/Reminder/NotificationProvider/AudioProvider.php', |
|
73 | + 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\EmailProvider' => $baseDir.'/../lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php', |
|
74 | + 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\ProviderNotAvailableException' => $baseDir.'/../lib/CalDAV/Reminder/NotificationProvider/ProviderNotAvailableException.php', |
|
75 | + 'OCA\\DAV\\CalDAV\\Reminder\\NotificationProvider\\PushProvider' => $baseDir.'/../lib/CalDAV/Reminder/NotificationProvider/PushProvider.php', |
|
76 | + 'OCA\\DAV\\CalDAV\\Reminder\\NotificationTypeDoesNotExistException' => $baseDir.'/../lib/CalDAV/Reminder/NotificationTypeDoesNotExistException.php', |
|
77 | + 'OCA\\DAV\\CalDAV\\Reminder\\Notifier' => $baseDir.'/../lib/CalDAV/Reminder/Notifier.php', |
|
78 | + 'OCA\\DAV\\CalDAV\\Reminder\\ReminderService' => $baseDir.'/../lib/CalDAV/Reminder/ReminderService.php', |
|
79 | + 'OCA\\DAV\\CalDAV\\ResourceBooking\\AbstractPrincipalBackend' => $baseDir.'/../lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php', |
|
80 | + 'OCA\\DAV\\CalDAV\\ResourceBooking\\ResourcePrincipalBackend' => $baseDir.'/../lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php', |
|
81 | + 'OCA\\DAV\\CalDAV\\ResourceBooking\\RoomPrincipalBackend' => $baseDir.'/../lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php', |
|
82 | + 'OCA\\DAV\\CalDAV\\RetentionService' => $baseDir.'/../lib/CalDAV/RetentionService.php', |
|
83 | + 'OCA\\DAV\\CalDAV\\Schedule\\IMipPlugin' => $baseDir.'/../lib/CalDAV/Schedule/IMipPlugin.php', |
|
84 | + 'OCA\\DAV\\CalDAV\\Schedule\\Plugin' => $baseDir.'/../lib/CalDAV/Schedule/Plugin.php', |
|
85 | + 'OCA\\DAV\\CalDAV\\Search\\SearchPlugin' => $baseDir.'/../lib/CalDAV/Search/SearchPlugin.php', |
|
86 | + 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\CompFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/CompFilter.php', |
|
87 | + 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\LimitFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/LimitFilter.php', |
|
88 | + 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\OffsetFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/OffsetFilter.php', |
|
89 | + 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\ParamFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/ParamFilter.php', |
|
90 | + 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\PropFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/PropFilter.php', |
|
91 | + 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\SearchTermFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php', |
|
92 | + 'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport' => $baseDir.'/../lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php', |
|
93 | + 'OCA\\DAV\\CalDAV\\Trashbin\\DeletedCalendarObject' => $baseDir.'/../lib/CalDAV/Trashbin/DeletedCalendarObject.php', |
|
94 | + 'OCA\\DAV\\CalDAV\\Trashbin\\DeletedCalendarObjectsCollection' => $baseDir.'/../lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php', |
|
95 | + 'OCA\\DAV\\CalDAV\\Trashbin\\Plugin' => $baseDir.'/../lib/CalDAV/Trashbin/Plugin.php', |
|
96 | + 'OCA\\DAV\\CalDAV\\Trashbin\\RestoreTarget' => $baseDir.'/../lib/CalDAV/Trashbin/RestoreTarget.php', |
|
97 | + 'OCA\\DAV\\CalDAV\\Trashbin\\TrashbinHome' => $baseDir.'/../lib/CalDAV/Trashbin/TrashbinHome.php', |
|
98 | + 'OCA\\DAV\\CalDAV\\WebcalCaching\\Plugin' => $baseDir.'/../lib/CalDAV/WebcalCaching/Plugin.php', |
|
99 | + 'OCA\\DAV\\CalDAV\\WebcalCaching\\RefreshWebcalService' => $baseDir.'/../lib/CalDAV/WebcalCaching/RefreshWebcalService.php', |
|
100 | + 'OCA\\DAV\\Capabilities' => $baseDir.'/../lib/Capabilities.php', |
|
101 | + 'OCA\\DAV\\CardDAV\\Activity\\Backend' => $baseDir.'/../lib/CardDAV/Activity/Backend.php', |
|
102 | + 'OCA\\DAV\\CardDAV\\Activity\\Filter' => $baseDir.'/../lib/CardDAV/Activity/Filter.php', |
|
103 | + 'OCA\\DAV\\CardDAV\\Activity\\Provider\\Addressbook' => $baseDir.'/../lib/CardDAV/Activity/Provider/Addressbook.php', |
|
104 | + 'OCA\\DAV\\CardDAV\\Activity\\Provider\\Base' => $baseDir.'/../lib/CardDAV/Activity/Provider/Base.php', |
|
105 | + 'OCA\\DAV\\CardDAV\\Activity\\Provider\\Card' => $baseDir.'/../lib/CardDAV/Activity/Provider/Card.php', |
|
106 | + 'OCA\\DAV\\CardDAV\\Activity\\Setting' => $baseDir.'/../lib/CardDAV/Activity/Setting.php', |
|
107 | + 'OCA\\DAV\\CardDAV\\AddressBook' => $baseDir.'/../lib/CardDAV/AddressBook.php', |
|
108 | + 'OCA\\DAV\\CardDAV\\AddressBookImpl' => $baseDir.'/../lib/CardDAV/AddressBookImpl.php', |
|
109 | + 'OCA\\DAV\\CardDAV\\AddressBookRoot' => $baseDir.'/../lib/CardDAV/AddressBookRoot.php', |
|
110 | + 'OCA\\DAV\\CardDAV\\CardDavBackend' => $baseDir.'/../lib/CardDAV/CardDavBackend.php', |
|
111 | + 'OCA\\DAV\\CardDAV\\ContactsManager' => $baseDir.'/../lib/CardDAV/ContactsManager.php', |
|
112 | + 'OCA\\DAV\\CardDAV\\Converter' => $baseDir.'/../lib/CardDAV/Converter.php', |
|
113 | + 'OCA\\DAV\\CardDAV\\HasPhotoPlugin' => $baseDir.'/../lib/CardDAV/HasPhotoPlugin.php', |
|
114 | + 'OCA\\DAV\\CardDAV\\ImageExportPlugin' => $baseDir.'/../lib/CardDAV/ImageExportPlugin.php', |
|
115 | + 'OCA\\DAV\\CardDAV\\Integration\\ExternalAddressBook' => $baseDir.'/../lib/CardDAV/Integration/ExternalAddressBook.php', |
|
116 | + 'OCA\\DAV\\CardDAV\\Integration\\IAddressBookProvider' => $baseDir.'/../lib/CardDAV/Integration/IAddressBookProvider.php', |
|
117 | + 'OCA\\DAV\\CardDAV\\MultiGetExportPlugin' => $baseDir.'/../lib/CardDAV/MultiGetExportPlugin.php', |
|
118 | + 'OCA\\DAV\\CardDAV\\PhotoCache' => $baseDir.'/../lib/CardDAV/PhotoCache.php', |
|
119 | + 'OCA\\DAV\\CardDAV\\Plugin' => $baseDir.'/../lib/CardDAV/Plugin.php', |
|
120 | + 'OCA\\DAV\\CardDAV\\SyncService' => $baseDir.'/../lib/CardDAV/SyncService.php', |
|
121 | + 'OCA\\DAV\\CardDAV\\SystemAddressbook' => $baseDir.'/../lib/CardDAV/SystemAddressbook.php', |
|
122 | + 'OCA\\DAV\\CardDAV\\UserAddressBooks' => $baseDir.'/../lib/CardDAV/UserAddressBooks.php', |
|
123 | + 'OCA\\DAV\\CardDAV\\Xml\\Groups' => $baseDir.'/../lib/CardDAV/Xml/Groups.php', |
|
124 | + 'OCA\\DAV\\Command\\CreateAddressBook' => $baseDir.'/../lib/Command/CreateAddressBook.php', |
|
125 | + 'OCA\\DAV\\Command\\CreateCalendar' => $baseDir.'/../lib/Command/CreateCalendar.php', |
|
126 | + 'OCA\\DAV\\Command\\DeleteCalendar' => $baseDir.'/../lib/Command/DeleteCalendar.php', |
|
127 | + 'OCA\\DAV\\Command\\ListCalendars' => $baseDir.'/../lib/Command/ListCalendars.php', |
|
128 | + 'OCA\\DAV\\Command\\MoveCalendar' => $baseDir.'/../lib/Command/MoveCalendar.php', |
|
129 | + 'OCA\\DAV\\Command\\RemoveInvalidShares' => $baseDir.'/../lib/Command/RemoveInvalidShares.php', |
|
130 | + 'OCA\\DAV\\Command\\RetentionCleanupCommand' => $baseDir.'/../lib/Command/RetentionCleanupCommand.php', |
|
131 | + 'OCA\\DAV\\Command\\SendEventReminders' => $baseDir.'/../lib/Command/SendEventReminders.php', |
|
132 | + 'OCA\\DAV\\Command\\SyncBirthdayCalendar' => $baseDir.'/../lib/Command/SyncBirthdayCalendar.php', |
|
133 | + 'OCA\\DAV\\Command\\SyncSystemAddressBook' => $baseDir.'/../lib/Command/SyncSystemAddressBook.php', |
|
134 | + 'OCA\\DAV\\Comments\\CommentNode' => $baseDir.'/../lib/Comments/CommentNode.php', |
|
135 | + 'OCA\\DAV\\Comments\\CommentsPlugin' => $baseDir.'/../lib/Comments/CommentsPlugin.php', |
|
136 | + 'OCA\\DAV\\Comments\\EntityCollection' => $baseDir.'/../lib/Comments/EntityCollection.php', |
|
137 | + 'OCA\\DAV\\Comments\\EntityTypeCollection' => $baseDir.'/../lib/Comments/EntityTypeCollection.php', |
|
138 | + 'OCA\\DAV\\Comments\\RootCollection' => $baseDir.'/../lib/Comments/RootCollection.php', |
|
139 | + 'OCA\\DAV\\Connector\\LegacyDAVACL' => $baseDir.'/../lib/Connector/LegacyDAVACL.php', |
|
140 | + 'OCA\\DAV\\Connector\\PublicAuth' => $baseDir.'/../lib/Connector/PublicAuth.php', |
|
141 | + 'OCA\\DAV\\Connector\\Sabre\\AnonymousOptionsPlugin' => $baseDir.'/../lib/Connector/Sabre/AnonymousOptionsPlugin.php', |
|
142 | + 'OCA\\DAV\\Connector\\Sabre\\AppEnabledPlugin' => $baseDir.'/../lib/Connector/Sabre/AppEnabledPlugin.php', |
|
143 | + 'OCA\\DAV\\Connector\\Sabre\\Auth' => $baseDir.'/../lib/Connector/Sabre/Auth.php', |
|
144 | + 'OCA\\DAV\\Connector\\Sabre\\BearerAuth' => $baseDir.'/../lib/Connector/Sabre/BearerAuth.php', |
|
145 | + 'OCA\\DAV\\Connector\\Sabre\\BlockLegacyClientPlugin' => $baseDir.'/../lib/Connector/Sabre/BlockLegacyClientPlugin.php', |
|
146 | + 'OCA\\DAV\\Connector\\Sabre\\CachingTree' => $baseDir.'/../lib/Connector/Sabre/CachingTree.php', |
|
147 | + 'OCA\\DAV\\Connector\\Sabre\\ChecksumList' => $baseDir.'/../lib/Connector/Sabre/ChecksumList.php', |
|
148 | + 'OCA\\DAV\\Connector\\Sabre\\ChecksumUpdatePlugin' => $baseDir.'/../lib/Connector/Sabre/ChecksumUpdatePlugin.php', |
|
149 | + 'OCA\\DAV\\Connector\\Sabre\\CommentPropertiesPlugin' => $baseDir.'/../lib/Connector/Sabre/CommentPropertiesPlugin.php', |
|
150 | + 'OCA\\DAV\\Connector\\Sabre\\CopyEtagHeaderPlugin' => $baseDir.'/../lib/Connector/Sabre/CopyEtagHeaderPlugin.php', |
|
151 | + 'OCA\\DAV\\Connector\\Sabre\\DavAclPlugin' => $baseDir.'/../lib/Connector/Sabre/DavAclPlugin.php', |
|
152 | + 'OCA\\DAV\\Connector\\Sabre\\Directory' => $baseDir.'/../lib/Connector/Sabre/Directory.php', |
|
153 | + 'OCA\\DAV\\Connector\\Sabre\\DummyGetResponsePlugin' => $baseDir.'/../lib/Connector/Sabre/DummyGetResponsePlugin.php', |
|
154 | + 'OCA\\DAV\\Connector\\Sabre\\ExceptionLoggerPlugin' => $baseDir.'/../lib/Connector/Sabre/ExceptionLoggerPlugin.php', |
|
155 | + 'OCA\\DAV\\Connector\\Sabre\\Exception\\BadGateway' => $baseDir.'/../lib/Connector/Sabre/Exception/BadGateway.php', |
|
156 | + 'OCA\\DAV\\Connector\\Sabre\\Exception\\EntityTooLarge' => $baseDir.'/../lib/Connector/Sabre/Exception/EntityTooLarge.php', |
|
157 | + 'OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked' => $baseDir.'/../lib/Connector/Sabre/Exception/FileLocked.php', |
|
158 | + 'OCA\\DAV\\Connector\\Sabre\\Exception\\Forbidden' => $baseDir.'/../lib/Connector/Sabre/Exception/Forbidden.php', |
|
159 | + 'OCA\\DAV\\Connector\\Sabre\\Exception\\InvalidPath' => $baseDir.'/../lib/Connector/Sabre/Exception/InvalidPath.php', |
|
160 | + 'OCA\\DAV\\Connector\\Sabre\\Exception\\PasswordLoginForbidden' => $baseDir.'/../lib/Connector/Sabre/Exception/PasswordLoginForbidden.php', |
|
161 | + 'OCA\\DAV\\Connector\\Sabre\\Exception\\UnsupportedMediaType' => $baseDir.'/../lib/Connector/Sabre/Exception/UnsupportedMediaType.php', |
|
162 | + 'OCA\\DAV\\Connector\\Sabre\\FakeLockerPlugin' => $baseDir.'/../lib/Connector/Sabre/FakeLockerPlugin.php', |
|
163 | + 'OCA\\DAV\\Connector\\Sabre\\File' => $baseDir.'/../lib/Connector/Sabre/File.php', |
|
164 | + 'OCA\\DAV\\Connector\\Sabre\\FilesPlugin' => $baseDir.'/../lib/Connector/Sabre/FilesPlugin.php', |
|
165 | + 'OCA\\DAV\\Connector\\Sabre\\FilesReportPlugin' => $baseDir.'/../lib/Connector/Sabre/FilesReportPlugin.php', |
|
166 | + 'OCA\\DAV\\Connector\\Sabre\\LockPlugin' => $baseDir.'/../lib/Connector/Sabre/LockPlugin.php', |
|
167 | + 'OCA\\DAV\\Connector\\Sabre\\MaintenancePlugin' => $baseDir.'/../lib/Connector/Sabre/MaintenancePlugin.php', |
|
168 | + 'OCA\\DAV\\Connector\\Sabre\\MtimeSanitizer' => $baseDir.'/../lib/Connector/Sabre/MtimeSanitizer.php', |
|
169 | + 'OCA\\DAV\\Connector\\Sabre\\Node' => $baseDir.'/../lib/Connector/Sabre/Node.php', |
|
170 | + 'OCA\\DAV\\Connector\\Sabre\\ObjectTree' => $baseDir.'/../lib/Connector/Sabre/ObjectTree.php', |
|
171 | + 'OCA\\DAV\\Connector\\Sabre\\Principal' => $baseDir.'/../lib/Connector/Sabre/Principal.php', |
|
172 | + 'OCA\\DAV\\Connector\\Sabre\\PropfindCompressionPlugin' => $baseDir.'/../lib/Connector/Sabre/PropfindCompressionPlugin.php', |
|
173 | + 'OCA\\DAV\\Connector\\Sabre\\QuotaPlugin' => $baseDir.'/../lib/Connector/Sabre/QuotaPlugin.php', |
|
174 | + 'OCA\\DAV\\Connector\\Sabre\\RequestIdHeaderPlugin' => $baseDir.'/../lib/Connector/Sabre/RequestIdHeaderPlugin.php', |
|
175 | + 'OCA\\DAV\\Connector\\Sabre\\Server' => $baseDir.'/../lib/Connector/Sabre/Server.php', |
|
176 | + 'OCA\\DAV\\Connector\\Sabre\\ServerFactory' => $baseDir.'/../lib/Connector/Sabre/ServerFactory.php', |
|
177 | + 'OCA\\DAV\\Connector\\Sabre\\ShareTypeList' => $baseDir.'/../lib/Connector/Sabre/ShareTypeList.php', |
|
178 | + 'OCA\\DAV\\Connector\\Sabre\\ShareeList' => $baseDir.'/../lib/Connector/Sabre/ShareeList.php', |
|
179 | + 'OCA\\DAV\\Connector\\Sabre\\SharesPlugin' => $baseDir.'/../lib/Connector/Sabre/SharesPlugin.php', |
|
180 | + 'OCA\\DAV\\Connector\\Sabre\\TagList' => $baseDir.'/../lib/Connector/Sabre/TagList.php', |
|
181 | + 'OCA\\DAV\\Connector\\Sabre\\TagsPlugin' => $baseDir.'/../lib/Connector/Sabre/TagsPlugin.php', |
|
182 | + 'OCA\\DAV\\Controller\\BirthdayCalendarController' => $baseDir.'/../lib/Controller/BirthdayCalendarController.php', |
|
183 | + 'OCA\\DAV\\Controller\\DirectController' => $baseDir.'/../lib/Controller/DirectController.php', |
|
184 | + 'OCA\\DAV\\Controller\\InvitationResponseController' => $baseDir.'/../lib/Controller/InvitationResponseController.php', |
|
185 | + 'OCA\\DAV\\DAV\\CustomPropertiesBackend' => $baseDir.'/../lib/DAV/CustomPropertiesBackend.php', |
|
186 | + 'OCA\\DAV\\DAV\\GroupPrincipalBackend' => $baseDir.'/../lib/DAV/GroupPrincipalBackend.php', |
|
187 | + 'OCA\\DAV\\DAV\\PublicAuth' => $baseDir.'/../lib/DAV/PublicAuth.php', |
|
188 | + 'OCA\\DAV\\DAV\\Sharing\\Backend' => $baseDir.'/../lib/DAV/Sharing/Backend.php', |
|
189 | + 'OCA\\DAV\\DAV\\Sharing\\IShareable' => $baseDir.'/../lib/DAV/Sharing/IShareable.php', |
|
190 | + 'OCA\\DAV\\DAV\\Sharing\\Plugin' => $baseDir.'/../lib/DAV/Sharing/Plugin.php', |
|
191 | + 'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite' => $baseDir.'/../lib/DAV/Sharing/Xml/Invite.php', |
|
192 | + 'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest' => $baseDir.'/../lib/DAV/Sharing/Xml/ShareRequest.php', |
|
193 | + 'OCA\\DAV\\DAV\\SystemPrincipalBackend' => $baseDir.'/../lib/DAV/SystemPrincipalBackend.php', |
|
194 | + 'OCA\\DAV\\Db\\Direct' => $baseDir.'/../lib/Db/Direct.php', |
|
195 | + 'OCA\\DAV\\Db\\DirectMapper' => $baseDir.'/../lib/Db/DirectMapper.php', |
|
196 | + 'OCA\\DAV\\Direct\\DirectFile' => $baseDir.'/../lib/Direct/DirectFile.php', |
|
197 | + 'OCA\\DAV\\Direct\\DirectHome' => $baseDir.'/../lib/Direct/DirectHome.php', |
|
198 | + 'OCA\\DAV\\Direct\\Server' => $baseDir.'/../lib/Direct/Server.php', |
|
199 | + 'OCA\\DAV\\Direct\\ServerFactory' => $baseDir.'/../lib/Direct/ServerFactory.php', |
|
200 | + 'OCA\\DAV\\Events\\AddressBookCreatedEvent' => $baseDir.'/../lib/Events/AddressBookCreatedEvent.php', |
|
201 | + 'OCA\\DAV\\Events\\AddressBookDeletedEvent' => $baseDir.'/../lib/Events/AddressBookDeletedEvent.php', |
|
202 | + 'OCA\\DAV\\Events\\AddressBookShareUpdatedEvent' => $baseDir.'/../lib/Events/AddressBookShareUpdatedEvent.php', |
|
203 | + 'OCA\\DAV\\Events\\AddressBookUpdatedEvent' => $baseDir.'/../lib/Events/AddressBookUpdatedEvent.php', |
|
204 | + 'OCA\\DAV\\Events\\BeforeFileDirectDownloadedEvent' => $baseDir.'/../lib/Events/BeforeFileDirectDownloadedEvent.php', |
|
205 | + 'OCA\\DAV\\Events\\CachedCalendarObjectCreatedEvent' => $baseDir.'/../lib/Events/CachedCalendarObjectCreatedEvent.php', |
|
206 | + 'OCA\\DAV\\Events\\CachedCalendarObjectDeletedEvent' => $baseDir.'/../lib/Events/CachedCalendarObjectDeletedEvent.php', |
|
207 | + 'OCA\\DAV\\Events\\CachedCalendarObjectUpdatedEvent' => $baseDir.'/../lib/Events/CachedCalendarObjectUpdatedEvent.php', |
|
208 | + 'OCA\\DAV\\Events\\CalendarCreatedEvent' => $baseDir.'/../lib/Events/CalendarCreatedEvent.php', |
|
209 | + 'OCA\\DAV\\Events\\CalendarDeletedEvent' => $baseDir.'/../lib/Events/CalendarDeletedEvent.php', |
|
210 | + 'OCA\\DAV\\Events\\CalendarMovedToTrashEvent' => $baseDir.'/../lib/Events/CalendarMovedToTrashEvent.php', |
|
211 | + 'OCA\\DAV\\Events\\CalendarObjectCreatedEvent' => $baseDir.'/../lib/Events/CalendarObjectCreatedEvent.php', |
|
212 | + 'OCA\\DAV\\Events\\CalendarObjectDeletedEvent' => $baseDir.'/../lib/Events/CalendarObjectDeletedEvent.php', |
|
213 | + 'OCA\\DAV\\Events\\CalendarObjectMovedToTrashEvent' => $baseDir.'/../lib/Events/CalendarObjectMovedToTrashEvent.php', |
|
214 | + 'OCA\\DAV\\Events\\CalendarObjectRestoredEvent' => $baseDir.'/../lib/Events/CalendarObjectRestoredEvent.php', |
|
215 | + 'OCA\\DAV\\Events\\CalendarObjectUpdatedEvent' => $baseDir.'/../lib/Events/CalendarObjectUpdatedEvent.php', |
|
216 | + 'OCA\\DAV\\Events\\CalendarPublishedEvent' => $baseDir.'/../lib/Events/CalendarPublishedEvent.php', |
|
217 | + 'OCA\\DAV\\Events\\CalendarRestoredEvent' => $baseDir.'/../lib/Events/CalendarRestoredEvent.php', |
|
218 | + 'OCA\\DAV\\Events\\CalendarShareUpdatedEvent' => $baseDir.'/../lib/Events/CalendarShareUpdatedEvent.php', |
|
219 | + 'OCA\\DAV\\Events\\CalendarUnpublishedEvent' => $baseDir.'/../lib/Events/CalendarUnpublishedEvent.php', |
|
220 | + 'OCA\\DAV\\Events\\CalendarUpdatedEvent' => $baseDir.'/../lib/Events/CalendarUpdatedEvent.php', |
|
221 | + 'OCA\\DAV\\Events\\CardCreatedEvent' => $baseDir.'/../lib/Events/CardCreatedEvent.php', |
|
222 | + 'OCA\\DAV\\Events\\CardDeletedEvent' => $baseDir.'/../lib/Events/CardDeletedEvent.php', |
|
223 | + 'OCA\\DAV\\Events\\CardUpdatedEvent' => $baseDir.'/../lib/Events/CardUpdatedEvent.php', |
|
224 | + 'OCA\\DAV\\Events\\SabrePluginAuthInitEvent' => $baseDir.'/../lib/Events/SabrePluginAuthInitEvent.php', |
|
225 | + 'OCA\\DAV\\Events\\SubscriptionCreatedEvent' => $baseDir.'/../lib/Events/SubscriptionCreatedEvent.php', |
|
226 | + 'OCA\\DAV\\Events\\SubscriptionDeletedEvent' => $baseDir.'/../lib/Events/SubscriptionDeletedEvent.php', |
|
227 | + 'OCA\\DAV\\Events\\SubscriptionUpdatedEvent' => $baseDir.'/../lib/Events/SubscriptionUpdatedEvent.php', |
|
228 | + 'OCA\\DAV\\Exception\\UnsupportedLimitOnInitialSyncException' => $baseDir.'/../lib/Exception/UnsupportedLimitOnInitialSyncException.php', |
|
229 | + 'OCA\\DAV\\Files\\BrowserErrorPagePlugin' => $baseDir.'/../lib/Files/BrowserErrorPagePlugin.php', |
|
230 | + 'OCA\\DAV\\Files\\FileSearchBackend' => $baseDir.'/../lib/Files/FileSearchBackend.php', |
|
231 | + 'OCA\\DAV\\Files\\FilesHome' => $baseDir.'/../lib/Files/FilesHome.php', |
|
232 | + 'OCA\\DAV\\Files\\LazySearchBackend' => $baseDir.'/../lib/Files/LazySearchBackend.php', |
|
233 | + 'OCA\\DAV\\Files\\RootCollection' => $baseDir.'/../lib/Files/RootCollection.php', |
|
234 | + 'OCA\\DAV\\Files\\Sharing\\FilesDropPlugin' => $baseDir.'/../lib/Files/Sharing/FilesDropPlugin.php', |
|
235 | + 'OCA\\DAV\\Files\\Sharing\\PublicLinkCheckPlugin' => $baseDir.'/../lib/Files/Sharing/PublicLinkCheckPlugin.php', |
|
236 | + 'OCA\\DAV\\HookManager' => $baseDir.'/../lib/HookManager.php', |
|
237 | + 'OCA\\DAV\\Listener\\ActivityUpdaterListener' => $baseDir.'/../lib/Listener/ActivityUpdaterListener.php', |
|
238 | + 'OCA\\DAV\\Listener\\AddressbookListener' => $baseDir.'/../lib/Listener/AddressbookListener.php', |
|
239 | + 'OCA\\DAV\\Listener\\CalendarContactInteractionListener' => $baseDir.'/../lib/Listener/CalendarContactInteractionListener.php', |
|
240 | + 'OCA\\DAV\\Listener\\CalendarDeletionDefaultUpdaterListener' => $baseDir.'/../lib/Listener/CalendarDeletionDefaultUpdaterListener.php', |
|
241 | + 'OCA\\DAV\\Listener\\CalendarObjectReminderUpdaterListener' => $baseDir.'/../lib/Listener/CalendarObjectReminderUpdaterListener.php', |
|
242 | + 'OCA\\DAV\\Listener\\CardListener' => $baseDir.'/../lib/Listener/CardListener.php', |
|
243 | + 'OCA\\DAV\\Migration\\BuildCalendarSearchIndex' => $baseDir.'/../lib/Migration/BuildCalendarSearchIndex.php', |
|
244 | + 'OCA\\DAV\\Migration\\BuildCalendarSearchIndexBackgroundJob' => $baseDir.'/../lib/Migration/BuildCalendarSearchIndexBackgroundJob.php', |
|
245 | + 'OCA\\DAV\\Migration\\BuildSocialSearchIndex' => $baseDir.'/../lib/Migration/BuildSocialSearchIndex.php', |
|
246 | + 'OCA\\DAV\\Migration\\BuildSocialSearchIndexBackgroundJob' => $baseDir.'/../lib/Migration/BuildSocialSearchIndexBackgroundJob.php', |
|
247 | + 'OCA\\DAV\\Migration\\CalDAVRemoveEmptyValue' => $baseDir.'/../lib/Migration/CalDAVRemoveEmptyValue.php', |
|
248 | + 'OCA\\DAV\\Migration\\ChunkCleanup' => $baseDir.'/../lib/Migration/ChunkCleanup.php', |
|
249 | + 'OCA\\DAV\\Migration\\FixBirthdayCalendarComponent' => $baseDir.'/../lib/Migration/FixBirthdayCalendarComponent.php', |
|
250 | + 'OCA\\DAV\\Migration\\RefreshWebcalJobRegistrar' => $baseDir.'/../lib/Migration/RefreshWebcalJobRegistrar.php', |
|
251 | + 'OCA\\DAV\\Migration\\RegenerateBirthdayCalendars' => $baseDir.'/../lib/Migration/RegenerateBirthdayCalendars.php', |
|
252 | + 'OCA\\DAV\\Migration\\RegisterBuildReminderIndexBackgroundJob' => $baseDir.'/../lib/Migration/RegisterBuildReminderIndexBackgroundJob.php', |
|
253 | + 'OCA\\DAV\\Migration\\RemoveClassifiedEventActivity' => $baseDir.'/../lib/Migration/RemoveClassifiedEventActivity.php', |
|
254 | + 'OCA\\DAV\\Migration\\RemoveDeletedUsersCalendarSubscriptions' => $baseDir.'/../lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php', |
|
255 | + 'OCA\\DAV\\Migration\\RemoveOrphanEventsAndContacts' => $baseDir.'/../lib/Migration/RemoveOrphanEventsAndContacts.php', |
|
256 | + 'OCA\\DAV\\Migration\\Version1004Date20170825134824' => $baseDir.'/../lib/Migration/Version1004Date20170825134824.php', |
|
257 | + 'OCA\\DAV\\Migration\\Version1004Date20170919104507' => $baseDir.'/../lib/Migration/Version1004Date20170919104507.php', |
|
258 | + 'OCA\\DAV\\Migration\\Version1004Date20170924124212' => $baseDir.'/../lib/Migration/Version1004Date20170924124212.php', |
|
259 | + 'OCA\\DAV\\Migration\\Version1004Date20170926103422' => $baseDir.'/../lib/Migration/Version1004Date20170926103422.php', |
|
260 | + 'OCA\\DAV\\Migration\\Version1005Date20180413093149' => $baseDir.'/../lib/Migration/Version1005Date20180413093149.php', |
|
261 | + 'OCA\\DAV\\Migration\\Version1005Date20180530124431' => $baseDir.'/../lib/Migration/Version1005Date20180530124431.php', |
|
262 | + 'OCA\\DAV\\Migration\\Version1006Date20180619154313' => $baseDir.'/../lib/Migration/Version1006Date20180619154313.php', |
|
263 | + 'OCA\\DAV\\Migration\\Version1006Date20180628111625' => $baseDir.'/../lib/Migration/Version1006Date20180628111625.php', |
|
264 | + 'OCA\\DAV\\Migration\\Version1008Date20181030113700' => $baseDir.'/../lib/Migration/Version1008Date20181030113700.php', |
|
265 | + 'OCA\\DAV\\Migration\\Version1008Date20181105104826' => $baseDir.'/../lib/Migration/Version1008Date20181105104826.php', |
|
266 | + 'OCA\\DAV\\Migration\\Version1008Date20181105104833' => $baseDir.'/../lib/Migration/Version1008Date20181105104833.php', |
|
267 | + 'OCA\\DAV\\Migration\\Version1008Date20181105110300' => $baseDir.'/../lib/Migration/Version1008Date20181105110300.php', |
|
268 | + 'OCA\\DAV\\Migration\\Version1008Date20181105112049' => $baseDir.'/../lib/Migration/Version1008Date20181105112049.php', |
|
269 | + 'OCA\\DAV\\Migration\\Version1008Date20181114084440' => $baseDir.'/../lib/Migration/Version1008Date20181114084440.php', |
|
270 | + 'OCA\\DAV\\Migration\\Version1011Date20190725113607' => $baseDir.'/../lib/Migration/Version1011Date20190725113607.php', |
|
271 | + 'OCA\\DAV\\Migration\\Version1011Date20190806104428' => $baseDir.'/../lib/Migration/Version1011Date20190806104428.php', |
|
272 | + 'OCA\\DAV\\Migration\\Version1012Date20190808122342' => $baseDir.'/../lib/Migration/Version1012Date20190808122342.php', |
|
273 | + 'OCA\\DAV\\Migration\\Version1016Date20201109085907' => $baseDir.'/../lib/Migration/Version1016Date20201109085907.php', |
|
274 | + 'OCA\\DAV\\Migration\\Version1017Date20210216083742' => $baseDir.'/../lib/Migration/Version1017Date20210216083742.php', |
|
275 | + 'OCA\\DAV\\Migration\\Version1018Date20210312100735' => $baseDir.'/../lib/Migration/Version1018Date20210312100735.php', |
|
276 | + 'OCA\\DAV\\Profiler\\ProfilerPlugin' => $baseDir.'/../lib/Profiler/ProfilerPlugin.php', |
|
277 | + 'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningNode' => $baseDir.'/../lib/Provisioning/Apple/AppleProvisioningNode.php', |
|
278 | + 'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningPlugin' => $baseDir.'/../lib/Provisioning/Apple/AppleProvisioningPlugin.php', |
|
279 | + 'OCA\\DAV\\RootCollection' => $baseDir.'/../lib/RootCollection.php', |
|
280 | + 'OCA\\DAV\\Search\\ACalendarSearchProvider' => $baseDir.'/../lib/Search/ACalendarSearchProvider.php', |
|
281 | + 'OCA\\DAV\\Search\\ContactsSearchProvider' => $baseDir.'/../lib/Search/ContactsSearchProvider.php', |
|
282 | + 'OCA\\DAV\\Search\\EventsSearchProvider' => $baseDir.'/../lib/Search/EventsSearchProvider.php', |
|
283 | + 'OCA\\DAV\\Search\\TasksSearchProvider' => $baseDir.'/../lib/Search/TasksSearchProvider.php', |
|
284 | + 'OCA\\DAV\\Server' => $baseDir.'/../lib/Server.php', |
|
285 | + 'OCA\\DAV\\Settings\\AvailabilitySettings' => $baseDir.'/../lib/Settings/AvailabilitySettings.php', |
|
286 | + 'OCA\\DAV\\Settings\\CalDAVSettings' => $baseDir.'/../lib/Settings/CalDAVSettings.php', |
|
287 | + 'OCA\\DAV\\Storage\\PublicOwnerWrapper' => $baseDir.'/../lib/Storage/PublicOwnerWrapper.php', |
|
288 | + 'OCA\\DAV\\SystemTag\\SystemTagMappingNode' => $baseDir.'/../lib/SystemTag/SystemTagMappingNode.php', |
|
289 | + 'OCA\\DAV\\SystemTag\\SystemTagNode' => $baseDir.'/../lib/SystemTag/SystemTagNode.php', |
|
290 | + 'OCA\\DAV\\SystemTag\\SystemTagPlugin' => $baseDir.'/../lib/SystemTag/SystemTagPlugin.php', |
|
291 | + 'OCA\\DAV\\SystemTag\\SystemTagsByIdCollection' => $baseDir.'/../lib/SystemTag/SystemTagsByIdCollection.php', |
|
292 | + 'OCA\\DAV\\SystemTag\\SystemTagsObjectMappingCollection' => $baseDir.'/../lib/SystemTag/SystemTagsObjectMappingCollection.php', |
|
293 | + 'OCA\\DAV\\SystemTag\\SystemTagsObjectTypeCollection' => $baseDir.'/../lib/SystemTag/SystemTagsObjectTypeCollection.php', |
|
294 | + 'OCA\\DAV\\SystemTag\\SystemTagsRelationsCollection' => $baseDir.'/../lib/SystemTag/SystemTagsRelationsCollection.php', |
|
295 | + 'OCA\\DAV\\Traits\\PrincipalProxyTrait' => $baseDir.'/../lib/Traits/PrincipalProxyTrait.php', |
|
296 | + 'OCA\\DAV\\Upload\\AssemblyStream' => $baseDir.'/../lib/Upload/AssemblyStream.php', |
|
297 | + 'OCA\\DAV\\Upload\\ChunkingPlugin' => $baseDir.'/../lib/Upload/ChunkingPlugin.php', |
|
298 | + 'OCA\\DAV\\Upload\\CleanupService' => $baseDir.'/../lib/Upload/CleanupService.php', |
|
299 | + 'OCA\\DAV\\Upload\\FutureFile' => $baseDir.'/../lib/Upload/FutureFile.php', |
|
300 | + 'OCA\\DAV\\Upload\\RootCollection' => $baseDir.'/../lib/Upload/RootCollection.php', |
|
301 | + 'OCA\\DAV\\Upload\\UploadFile' => $baseDir.'/../lib/Upload/UploadFile.php', |
|
302 | + 'OCA\\DAV\\Upload\\UploadFolder' => $baseDir.'/../lib/Upload/UploadFolder.php', |
|
303 | + 'OCA\\DAV\\Upload\\UploadHome' => $baseDir.'/../lib/Upload/UploadHome.php', |
|
304 | + 'OCA\\DAV\\UserMigration\\CalendarMigrator' => $baseDir.'/../lib/UserMigration/CalendarMigrator.php', |
|
305 | + 'OCA\\DAV\\UserMigration\\CalendarMigratorException' => $baseDir.'/../lib/UserMigration/CalendarMigratorException.php', |
|
306 | + 'OCA\\DAV\\UserMigration\\InvalidCalendarException' => $baseDir.'/../lib/UserMigration/InvalidCalendarException.php', |
|
307 | 307 | ); |
@@ -84,2122 +84,2122 @@ |
||
84 | 84 | * \OC\Files\Storage\Storage object |
85 | 85 | */ |
86 | 86 | class View { |
87 | - /** @var string */ |
|
88 | - private $fakeRoot = ''; |
|
89 | - |
|
90 | - /** |
|
91 | - * @var \OCP\Lock\ILockingProvider |
|
92 | - */ |
|
93 | - protected $lockingProvider; |
|
94 | - |
|
95 | - private $lockingEnabled; |
|
96 | - |
|
97 | - private $updaterEnabled = true; |
|
98 | - |
|
99 | - /** @var \OC\User\Manager */ |
|
100 | - private $userManager; |
|
101 | - |
|
102 | - /** @var \OCP\ILogger */ |
|
103 | - private $logger; |
|
104 | - |
|
105 | - /** |
|
106 | - * @param string $root |
|
107 | - * @throws \Exception If $root contains an invalid path |
|
108 | - */ |
|
109 | - public function __construct($root = '') { |
|
110 | - if (is_null($root)) { |
|
111 | - throw new \InvalidArgumentException('Root can\'t be null'); |
|
112 | - } |
|
113 | - if (!Filesystem::isValidPath($root)) { |
|
114 | - throw new \Exception(); |
|
115 | - } |
|
116 | - |
|
117 | - $this->fakeRoot = $root; |
|
118 | - $this->lockingProvider = \OC::$server->getLockingProvider(); |
|
119 | - $this->lockingEnabled = !($this->lockingProvider instanceof \OC\Lock\NoopLockingProvider); |
|
120 | - $this->userManager = \OC::$server->getUserManager(); |
|
121 | - $this->logger = \OC::$server->getLogger(); |
|
122 | - } |
|
123 | - |
|
124 | - public function getAbsolutePath($path = '/') { |
|
125 | - if ($path === null) { |
|
126 | - return null; |
|
127 | - } |
|
128 | - $this->assertPathLength($path); |
|
129 | - if ($path === '') { |
|
130 | - $path = '/'; |
|
131 | - } |
|
132 | - if ($path[0] !== '/') { |
|
133 | - $path = '/' . $path; |
|
134 | - } |
|
135 | - return $this->fakeRoot . $path; |
|
136 | - } |
|
137 | - |
|
138 | - /** |
|
139 | - * change the root to a fake root |
|
140 | - * |
|
141 | - * @param string $fakeRoot |
|
142 | - * @return boolean|null |
|
143 | - */ |
|
144 | - public function chroot($fakeRoot) { |
|
145 | - if (!$fakeRoot == '') { |
|
146 | - if ($fakeRoot[0] !== '/') { |
|
147 | - $fakeRoot = '/' . $fakeRoot; |
|
148 | - } |
|
149 | - } |
|
150 | - $this->fakeRoot = $fakeRoot; |
|
151 | - } |
|
152 | - |
|
153 | - /** |
|
154 | - * get the fake root |
|
155 | - * |
|
156 | - * @return string |
|
157 | - */ |
|
158 | - public function getRoot() { |
|
159 | - return $this->fakeRoot; |
|
160 | - } |
|
161 | - |
|
162 | - /** |
|
163 | - * get path relative to the root of the view |
|
164 | - * |
|
165 | - * @param string $path |
|
166 | - * @return string |
|
167 | - */ |
|
168 | - public function getRelativePath($path) { |
|
169 | - $this->assertPathLength($path); |
|
170 | - if ($this->fakeRoot == '') { |
|
171 | - return $path; |
|
172 | - } |
|
173 | - |
|
174 | - if (rtrim($path, '/') === rtrim($this->fakeRoot, '/')) { |
|
175 | - return '/'; |
|
176 | - } |
|
177 | - |
|
178 | - // missing slashes can cause wrong matches! |
|
179 | - $root = rtrim($this->fakeRoot, '/') . '/'; |
|
180 | - |
|
181 | - if (strpos($path, $root) !== 0) { |
|
182 | - return null; |
|
183 | - } else { |
|
184 | - $path = substr($path, strlen($this->fakeRoot)); |
|
185 | - if (strlen($path) === 0) { |
|
186 | - return '/'; |
|
187 | - } else { |
|
188 | - return $path; |
|
189 | - } |
|
190 | - } |
|
191 | - } |
|
192 | - |
|
193 | - /** |
|
194 | - * get the mountpoint of the storage object for a path |
|
195 | - * ( note: because a storage is not always mounted inside the fakeroot, the |
|
196 | - * returned mountpoint is relative to the absolute root of the filesystem |
|
197 | - * and does not take the chroot into account ) |
|
198 | - * |
|
199 | - * @param string $path |
|
200 | - * @return string |
|
201 | - */ |
|
202 | - public function getMountPoint($path) { |
|
203 | - return Filesystem::getMountPoint($this->getAbsolutePath($path)); |
|
204 | - } |
|
205 | - |
|
206 | - /** |
|
207 | - * get the mountpoint of the storage object for a path |
|
208 | - * ( note: because a storage is not always mounted inside the fakeroot, the |
|
209 | - * returned mountpoint is relative to the absolute root of the filesystem |
|
210 | - * and does not take the chroot into account ) |
|
211 | - * |
|
212 | - * @param string $path |
|
213 | - * @return \OCP\Files\Mount\IMountPoint |
|
214 | - */ |
|
215 | - public function getMount($path) { |
|
216 | - return Filesystem::getMountManager()->find($this->getAbsolutePath($path)); |
|
217 | - } |
|
218 | - |
|
219 | - /** |
|
220 | - * resolve a path to a storage and internal path |
|
221 | - * |
|
222 | - * @param string $path |
|
223 | - * @return array an array consisting of the storage and the internal path |
|
224 | - */ |
|
225 | - public function resolvePath($path) { |
|
226 | - $a = $this->getAbsolutePath($path); |
|
227 | - $p = Filesystem::normalizePath($a); |
|
228 | - return Filesystem::resolvePath($p); |
|
229 | - } |
|
230 | - |
|
231 | - /** |
|
232 | - * return the path to a local version of the file |
|
233 | - * we need this because we can't know if a file is stored local or not from |
|
234 | - * outside the filestorage and for some purposes a local file is needed |
|
235 | - * |
|
236 | - * @param string $path |
|
237 | - * @return string |
|
238 | - */ |
|
239 | - public function getLocalFile($path) { |
|
240 | - $parent = substr($path, 0, strrpos($path, '/')); |
|
241 | - $path = $this->getAbsolutePath($path); |
|
242 | - [$storage, $internalPath] = Filesystem::resolvePath($path); |
|
243 | - if (Filesystem::isValidPath($parent) and $storage) { |
|
244 | - return $storage->getLocalFile($internalPath); |
|
245 | - } else { |
|
246 | - return null; |
|
247 | - } |
|
248 | - } |
|
249 | - |
|
250 | - /** |
|
251 | - * @param string $path |
|
252 | - * @return string |
|
253 | - */ |
|
254 | - public function getLocalFolder($path) { |
|
255 | - $parent = substr($path, 0, strrpos($path, '/')); |
|
256 | - $path = $this->getAbsolutePath($path); |
|
257 | - [$storage, $internalPath] = Filesystem::resolvePath($path); |
|
258 | - if (Filesystem::isValidPath($parent) and $storage) { |
|
259 | - return $storage->getLocalFolder($internalPath); |
|
260 | - } else { |
|
261 | - return null; |
|
262 | - } |
|
263 | - } |
|
264 | - |
|
265 | - /** |
|
266 | - * the following functions operate with arguments and return values identical |
|
267 | - * to those of their PHP built-in equivalents. Mostly they are merely wrappers |
|
268 | - * for \OC\Files\Storage\Storage via basicOperation(). |
|
269 | - */ |
|
270 | - public function mkdir($path) { |
|
271 | - return $this->basicOperation('mkdir', $path, ['create', 'write']); |
|
272 | - } |
|
273 | - |
|
274 | - /** |
|
275 | - * remove mount point |
|
276 | - * |
|
277 | - * @param IMountPoint $mount |
|
278 | - * @param string $path relative to data/ |
|
279 | - * @return boolean |
|
280 | - */ |
|
281 | - protected function removeMount($mount, $path) { |
|
282 | - if ($mount instanceof MoveableMount) { |
|
283 | - // cut of /user/files to get the relative path to data/user/files |
|
284 | - $pathParts = explode('/', $path, 4); |
|
285 | - $relPath = '/' . $pathParts[3]; |
|
286 | - $this->lockFile($relPath, ILockingProvider::LOCK_SHARED, true); |
|
287 | - \OC_Hook::emit( |
|
288 | - Filesystem::CLASSNAME, "umount", |
|
289 | - [Filesystem::signal_param_path => $relPath] |
|
290 | - ); |
|
291 | - $this->changeLock($relPath, ILockingProvider::LOCK_EXCLUSIVE, true); |
|
292 | - $result = $mount->removeMount(); |
|
293 | - $this->changeLock($relPath, ILockingProvider::LOCK_SHARED, true); |
|
294 | - if ($result) { |
|
295 | - \OC_Hook::emit( |
|
296 | - Filesystem::CLASSNAME, "post_umount", |
|
297 | - [Filesystem::signal_param_path => $relPath] |
|
298 | - ); |
|
299 | - } |
|
300 | - $this->unlockFile($relPath, ILockingProvider::LOCK_SHARED, true); |
|
301 | - return $result; |
|
302 | - } else { |
|
303 | - // do not allow deleting the storage's root / the mount point |
|
304 | - // because for some storages it might delete the whole contents |
|
305 | - // but isn't supposed to work that way |
|
306 | - return false; |
|
307 | - } |
|
308 | - } |
|
309 | - |
|
310 | - public function disableCacheUpdate() { |
|
311 | - $this->updaterEnabled = false; |
|
312 | - } |
|
313 | - |
|
314 | - public function enableCacheUpdate() { |
|
315 | - $this->updaterEnabled = true; |
|
316 | - } |
|
317 | - |
|
318 | - protected function writeUpdate(Storage $storage, $internalPath, $time = null) { |
|
319 | - if ($this->updaterEnabled) { |
|
320 | - if (is_null($time)) { |
|
321 | - $time = time(); |
|
322 | - } |
|
323 | - $storage->getUpdater()->update($internalPath, $time); |
|
324 | - } |
|
325 | - } |
|
326 | - |
|
327 | - protected function removeUpdate(Storage $storage, $internalPath) { |
|
328 | - if ($this->updaterEnabled) { |
|
329 | - $storage->getUpdater()->remove($internalPath); |
|
330 | - } |
|
331 | - } |
|
332 | - |
|
333 | - protected function renameUpdate(Storage $sourceStorage, Storage $targetStorage, $sourceInternalPath, $targetInternalPath) { |
|
334 | - if ($this->updaterEnabled) { |
|
335 | - $targetStorage->getUpdater()->renameFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath); |
|
336 | - } |
|
337 | - } |
|
338 | - |
|
339 | - /** |
|
340 | - * @param string $path |
|
341 | - * @return bool|mixed |
|
342 | - */ |
|
343 | - public function rmdir($path) { |
|
344 | - $absolutePath = $this->getAbsolutePath($path); |
|
345 | - $mount = Filesystem::getMountManager()->find($absolutePath); |
|
346 | - if ($mount->getInternalPath($absolutePath) === '') { |
|
347 | - return $this->removeMount($mount, $absolutePath); |
|
348 | - } |
|
349 | - if ($this->is_dir($path)) { |
|
350 | - $result = $this->basicOperation('rmdir', $path, ['delete']); |
|
351 | - } else { |
|
352 | - $result = false; |
|
353 | - } |
|
354 | - |
|
355 | - if (!$result && !$this->file_exists($path)) { //clear ghost files from the cache on delete |
|
356 | - $storage = $mount->getStorage(); |
|
357 | - $internalPath = $mount->getInternalPath($absolutePath); |
|
358 | - $storage->getUpdater()->remove($internalPath); |
|
359 | - } |
|
360 | - return $result; |
|
361 | - } |
|
362 | - |
|
363 | - /** |
|
364 | - * @param string $path |
|
365 | - * @return resource |
|
366 | - */ |
|
367 | - public function opendir($path) { |
|
368 | - return $this->basicOperation('opendir', $path, ['read']); |
|
369 | - } |
|
370 | - |
|
371 | - /** |
|
372 | - * @param string $path |
|
373 | - * @return bool|mixed |
|
374 | - */ |
|
375 | - public function is_dir($path) { |
|
376 | - if ($path == '/') { |
|
377 | - return true; |
|
378 | - } |
|
379 | - return $this->basicOperation('is_dir', $path); |
|
380 | - } |
|
381 | - |
|
382 | - /** |
|
383 | - * @param string $path |
|
384 | - * @return bool|mixed |
|
385 | - */ |
|
386 | - public function is_file($path) { |
|
387 | - if ($path == '/') { |
|
388 | - return false; |
|
389 | - } |
|
390 | - return $this->basicOperation('is_file', $path); |
|
391 | - } |
|
392 | - |
|
393 | - /** |
|
394 | - * @param string $path |
|
395 | - * @return mixed |
|
396 | - */ |
|
397 | - public function stat($path) { |
|
398 | - return $this->basicOperation('stat', $path); |
|
399 | - } |
|
400 | - |
|
401 | - /** |
|
402 | - * @param string $path |
|
403 | - * @return mixed |
|
404 | - */ |
|
405 | - public function filetype($path) { |
|
406 | - return $this->basicOperation('filetype', $path); |
|
407 | - } |
|
408 | - |
|
409 | - /** |
|
410 | - * @param string $path |
|
411 | - * @return mixed |
|
412 | - */ |
|
413 | - public function filesize($path) { |
|
414 | - return $this->basicOperation('filesize', $path); |
|
415 | - } |
|
416 | - |
|
417 | - /** |
|
418 | - * @param string $path |
|
419 | - * @return bool|mixed |
|
420 | - * @throws \OCP\Files\InvalidPathException |
|
421 | - */ |
|
422 | - public function readfile($path) { |
|
423 | - $this->assertPathLength($path); |
|
424 | - if (ob_get_level()) { |
|
425 | - ob_end_clean(); |
|
426 | - } |
|
427 | - $handle = $this->fopen($path, 'rb'); |
|
428 | - if ($handle) { |
|
429 | - $chunkSize = 524288; // 512 kB chunks |
|
430 | - while (!feof($handle)) { |
|
431 | - echo fread($handle, $chunkSize); |
|
432 | - flush(); |
|
433 | - } |
|
434 | - fclose($handle); |
|
435 | - return $this->filesize($path); |
|
436 | - } |
|
437 | - return false; |
|
438 | - } |
|
439 | - |
|
440 | - /** |
|
441 | - * @param string $path |
|
442 | - * @param int $from |
|
443 | - * @param int $to |
|
444 | - * @return bool|mixed |
|
445 | - * @throws \OCP\Files\InvalidPathException |
|
446 | - * @throws \OCP\Files\UnseekableException |
|
447 | - */ |
|
448 | - public function readfilePart($path, $from, $to) { |
|
449 | - $this->assertPathLength($path); |
|
450 | - if (ob_get_level()) { |
|
451 | - ob_end_clean(); |
|
452 | - } |
|
453 | - $handle = $this->fopen($path, 'rb'); |
|
454 | - if ($handle) { |
|
455 | - $chunkSize = 524288; // 512 kB chunks |
|
456 | - $startReading = true; |
|
457 | - |
|
458 | - if ($from !== 0 && $from !== '0' && fseek($handle, $from) !== 0) { |
|
459 | - // forward file handle via chunked fread because fseek seem to have failed |
|
460 | - |
|
461 | - $end = $from + 1; |
|
462 | - while (!feof($handle) && ftell($handle) < $end && ftell($handle) !== $from) { |
|
463 | - $len = $from - ftell($handle); |
|
464 | - if ($len > $chunkSize) { |
|
465 | - $len = $chunkSize; |
|
466 | - } |
|
467 | - $result = fread($handle, $len); |
|
468 | - |
|
469 | - if ($result === false) { |
|
470 | - $startReading = false; |
|
471 | - break; |
|
472 | - } |
|
473 | - } |
|
474 | - } |
|
475 | - |
|
476 | - if ($startReading) { |
|
477 | - $end = $to + 1; |
|
478 | - while (!feof($handle) && ftell($handle) < $end) { |
|
479 | - $len = $end - ftell($handle); |
|
480 | - if ($len > $chunkSize) { |
|
481 | - $len = $chunkSize; |
|
482 | - } |
|
483 | - echo fread($handle, $len); |
|
484 | - flush(); |
|
485 | - } |
|
486 | - return ftell($handle) - $from; |
|
487 | - } |
|
488 | - |
|
489 | - throw new \OCP\Files\UnseekableException('fseek error'); |
|
490 | - } |
|
491 | - return false; |
|
492 | - } |
|
493 | - |
|
494 | - /** |
|
495 | - * @param string $path |
|
496 | - * @return mixed |
|
497 | - */ |
|
498 | - public function isCreatable($path) { |
|
499 | - return $this->basicOperation('isCreatable', $path); |
|
500 | - } |
|
501 | - |
|
502 | - /** |
|
503 | - * @param string $path |
|
504 | - * @return mixed |
|
505 | - */ |
|
506 | - public function isReadable($path) { |
|
507 | - return $this->basicOperation('isReadable', $path); |
|
508 | - } |
|
509 | - |
|
510 | - /** |
|
511 | - * @param string $path |
|
512 | - * @return mixed |
|
513 | - */ |
|
514 | - public function isUpdatable($path) { |
|
515 | - return $this->basicOperation('isUpdatable', $path); |
|
516 | - } |
|
517 | - |
|
518 | - /** |
|
519 | - * @param string $path |
|
520 | - * @return bool|mixed |
|
521 | - */ |
|
522 | - public function isDeletable($path) { |
|
523 | - $absolutePath = $this->getAbsolutePath($path); |
|
524 | - $mount = Filesystem::getMountManager()->find($absolutePath); |
|
525 | - if ($mount->getInternalPath($absolutePath) === '') { |
|
526 | - return $mount instanceof MoveableMount; |
|
527 | - } |
|
528 | - return $this->basicOperation('isDeletable', $path); |
|
529 | - } |
|
530 | - |
|
531 | - /** |
|
532 | - * @param string $path |
|
533 | - * @return mixed |
|
534 | - */ |
|
535 | - public function isSharable($path) { |
|
536 | - return $this->basicOperation('isSharable', $path); |
|
537 | - } |
|
538 | - |
|
539 | - /** |
|
540 | - * @param string $path |
|
541 | - * @return bool|mixed |
|
542 | - */ |
|
543 | - public function file_exists($path) { |
|
544 | - if ($path == '/') { |
|
545 | - return true; |
|
546 | - } |
|
547 | - return $this->basicOperation('file_exists', $path); |
|
548 | - } |
|
549 | - |
|
550 | - /** |
|
551 | - * @param string $path |
|
552 | - * @return mixed |
|
553 | - */ |
|
554 | - public function filemtime($path) { |
|
555 | - return $this->basicOperation('filemtime', $path); |
|
556 | - } |
|
557 | - |
|
558 | - /** |
|
559 | - * @param string $path |
|
560 | - * @param int|string $mtime |
|
561 | - * @return bool |
|
562 | - */ |
|
563 | - public function touch($path, $mtime = null) { |
|
564 | - if (!is_null($mtime) and !is_numeric($mtime)) { |
|
565 | - $mtime = strtotime($mtime); |
|
566 | - } |
|
567 | - |
|
568 | - $hooks = ['touch']; |
|
569 | - |
|
570 | - if (!$this->file_exists($path)) { |
|
571 | - $hooks[] = 'create'; |
|
572 | - $hooks[] = 'write'; |
|
573 | - } |
|
574 | - try { |
|
575 | - $result = $this->basicOperation('touch', $path, $hooks, $mtime); |
|
576 | - } catch (\Exception $e) { |
|
577 | - $this->logger->logException($e, ['level' => ILogger::INFO, 'message' => 'Error while setting modified time']); |
|
578 | - $result = false; |
|
579 | - } |
|
580 | - if (!$result) { |
|
581 | - // If create file fails because of permissions on external storage like SMB folders, |
|
582 | - // check file exists and return false if not. |
|
583 | - if (!$this->file_exists($path)) { |
|
584 | - return false; |
|
585 | - } |
|
586 | - if (is_null($mtime)) { |
|
587 | - $mtime = time(); |
|
588 | - } |
|
589 | - //if native touch fails, we emulate it by changing the mtime in the cache |
|
590 | - $this->putFileInfo($path, ['mtime' => floor($mtime)]); |
|
591 | - } |
|
592 | - return true; |
|
593 | - } |
|
594 | - |
|
595 | - /** |
|
596 | - * @param string $path |
|
597 | - * @return mixed |
|
598 | - * @throws LockedException |
|
599 | - */ |
|
600 | - public function file_get_contents($path) { |
|
601 | - return $this->basicOperation('file_get_contents', $path, ['read']); |
|
602 | - } |
|
603 | - |
|
604 | - /** |
|
605 | - * @param bool $exists |
|
606 | - * @param string $path |
|
607 | - * @param bool $run |
|
608 | - */ |
|
609 | - protected function emit_file_hooks_pre($exists, $path, &$run) { |
|
610 | - if (!$exists) { |
|
611 | - \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_create, [ |
|
612 | - Filesystem::signal_param_path => $this->getHookPath($path), |
|
613 | - Filesystem::signal_param_run => &$run, |
|
614 | - ]); |
|
615 | - } else { |
|
616 | - \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_update, [ |
|
617 | - Filesystem::signal_param_path => $this->getHookPath($path), |
|
618 | - Filesystem::signal_param_run => &$run, |
|
619 | - ]); |
|
620 | - } |
|
621 | - \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_write, [ |
|
622 | - Filesystem::signal_param_path => $this->getHookPath($path), |
|
623 | - Filesystem::signal_param_run => &$run, |
|
624 | - ]); |
|
625 | - } |
|
626 | - |
|
627 | - /** |
|
628 | - * @param bool $exists |
|
629 | - * @param string $path |
|
630 | - */ |
|
631 | - protected function emit_file_hooks_post($exists, $path) { |
|
632 | - if (!$exists) { |
|
633 | - \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_create, [ |
|
634 | - Filesystem::signal_param_path => $this->getHookPath($path), |
|
635 | - ]); |
|
636 | - } else { |
|
637 | - \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_update, [ |
|
638 | - Filesystem::signal_param_path => $this->getHookPath($path), |
|
639 | - ]); |
|
640 | - } |
|
641 | - \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_write, [ |
|
642 | - Filesystem::signal_param_path => $this->getHookPath($path), |
|
643 | - ]); |
|
644 | - } |
|
645 | - |
|
646 | - /** |
|
647 | - * @param string $path |
|
648 | - * @param string|resource $data |
|
649 | - * @return bool|mixed |
|
650 | - * @throws LockedException |
|
651 | - */ |
|
652 | - public function file_put_contents($path, $data) { |
|
653 | - if (is_resource($data)) { //not having to deal with streams in file_put_contents makes life easier |
|
654 | - $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); |
|
655 | - if (Filesystem::isValidPath($path) |
|
656 | - and !Filesystem::isFileBlacklisted($path) |
|
657 | - ) { |
|
658 | - $path = $this->getRelativePath($absolutePath); |
|
659 | - |
|
660 | - $this->lockFile($path, ILockingProvider::LOCK_SHARED); |
|
661 | - |
|
662 | - $exists = $this->file_exists($path); |
|
663 | - $run = true; |
|
664 | - if ($this->shouldEmitHooks($path)) { |
|
665 | - $this->emit_file_hooks_pre($exists, $path, $run); |
|
666 | - } |
|
667 | - if (!$run) { |
|
668 | - $this->unlockFile($path, ILockingProvider::LOCK_SHARED); |
|
669 | - return false; |
|
670 | - } |
|
671 | - |
|
672 | - try { |
|
673 | - $this->changeLock($path, ILockingProvider::LOCK_EXCLUSIVE); |
|
674 | - } catch (\Exception $e) { |
|
675 | - // Release the shared lock before throwing. |
|
676 | - $this->unlockFile($path, ILockingProvider::LOCK_SHARED); |
|
677 | - throw $e; |
|
678 | - } |
|
679 | - |
|
680 | - /** @var \OC\Files\Storage\Storage $storage */ |
|
681 | - [$storage, $internalPath] = $this->resolvePath($path); |
|
682 | - $target = $storage->fopen($internalPath, 'w'); |
|
683 | - if ($target) { |
|
684 | - [, $result] = \OC_Helper::streamCopy($data, $target); |
|
685 | - fclose($target); |
|
686 | - fclose($data); |
|
687 | - |
|
688 | - $this->writeUpdate($storage, $internalPath); |
|
689 | - |
|
690 | - $this->changeLock($path, ILockingProvider::LOCK_SHARED); |
|
691 | - |
|
692 | - if ($this->shouldEmitHooks($path) && $result !== false) { |
|
693 | - $this->emit_file_hooks_post($exists, $path); |
|
694 | - } |
|
695 | - $this->unlockFile($path, ILockingProvider::LOCK_SHARED); |
|
696 | - return $result; |
|
697 | - } else { |
|
698 | - $this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE); |
|
699 | - return false; |
|
700 | - } |
|
701 | - } else { |
|
702 | - return false; |
|
703 | - } |
|
704 | - } else { |
|
705 | - $hooks = $this->file_exists($path) ? ['update', 'write'] : ['create', 'write']; |
|
706 | - return $this->basicOperation('file_put_contents', $path, $hooks, $data); |
|
707 | - } |
|
708 | - } |
|
709 | - |
|
710 | - /** |
|
711 | - * @param string $path |
|
712 | - * @return bool|mixed |
|
713 | - */ |
|
714 | - public function unlink($path) { |
|
715 | - if ($path === '' || $path === '/') { |
|
716 | - // do not allow deleting the root |
|
717 | - return false; |
|
718 | - } |
|
719 | - $postFix = (substr($path, -1) === '/') ? '/' : ''; |
|
720 | - $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); |
|
721 | - $mount = Filesystem::getMountManager()->find($absolutePath . $postFix); |
|
722 | - if ($mount->getInternalPath($absolutePath) === '') { |
|
723 | - return $this->removeMount($mount, $absolutePath); |
|
724 | - } |
|
725 | - if ($this->is_dir($path)) { |
|
726 | - $result = $this->basicOperation('rmdir', $path, ['delete']); |
|
727 | - } else { |
|
728 | - $result = $this->basicOperation('unlink', $path, ['delete']); |
|
729 | - } |
|
730 | - if (!$result && !$this->file_exists($path)) { //clear ghost files from the cache on delete |
|
731 | - $storage = $mount->getStorage(); |
|
732 | - $internalPath = $mount->getInternalPath($absolutePath); |
|
733 | - $storage->getUpdater()->remove($internalPath); |
|
734 | - return true; |
|
735 | - } else { |
|
736 | - return $result; |
|
737 | - } |
|
738 | - } |
|
739 | - |
|
740 | - /** |
|
741 | - * @param string $directory |
|
742 | - * @return bool|mixed |
|
743 | - */ |
|
744 | - public function deleteAll($directory) { |
|
745 | - return $this->rmdir($directory); |
|
746 | - } |
|
747 | - |
|
748 | - /** |
|
749 | - * Rename/move a file or folder from the source path to target path. |
|
750 | - * |
|
751 | - * @param string $path1 source path |
|
752 | - * @param string $path2 target path |
|
753 | - * |
|
754 | - * @return bool|mixed |
|
755 | - * @throws LockedException |
|
756 | - */ |
|
757 | - public function rename($path1, $path2) { |
|
758 | - $absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1)); |
|
759 | - $absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2)); |
|
760 | - $result = false; |
|
761 | - if ( |
|
762 | - Filesystem::isValidPath($path2) |
|
763 | - and Filesystem::isValidPath($path1) |
|
764 | - and !Filesystem::isFileBlacklisted($path2) |
|
765 | - ) { |
|
766 | - $path1 = $this->getRelativePath($absolutePath1); |
|
767 | - $path2 = $this->getRelativePath($absolutePath2); |
|
768 | - $exists = $this->file_exists($path2); |
|
769 | - |
|
770 | - if ($path1 == null or $path2 == null) { |
|
771 | - return false; |
|
772 | - } |
|
773 | - |
|
774 | - $this->lockFile($path1, ILockingProvider::LOCK_SHARED, true); |
|
775 | - try { |
|
776 | - $this->lockFile($path2, ILockingProvider::LOCK_SHARED, true); |
|
777 | - |
|
778 | - $run = true; |
|
779 | - if ($this->shouldEmitHooks($path1) && (Cache\Scanner::isPartialFile($path1) && !Cache\Scanner::isPartialFile($path2))) { |
|
780 | - // if it was a rename from a part file to a regular file it was a write and not a rename operation |
|
781 | - $this->emit_file_hooks_pre($exists, $path2, $run); |
|
782 | - } elseif ($this->shouldEmitHooks($path1)) { |
|
783 | - \OC_Hook::emit( |
|
784 | - Filesystem::CLASSNAME, Filesystem::signal_rename, |
|
785 | - [ |
|
786 | - Filesystem::signal_param_oldpath => $this->getHookPath($path1), |
|
787 | - Filesystem::signal_param_newpath => $this->getHookPath($path2), |
|
788 | - Filesystem::signal_param_run => &$run |
|
789 | - ] |
|
790 | - ); |
|
791 | - } |
|
792 | - if ($run) { |
|
793 | - $this->verifyPath(dirname($path2), basename($path2)); |
|
794 | - |
|
795 | - $manager = Filesystem::getMountManager(); |
|
796 | - $mount1 = $this->getMount($path1); |
|
797 | - $mount2 = $this->getMount($path2); |
|
798 | - $storage1 = $mount1->getStorage(); |
|
799 | - $storage2 = $mount2->getStorage(); |
|
800 | - $internalPath1 = $mount1->getInternalPath($absolutePath1); |
|
801 | - $internalPath2 = $mount2->getInternalPath($absolutePath2); |
|
802 | - |
|
803 | - $this->changeLock($path1, ILockingProvider::LOCK_EXCLUSIVE, true); |
|
804 | - try { |
|
805 | - $this->changeLock($path2, ILockingProvider::LOCK_EXCLUSIVE, true); |
|
806 | - |
|
807 | - if ($internalPath1 === '') { |
|
808 | - if ($mount1 instanceof MoveableMount) { |
|
809 | - $sourceParentMount = $this->getMount(dirname($path1)); |
|
810 | - if ($sourceParentMount === $mount2 && $this->targetIsNotShared($storage2, $internalPath2)) { |
|
811 | - /** |
|
812 | - * @var \OC\Files\Mount\MountPoint | \OC\Files\Mount\MoveableMount $mount1 |
|
813 | - */ |
|
814 | - $sourceMountPoint = $mount1->getMountPoint(); |
|
815 | - $result = $mount1->moveMount($absolutePath2); |
|
816 | - $manager->moveMount($sourceMountPoint, $mount1->getMountPoint()); |
|
817 | - } else { |
|
818 | - $result = false; |
|
819 | - } |
|
820 | - } else { |
|
821 | - $result = false; |
|
822 | - } |
|
823 | - // moving a file/folder within the same mount point |
|
824 | - } elseif ($storage1 === $storage2) { |
|
825 | - if ($storage1) { |
|
826 | - $result = $storage1->rename($internalPath1, $internalPath2); |
|
827 | - } else { |
|
828 | - $result = false; |
|
829 | - } |
|
830 | - // moving a file/folder between storages (from $storage1 to $storage2) |
|
831 | - } else { |
|
832 | - $result = $storage2->moveFromStorage($storage1, $internalPath1, $internalPath2); |
|
833 | - } |
|
834 | - |
|
835 | - if ((Cache\Scanner::isPartialFile($path1) && !Cache\Scanner::isPartialFile($path2)) && $result !== false) { |
|
836 | - // if it was a rename from a part file to a regular file it was a write and not a rename operation |
|
837 | - $this->writeUpdate($storage2, $internalPath2); |
|
838 | - } elseif ($result) { |
|
839 | - if ($internalPath1 !== '') { // don't do a cache update for moved mounts |
|
840 | - $this->renameUpdate($storage1, $storage2, $internalPath1, $internalPath2); |
|
841 | - } |
|
842 | - } |
|
843 | - } catch (\Exception $e) { |
|
844 | - throw $e; |
|
845 | - } finally { |
|
846 | - $this->changeLock($path1, ILockingProvider::LOCK_SHARED, true); |
|
847 | - $this->changeLock($path2, ILockingProvider::LOCK_SHARED, true); |
|
848 | - } |
|
849 | - |
|
850 | - if ((Cache\Scanner::isPartialFile($path1) && !Cache\Scanner::isPartialFile($path2)) && $result !== false) { |
|
851 | - if ($this->shouldEmitHooks()) { |
|
852 | - $this->emit_file_hooks_post($exists, $path2); |
|
853 | - } |
|
854 | - } elseif ($result) { |
|
855 | - if ($this->shouldEmitHooks($path1) and $this->shouldEmitHooks($path2)) { |
|
856 | - \OC_Hook::emit( |
|
857 | - Filesystem::CLASSNAME, |
|
858 | - Filesystem::signal_post_rename, |
|
859 | - [ |
|
860 | - Filesystem::signal_param_oldpath => $this->getHookPath($path1), |
|
861 | - Filesystem::signal_param_newpath => $this->getHookPath($path2) |
|
862 | - ] |
|
863 | - ); |
|
864 | - } |
|
865 | - } |
|
866 | - } |
|
867 | - } catch (\Exception $e) { |
|
868 | - throw $e; |
|
869 | - } finally { |
|
870 | - $this->unlockFile($path1, ILockingProvider::LOCK_SHARED, true); |
|
871 | - $this->unlockFile($path2, ILockingProvider::LOCK_SHARED, true); |
|
872 | - } |
|
873 | - } |
|
874 | - return $result; |
|
875 | - } |
|
876 | - |
|
877 | - /** |
|
878 | - * Copy a file/folder from the source path to target path |
|
879 | - * |
|
880 | - * @param string $path1 source path |
|
881 | - * @param string $path2 target path |
|
882 | - * @param bool $preserveMtime whether to preserve mtime on the copy |
|
883 | - * |
|
884 | - * @return bool|mixed |
|
885 | - */ |
|
886 | - public function copy($path1, $path2, $preserveMtime = false) { |
|
887 | - $absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1)); |
|
888 | - $absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2)); |
|
889 | - $result = false; |
|
890 | - if ( |
|
891 | - Filesystem::isValidPath($path2) |
|
892 | - and Filesystem::isValidPath($path1) |
|
893 | - and !Filesystem::isFileBlacklisted($path2) |
|
894 | - ) { |
|
895 | - $path1 = $this->getRelativePath($absolutePath1); |
|
896 | - $path2 = $this->getRelativePath($absolutePath2); |
|
897 | - |
|
898 | - if ($path1 == null or $path2 == null) { |
|
899 | - return false; |
|
900 | - } |
|
901 | - $run = true; |
|
902 | - |
|
903 | - $this->lockFile($path2, ILockingProvider::LOCK_SHARED); |
|
904 | - $this->lockFile($path1, ILockingProvider::LOCK_SHARED); |
|
905 | - $lockTypePath1 = ILockingProvider::LOCK_SHARED; |
|
906 | - $lockTypePath2 = ILockingProvider::LOCK_SHARED; |
|
907 | - |
|
908 | - try { |
|
909 | - $exists = $this->file_exists($path2); |
|
910 | - if ($this->shouldEmitHooks()) { |
|
911 | - \OC_Hook::emit( |
|
912 | - Filesystem::CLASSNAME, |
|
913 | - Filesystem::signal_copy, |
|
914 | - [ |
|
915 | - Filesystem::signal_param_oldpath => $this->getHookPath($path1), |
|
916 | - Filesystem::signal_param_newpath => $this->getHookPath($path2), |
|
917 | - Filesystem::signal_param_run => &$run |
|
918 | - ] |
|
919 | - ); |
|
920 | - $this->emit_file_hooks_pre($exists, $path2, $run); |
|
921 | - } |
|
922 | - if ($run) { |
|
923 | - $mount1 = $this->getMount($path1); |
|
924 | - $mount2 = $this->getMount($path2); |
|
925 | - $storage1 = $mount1->getStorage(); |
|
926 | - $internalPath1 = $mount1->getInternalPath($absolutePath1); |
|
927 | - $storage2 = $mount2->getStorage(); |
|
928 | - $internalPath2 = $mount2->getInternalPath($absolutePath2); |
|
929 | - |
|
930 | - $this->changeLock($path2, ILockingProvider::LOCK_EXCLUSIVE); |
|
931 | - $lockTypePath2 = ILockingProvider::LOCK_EXCLUSIVE; |
|
932 | - |
|
933 | - if ($mount1->getMountPoint() == $mount2->getMountPoint()) { |
|
934 | - if ($storage1) { |
|
935 | - $result = $storage1->copy($internalPath1, $internalPath2); |
|
936 | - } else { |
|
937 | - $result = false; |
|
938 | - } |
|
939 | - } else { |
|
940 | - $result = $storage2->copyFromStorage($storage1, $internalPath1, $internalPath2); |
|
941 | - } |
|
942 | - |
|
943 | - $this->writeUpdate($storage2, $internalPath2); |
|
944 | - |
|
945 | - $this->changeLock($path2, ILockingProvider::LOCK_SHARED); |
|
946 | - $lockTypePath2 = ILockingProvider::LOCK_SHARED; |
|
947 | - |
|
948 | - if ($this->shouldEmitHooks() && $result !== false) { |
|
949 | - \OC_Hook::emit( |
|
950 | - Filesystem::CLASSNAME, |
|
951 | - Filesystem::signal_post_copy, |
|
952 | - [ |
|
953 | - Filesystem::signal_param_oldpath => $this->getHookPath($path1), |
|
954 | - Filesystem::signal_param_newpath => $this->getHookPath($path2) |
|
955 | - ] |
|
956 | - ); |
|
957 | - $this->emit_file_hooks_post($exists, $path2); |
|
958 | - } |
|
959 | - } |
|
960 | - } catch (\Exception $e) { |
|
961 | - $this->unlockFile($path2, $lockTypePath2); |
|
962 | - $this->unlockFile($path1, $lockTypePath1); |
|
963 | - throw $e; |
|
964 | - } |
|
965 | - |
|
966 | - $this->unlockFile($path2, $lockTypePath2); |
|
967 | - $this->unlockFile($path1, $lockTypePath1); |
|
968 | - } |
|
969 | - return $result; |
|
970 | - } |
|
971 | - |
|
972 | - /** |
|
973 | - * @param string $path |
|
974 | - * @param string $mode 'r' or 'w' |
|
975 | - * @return resource |
|
976 | - * @throws LockedException |
|
977 | - */ |
|
978 | - public function fopen($path, $mode) { |
|
979 | - $mode = str_replace('b', '', $mode); // the binary flag is a windows only feature which we do not support |
|
980 | - $hooks = []; |
|
981 | - switch ($mode) { |
|
982 | - case 'r': |
|
983 | - $hooks[] = 'read'; |
|
984 | - break; |
|
985 | - case 'r+': |
|
986 | - case 'w+': |
|
987 | - case 'x+': |
|
988 | - case 'a+': |
|
989 | - $hooks[] = 'read'; |
|
990 | - $hooks[] = 'write'; |
|
991 | - break; |
|
992 | - case 'w': |
|
993 | - case 'x': |
|
994 | - case 'a': |
|
995 | - $hooks[] = 'write'; |
|
996 | - break; |
|
997 | - default: |
|
998 | - \OCP\Util::writeLog('core', 'invalid mode (' . $mode . ') for ' . $path, ILogger::ERROR); |
|
999 | - } |
|
1000 | - |
|
1001 | - if ($mode !== 'r' && $mode !== 'w') { |
|
1002 | - \OC::$server->getLogger()->info('Trying to open a file with a mode other than "r" or "w" can cause severe performance issues with some backends'); |
|
1003 | - } |
|
1004 | - |
|
1005 | - return $this->basicOperation('fopen', $path, $hooks, $mode); |
|
1006 | - } |
|
1007 | - |
|
1008 | - /** |
|
1009 | - * @param string $path |
|
1010 | - * @return bool|string |
|
1011 | - * @throws \OCP\Files\InvalidPathException |
|
1012 | - */ |
|
1013 | - public function toTmpFile($path) { |
|
1014 | - $this->assertPathLength($path); |
|
1015 | - if (Filesystem::isValidPath($path)) { |
|
1016 | - $source = $this->fopen($path, 'r'); |
|
1017 | - if ($source) { |
|
1018 | - $extension = pathinfo($path, PATHINFO_EXTENSION); |
|
1019 | - $tmpFile = \OC::$server->getTempManager()->getTemporaryFile($extension); |
|
1020 | - file_put_contents($tmpFile, $source); |
|
1021 | - return $tmpFile; |
|
1022 | - } else { |
|
1023 | - return false; |
|
1024 | - } |
|
1025 | - } else { |
|
1026 | - return false; |
|
1027 | - } |
|
1028 | - } |
|
1029 | - |
|
1030 | - /** |
|
1031 | - * @param string $tmpFile |
|
1032 | - * @param string $path |
|
1033 | - * @return bool|mixed |
|
1034 | - * @throws \OCP\Files\InvalidPathException |
|
1035 | - */ |
|
1036 | - public function fromTmpFile($tmpFile, $path) { |
|
1037 | - $this->assertPathLength($path); |
|
1038 | - if (Filesystem::isValidPath($path)) { |
|
1039 | - |
|
1040 | - // Get directory that the file is going into |
|
1041 | - $filePath = dirname($path); |
|
1042 | - |
|
1043 | - // Create the directories if any |
|
1044 | - if (!$this->file_exists($filePath)) { |
|
1045 | - $result = $this->createParentDirectories($filePath); |
|
1046 | - if ($result === false) { |
|
1047 | - return false; |
|
1048 | - } |
|
1049 | - } |
|
1050 | - |
|
1051 | - $source = fopen($tmpFile, 'r'); |
|
1052 | - if ($source) { |
|
1053 | - $result = $this->file_put_contents($path, $source); |
|
1054 | - // $this->file_put_contents() might have already closed |
|
1055 | - // the resource, so we check it, before trying to close it |
|
1056 | - // to avoid messages in the error log. |
|
1057 | - if (is_resource($source)) { |
|
1058 | - fclose($source); |
|
1059 | - } |
|
1060 | - unlink($tmpFile); |
|
1061 | - return $result; |
|
1062 | - } else { |
|
1063 | - return false; |
|
1064 | - } |
|
1065 | - } else { |
|
1066 | - return false; |
|
1067 | - } |
|
1068 | - } |
|
1069 | - |
|
1070 | - |
|
1071 | - /** |
|
1072 | - * @param string $path |
|
1073 | - * @return mixed |
|
1074 | - * @throws \OCP\Files\InvalidPathException |
|
1075 | - */ |
|
1076 | - public function getMimeType($path) { |
|
1077 | - $this->assertPathLength($path); |
|
1078 | - return $this->basicOperation('getMimeType', $path); |
|
1079 | - } |
|
1080 | - |
|
1081 | - /** |
|
1082 | - * @param string $type |
|
1083 | - * @param string $path |
|
1084 | - * @param bool $raw |
|
1085 | - * @return bool|string |
|
1086 | - */ |
|
1087 | - public function hash($type, $path, $raw = false) { |
|
1088 | - $postFix = (substr($path, -1) === '/') ? '/' : ''; |
|
1089 | - $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); |
|
1090 | - if (Filesystem::isValidPath($path)) { |
|
1091 | - $path = $this->getRelativePath($absolutePath); |
|
1092 | - if ($path == null) { |
|
1093 | - return false; |
|
1094 | - } |
|
1095 | - if ($this->shouldEmitHooks($path)) { |
|
1096 | - \OC_Hook::emit( |
|
1097 | - Filesystem::CLASSNAME, |
|
1098 | - Filesystem::signal_read, |
|
1099 | - [Filesystem::signal_param_path => $this->getHookPath($path)] |
|
1100 | - ); |
|
1101 | - } |
|
1102 | - /** @var Storage|null $storage */ |
|
1103 | - [$storage, $internalPath] = Filesystem::resolvePath($absolutePath . $postFix); |
|
1104 | - if ($storage) { |
|
1105 | - return $storage->hash($type, $internalPath, $raw); |
|
1106 | - } |
|
1107 | - } |
|
1108 | - return false; |
|
1109 | - } |
|
1110 | - |
|
1111 | - /** |
|
1112 | - * @param string $path |
|
1113 | - * @return mixed |
|
1114 | - * @throws \OCP\Files\InvalidPathException |
|
1115 | - */ |
|
1116 | - public function free_space($path = '/') { |
|
1117 | - $this->assertPathLength($path); |
|
1118 | - $result = $this->basicOperation('free_space', $path); |
|
1119 | - if ($result === null) { |
|
1120 | - throw new InvalidPathException(); |
|
1121 | - } |
|
1122 | - return $result; |
|
1123 | - } |
|
1124 | - |
|
1125 | - /** |
|
1126 | - * abstraction layer for basic filesystem functions: wrapper for \OC\Files\Storage\Storage |
|
1127 | - * |
|
1128 | - * @param string $operation |
|
1129 | - * @param string $path |
|
1130 | - * @param array $hooks (optional) |
|
1131 | - * @param mixed $extraParam (optional) |
|
1132 | - * @return mixed |
|
1133 | - * @throws LockedException |
|
1134 | - * |
|
1135 | - * This method takes requests for basic filesystem functions (e.g. reading & writing |
|
1136 | - * files), processes hooks and proxies, sanitises paths, and finally passes them on to |
|
1137 | - * \OC\Files\Storage\Storage for delegation to a storage backend for execution |
|
1138 | - */ |
|
1139 | - private function basicOperation($operation, $path, $hooks = [], $extraParam = null) { |
|
1140 | - $postFix = (substr($path, -1) === '/') ? '/' : ''; |
|
1141 | - $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); |
|
1142 | - if (Filesystem::isValidPath($path) |
|
1143 | - and !Filesystem::isFileBlacklisted($path) |
|
1144 | - ) { |
|
1145 | - $path = $this->getRelativePath($absolutePath); |
|
1146 | - if ($path == null) { |
|
1147 | - return false; |
|
1148 | - } |
|
1149 | - |
|
1150 | - if (in_array('write', $hooks) || in_array('delete', $hooks) || in_array('read', $hooks)) { |
|
1151 | - // always a shared lock during pre-hooks so the hook can read the file |
|
1152 | - $this->lockFile($path, ILockingProvider::LOCK_SHARED); |
|
1153 | - } |
|
1154 | - |
|
1155 | - $run = $this->runHooks($hooks, $path); |
|
1156 | - /** @var \OC\Files\Storage\Storage $storage */ |
|
1157 | - [$storage, $internalPath] = Filesystem::resolvePath($absolutePath . $postFix); |
|
1158 | - if ($run and $storage) { |
|
1159 | - if (in_array('write', $hooks) || in_array('delete', $hooks)) { |
|
1160 | - try { |
|
1161 | - $this->changeLock($path, ILockingProvider::LOCK_EXCLUSIVE); |
|
1162 | - } catch (LockedException $e) { |
|
1163 | - // release the shared lock we acquired before quiting |
|
1164 | - $this->unlockFile($path, ILockingProvider::LOCK_SHARED); |
|
1165 | - throw $e; |
|
1166 | - } |
|
1167 | - } |
|
1168 | - try { |
|
1169 | - if (!is_null($extraParam)) { |
|
1170 | - $result = $storage->$operation($internalPath, $extraParam); |
|
1171 | - } else { |
|
1172 | - $result = $storage->$operation($internalPath); |
|
1173 | - } |
|
1174 | - } catch (\Exception $e) { |
|
1175 | - if (in_array('write', $hooks) || in_array('delete', $hooks)) { |
|
1176 | - $this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE); |
|
1177 | - } elseif (in_array('read', $hooks)) { |
|
1178 | - $this->unlockFile($path, ILockingProvider::LOCK_SHARED); |
|
1179 | - } |
|
1180 | - throw $e; |
|
1181 | - } |
|
1182 | - |
|
1183 | - if ($result && in_array('delete', $hooks) and $result) { |
|
1184 | - $this->removeUpdate($storage, $internalPath); |
|
1185 | - } |
|
1186 | - if ($result && in_array('write', $hooks, true) && $operation !== 'fopen' && $operation !== 'touch') { |
|
1187 | - $this->writeUpdate($storage, $internalPath); |
|
1188 | - } |
|
1189 | - if ($result && in_array('touch', $hooks)) { |
|
1190 | - $this->writeUpdate($storage, $internalPath, $extraParam); |
|
1191 | - } |
|
1192 | - |
|
1193 | - if ((in_array('write', $hooks) || in_array('delete', $hooks)) && ($operation !== 'fopen' || $result === false)) { |
|
1194 | - $this->changeLock($path, ILockingProvider::LOCK_SHARED); |
|
1195 | - } |
|
1196 | - |
|
1197 | - $unlockLater = false; |
|
1198 | - if ($this->lockingEnabled && $operation === 'fopen' && is_resource($result)) { |
|
1199 | - $unlockLater = true; |
|
1200 | - // make sure our unlocking callback will still be called if connection is aborted |
|
1201 | - ignore_user_abort(true); |
|
1202 | - $result = CallbackWrapper::wrap($result, null, null, function () use ($hooks, $path) { |
|
1203 | - if (in_array('write', $hooks)) { |
|
1204 | - $this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE); |
|
1205 | - } elseif (in_array('read', $hooks)) { |
|
1206 | - $this->unlockFile($path, ILockingProvider::LOCK_SHARED); |
|
1207 | - } |
|
1208 | - }); |
|
1209 | - } |
|
1210 | - |
|
1211 | - if ($this->shouldEmitHooks($path) && $result !== false) { |
|
1212 | - if ($operation != 'fopen') { //no post hooks for fopen, the file stream is still open |
|
1213 | - $this->runHooks($hooks, $path, true); |
|
1214 | - } |
|
1215 | - } |
|
1216 | - |
|
1217 | - if (!$unlockLater |
|
1218 | - && (in_array('write', $hooks) || in_array('delete', $hooks) || in_array('read', $hooks)) |
|
1219 | - ) { |
|
1220 | - $this->unlockFile($path, ILockingProvider::LOCK_SHARED); |
|
1221 | - } |
|
1222 | - return $result; |
|
1223 | - } else { |
|
1224 | - $this->unlockFile($path, ILockingProvider::LOCK_SHARED); |
|
1225 | - } |
|
1226 | - } |
|
1227 | - return null; |
|
1228 | - } |
|
1229 | - |
|
1230 | - /** |
|
1231 | - * get the path relative to the default root for hook usage |
|
1232 | - * |
|
1233 | - * @param string $path |
|
1234 | - * @return string |
|
1235 | - */ |
|
1236 | - private function getHookPath($path) { |
|
1237 | - if (!Filesystem::getView()) { |
|
1238 | - return $path; |
|
1239 | - } |
|
1240 | - return Filesystem::getView()->getRelativePath($this->getAbsolutePath($path)); |
|
1241 | - } |
|
1242 | - |
|
1243 | - private function shouldEmitHooks($path = '') { |
|
1244 | - if ($path && Cache\Scanner::isPartialFile($path)) { |
|
1245 | - return false; |
|
1246 | - } |
|
1247 | - if (!Filesystem::$loaded) { |
|
1248 | - return false; |
|
1249 | - } |
|
1250 | - $defaultRoot = Filesystem::getRoot(); |
|
1251 | - if ($defaultRoot === null) { |
|
1252 | - return false; |
|
1253 | - } |
|
1254 | - if ($this->fakeRoot === $defaultRoot) { |
|
1255 | - return true; |
|
1256 | - } |
|
1257 | - $fullPath = $this->getAbsolutePath($path); |
|
1258 | - |
|
1259 | - if ($fullPath === $defaultRoot) { |
|
1260 | - return true; |
|
1261 | - } |
|
1262 | - |
|
1263 | - return (strlen($fullPath) > strlen($defaultRoot)) && (substr($fullPath, 0, strlen($defaultRoot) + 1) === $defaultRoot . '/'); |
|
1264 | - } |
|
1265 | - |
|
1266 | - /** |
|
1267 | - * @param string[] $hooks |
|
1268 | - * @param string $path |
|
1269 | - * @param bool $post |
|
1270 | - * @return bool |
|
1271 | - */ |
|
1272 | - private function runHooks($hooks, $path, $post = false) { |
|
1273 | - $relativePath = $path; |
|
1274 | - $path = $this->getHookPath($path); |
|
1275 | - $prefix = $post ? 'post_' : ''; |
|
1276 | - $run = true; |
|
1277 | - if ($this->shouldEmitHooks($relativePath)) { |
|
1278 | - foreach ($hooks as $hook) { |
|
1279 | - if ($hook != 'read') { |
|
1280 | - \OC_Hook::emit( |
|
1281 | - Filesystem::CLASSNAME, |
|
1282 | - $prefix . $hook, |
|
1283 | - [ |
|
1284 | - Filesystem::signal_param_run => &$run, |
|
1285 | - Filesystem::signal_param_path => $path |
|
1286 | - ] |
|
1287 | - ); |
|
1288 | - } elseif (!$post) { |
|
1289 | - \OC_Hook::emit( |
|
1290 | - Filesystem::CLASSNAME, |
|
1291 | - $prefix . $hook, |
|
1292 | - [ |
|
1293 | - Filesystem::signal_param_path => $path |
|
1294 | - ] |
|
1295 | - ); |
|
1296 | - } |
|
1297 | - } |
|
1298 | - } |
|
1299 | - return $run; |
|
1300 | - } |
|
1301 | - |
|
1302 | - /** |
|
1303 | - * check if a file or folder has been updated since $time |
|
1304 | - * |
|
1305 | - * @param string $path |
|
1306 | - * @param int $time |
|
1307 | - * @return bool |
|
1308 | - */ |
|
1309 | - public function hasUpdated($path, $time) { |
|
1310 | - return $this->basicOperation('hasUpdated', $path, [], $time); |
|
1311 | - } |
|
1312 | - |
|
1313 | - /** |
|
1314 | - * @param string $ownerId |
|
1315 | - * @return \OC\User\User |
|
1316 | - */ |
|
1317 | - private function getUserObjectForOwner($ownerId) { |
|
1318 | - $owner = $this->userManager->get($ownerId); |
|
1319 | - if ($owner instanceof IUser) { |
|
1320 | - return $owner; |
|
1321 | - } else { |
|
1322 | - return new User($ownerId, null, \OC::$server->getEventDispatcher()); |
|
1323 | - } |
|
1324 | - } |
|
1325 | - |
|
1326 | - /** |
|
1327 | - * Get file info from cache |
|
1328 | - * |
|
1329 | - * If the file is not in cached it will be scanned |
|
1330 | - * If the file has changed on storage the cache will be updated |
|
1331 | - * |
|
1332 | - * @param \OC\Files\Storage\Storage $storage |
|
1333 | - * @param string $internalPath |
|
1334 | - * @param string $relativePath |
|
1335 | - * @return ICacheEntry|bool |
|
1336 | - */ |
|
1337 | - private function getCacheEntry($storage, $internalPath, $relativePath) { |
|
1338 | - $cache = $storage->getCache($internalPath); |
|
1339 | - $data = $cache->get($internalPath); |
|
1340 | - $watcher = $storage->getWatcher($internalPath); |
|
1341 | - |
|
1342 | - try { |
|
1343 | - // if the file is not in the cache or needs to be updated, trigger the scanner and reload the data |
|
1344 | - if (!$data || (isset($data['size']) && $data['size'] === -1)) { |
|
1345 | - if (!$storage->file_exists($internalPath)) { |
|
1346 | - return false; |
|
1347 | - } |
|
1348 | - // don't need to get a lock here since the scanner does it's own locking |
|
1349 | - $scanner = $storage->getScanner($internalPath); |
|
1350 | - $scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW); |
|
1351 | - $data = $cache->get($internalPath); |
|
1352 | - } elseif (!Cache\Scanner::isPartialFile($internalPath) && $watcher->needsUpdate($internalPath, $data)) { |
|
1353 | - $this->lockFile($relativePath, ILockingProvider::LOCK_SHARED); |
|
1354 | - $watcher->update($internalPath, $data); |
|
1355 | - $storage->getPropagator()->propagateChange($internalPath, time()); |
|
1356 | - $data = $cache->get($internalPath); |
|
1357 | - $this->unlockFile($relativePath, ILockingProvider::LOCK_SHARED); |
|
1358 | - } |
|
1359 | - } catch (LockedException $e) { |
|
1360 | - // if the file is locked we just use the old cache info |
|
1361 | - } |
|
1362 | - |
|
1363 | - return $data; |
|
1364 | - } |
|
1365 | - |
|
1366 | - /** |
|
1367 | - * get the filesystem info |
|
1368 | - * |
|
1369 | - * @param string $path |
|
1370 | - * @param boolean|string $includeMountPoints true to add mountpoint sizes, |
|
1371 | - * 'ext' to add only ext storage mount point sizes. Defaults to true. |
|
1372 | - * defaults to true |
|
1373 | - * @return \OC\Files\FileInfo|false False if file does not exist |
|
1374 | - */ |
|
1375 | - public function getFileInfo($path, $includeMountPoints = true) { |
|
1376 | - $this->assertPathLength($path); |
|
1377 | - if (!Filesystem::isValidPath($path)) { |
|
1378 | - return false; |
|
1379 | - } |
|
1380 | - if (Cache\Scanner::isPartialFile($path)) { |
|
1381 | - return $this->getPartFileInfo($path); |
|
1382 | - } |
|
1383 | - $relativePath = $path; |
|
1384 | - $path = Filesystem::normalizePath($this->fakeRoot . '/' . $path); |
|
1385 | - |
|
1386 | - $mount = Filesystem::getMountManager()->find($path); |
|
1387 | - $storage = $mount->getStorage(); |
|
1388 | - $internalPath = $mount->getInternalPath($path); |
|
1389 | - if ($storage) { |
|
1390 | - $data = $this->getCacheEntry($storage, $internalPath, $relativePath); |
|
1391 | - |
|
1392 | - if (!$data instanceof ICacheEntry) { |
|
1393 | - return false; |
|
1394 | - } |
|
1395 | - |
|
1396 | - if ($mount instanceof MoveableMount && $internalPath === '') { |
|
1397 | - $data['permissions'] |= \OCP\Constants::PERMISSION_DELETE; |
|
1398 | - } |
|
1399 | - $ownerId = $storage->getOwner($internalPath); |
|
1400 | - $owner = null; |
|
1401 | - if ($ownerId !== null && $ownerId !== false) { |
|
1402 | - // ownerId might be null if files are accessed with an access token without file system access |
|
1403 | - $owner = $this->getUserObjectForOwner($ownerId); |
|
1404 | - } |
|
1405 | - $info = new FileInfo($path, $storage, $internalPath, $data, $mount, $owner); |
|
1406 | - |
|
1407 | - if (isset($data['fileid'])) { |
|
1408 | - if ($includeMountPoints and $data['mimetype'] === 'httpd/unix-directory') { |
|
1409 | - //add the sizes of other mount points to the folder |
|
1410 | - $extOnly = ($includeMountPoints === 'ext'); |
|
1411 | - $mounts = Filesystem::getMountManager()->findIn($path); |
|
1412 | - $info->setSubMounts(array_filter($mounts, function (IMountPoint $mount) use ($extOnly) { |
|
1413 | - $subStorage = $mount->getStorage(); |
|
1414 | - return !($extOnly && $subStorage instanceof \OCA\Files_Sharing\SharedStorage); |
|
1415 | - })); |
|
1416 | - } |
|
1417 | - } |
|
1418 | - |
|
1419 | - return $info; |
|
1420 | - } else { |
|
1421 | - \OC::$server->getLogger()->warning('Storage not valid for mountpoint: ' . $mount->getMountPoint()); |
|
1422 | - } |
|
1423 | - |
|
1424 | - return false; |
|
1425 | - } |
|
1426 | - |
|
1427 | - /** |
|
1428 | - * get the content of a directory |
|
1429 | - * |
|
1430 | - * @param string $directory path under datadirectory |
|
1431 | - * @param string $mimetype_filter limit returned content to this mimetype or mimepart |
|
1432 | - * @return FileInfo[] |
|
1433 | - */ |
|
1434 | - public function getDirectoryContent($directory, $mimetype_filter = '') { |
|
1435 | - $this->assertPathLength($directory); |
|
1436 | - if (!Filesystem::isValidPath($directory)) { |
|
1437 | - return []; |
|
1438 | - } |
|
1439 | - $path = $this->getAbsolutePath($directory); |
|
1440 | - $path = Filesystem::normalizePath($path); |
|
1441 | - $mount = $this->getMount($directory); |
|
1442 | - if (!$mount) { |
|
1443 | - return []; |
|
1444 | - } |
|
1445 | - $storage = $mount->getStorage(); |
|
1446 | - $internalPath = $mount->getInternalPath($path); |
|
1447 | - if ($storage) { |
|
1448 | - $cache = $storage->getCache($internalPath); |
|
1449 | - $user = \OC_User::getUser(); |
|
1450 | - |
|
1451 | - $data = $this->getCacheEntry($storage, $internalPath, $directory); |
|
1452 | - |
|
1453 | - if (!$data instanceof ICacheEntry || !isset($data['fileid']) || !($data->getPermissions() && Constants::PERMISSION_READ)) { |
|
1454 | - return []; |
|
1455 | - } |
|
1456 | - |
|
1457 | - $folderId = $data['fileid']; |
|
1458 | - $contents = $cache->getFolderContentsById($folderId); //TODO: mimetype_filter |
|
1459 | - |
|
1460 | - $sharingDisabled = \OCP\Util::isSharingDisabledForUser(); |
|
1461 | - |
|
1462 | - $fileNames = array_map(function (ICacheEntry $content) { |
|
1463 | - return $content->getName(); |
|
1464 | - }, $contents); |
|
1465 | - /** |
|
1466 | - * @var \OC\Files\FileInfo[] $fileInfos |
|
1467 | - */ |
|
1468 | - $fileInfos = array_map(function (ICacheEntry $content) use ($path, $storage, $mount, $sharingDisabled) { |
|
1469 | - if ($sharingDisabled) { |
|
1470 | - $content['permissions'] = $content['permissions'] & ~\OCP\Constants::PERMISSION_SHARE; |
|
1471 | - } |
|
1472 | - $owner = $this->getUserObjectForOwner($storage->getOwner($content['path'])); |
|
1473 | - return new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content, $mount, $owner); |
|
1474 | - }, $contents); |
|
1475 | - $files = array_combine($fileNames, $fileInfos); |
|
1476 | - |
|
1477 | - //add a folder for any mountpoint in this directory and add the sizes of other mountpoints to the folders |
|
1478 | - $mounts = Filesystem::getMountManager()->findIn($path); |
|
1479 | - $dirLength = strlen($path); |
|
1480 | - foreach ($mounts as $mount) { |
|
1481 | - $mountPoint = $mount->getMountPoint(); |
|
1482 | - $subStorage = $mount->getStorage(); |
|
1483 | - if ($subStorage) { |
|
1484 | - $subCache = $subStorage->getCache(''); |
|
1485 | - |
|
1486 | - $rootEntry = $subCache->get(''); |
|
1487 | - if (!$rootEntry) { |
|
1488 | - $subScanner = $subStorage->getScanner(); |
|
1489 | - try { |
|
1490 | - $subScanner->scanFile(''); |
|
1491 | - } catch (\OCP\Files\StorageNotAvailableException $e) { |
|
1492 | - continue; |
|
1493 | - } catch (\OCP\Files\StorageInvalidException $e) { |
|
1494 | - continue; |
|
1495 | - } catch (\Exception $e) { |
|
1496 | - // sometimes when the storage is not available it can be any exception |
|
1497 | - \OC::$server->getLogger()->logException($e, [ |
|
1498 | - 'message' => 'Exception while scanning storage "' . $subStorage->getId() . '"', |
|
1499 | - 'level' => ILogger::ERROR, |
|
1500 | - 'app' => 'lib', |
|
1501 | - ]); |
|
1502 | - continue; |
|
1503 | - } |
|
1504 | - $rootEntry = $subCache->get(''); |
|
1505 | - } |
|
1506 | - |
|
1507 | - if ($rootEntry && ($rootEntry->getPermissions() && Constants::PERMISSION_READ)) { |
|
1508 | - $relativePath = trim(substr($mountPoint, $dirLength), '/'); |
|
1509 | - if ($pos = strpos($relativePath, '/')) { |
|
1510 | - //mountpoint inside subfolder add size to the correct folder |
|
1511 | - $entryName = substr($relativePath, 0, $pos); |
|
1512 | - foreach ($files as &$entry) { |
|
1513 | - if ($entry->getName() === $entryName) { |
|
1514 | - $entry->addSubEntry($rootEntry, $mountPoint); |
|
1515 | - } |
|
1516 | - } |
|
1517 | - } else { //mountpoint in this folder, add an entry for it |
|
1518 | - $rootEntry['name'] = $relativePath; |
|
1519 | - $rootEntry['type'] = $rootEntry['mimetype'] === 'httpd/unix-directory' ? 'dir' : 'file'; |
|
1520 | - $permissions = $rootEntry['permissions']; |
|
1521 | - // do not allow renaming/deleting the mount point if they are not shared files/folders |
|
1522 | - // for shared files/folders we use the permissions given by the owner |
|
1523 | - if ($mount instanceof MoveableMount) { |
|
1524 | - $rootEntry['permissions'] = $permissions | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE; |
|
1525 | - } else { |
|
1526 | - $rootEntry['permissions'] = $permissions & (\OCP\Constants::PERMISSION_ALL - (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE)); |
|
1527 | - } |
|
1528 | - |
|
1529 | - $rootEntry['path'] = substr(Filesystem::normalizePath($path . '/' . $rootEntry['name']), strlen($user) + 2); // full path without /$user/ |
|
1530 | - |
|
1531 | - // if sharing was disabled for the user we remove the share permissions |
|
1532 | - if (\OCP\Util::isSharingDisabledForUser()) { |
|
1533 | - $rootEntry['permissions'] = $rootEntry['permissions'] & ~\OCP\Constants::PERMISSION_SHARE; |
|
1534 | - } |
|
1535 | - |
|
1536 | - $owner = $this->getUserObjectForOwner($subStorage->getOwner('')); |
|
1537 | - $files[$rootEntry->getName()] = new FileInfo($path . '/' . $rootEntry['name'], $subStorage, '', $rootEntry, $mount, $owner); |
|
1538 | - } |
|
1539 | - } |
|
1540 | - } |
|
1541 | - } |
|
1542 | - |
|
1543 | - if ($mimetype_filter) { |
|
1544 | - $files = array_filter($files, function (FileInfo $file) use ($mimetype_filter) { |
|
1545 | - if (strpos($mimetype_filter, '/')) { |
|
1546 | - return $file->getMimetype() === $mimetype_filter; |
|
1547 | - } else { |
|
1548 | - return $file->getMimePart() === $mimetype_filter; |
|
1549 | - } |
|
1550 | - }); |
|
1551 | - } |
|
1552 | - |
|
1553 | - return array_values($files); |
|
1554 | - } else { |
|
1555 | - return []; |
|
1556 | - } |
|
1557 | - } |
|
1558 | - |
|
1559 | - /** |
|
1560 | - * change file metadata |
|
1561 | - * |
|
1562 | - * @param string $path |
|
1563 | - * @param array|\OCP\Files\FileInfo $data |
|
1564 | - * @return int |
|
1565 | - * |
|
1566 | - * returns the fileid of the updated file |
|
1567 | - */ |
|
1568 | - public function putFileInfo($path, $data) { |
|
1569 | - $this->assertPathLength($path); |
|
1570 | - if ($data instanceof FileInfo) { |
|
1571 | - $data = $data->getData(); |
|
1572 | - } |
|
1573 | - $path = Filesystem::normalizePath($this->fakeRoot . '/' . $path); |
|
1574 | - /** |
|
1575 | - * @var \OC\Files\Storage\Storage $storage |
|
1576 | - * @var string $internalPath |
|
1577 | - */ |
|
1578 | - [$storage, $internalPath] = Filesystem::resolvePath($path); |
|
1579 | - if ($storage) { |
|
1580 | - $cache = $storage->getCache($path); |
|
1581 | - |
|
1582 | - if (!$cache->inCache($internalPath)) { |
|
1583 | - $scanner = $storage->getScanner($internalPath); |
|
1584 | - $scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW); |
|
1585 | - } |
|
1586 | - |
|
1587 | - return $cache->put($internalPath, $data); |
|
1588 | - } else { |
|
1589 | - return -1; |
|
1590 | - } |
|
1591 | - } |
|
1592 | - |
|
1593 | - /** |
|
1594 | - * search for files with the name matching $query |
|
1595 | - * |
|
1596 | - * @param string $query |
|
1597 | - * @return FileInfo[] |
|
1598 | - */ |
|
1599 | - public function search($query) { |
|
1600 | - return $this->searchCommon('search', ['%' . $query . '%']); |
|
1601 | - } |
|
1602 | - |
|
1603 | - /** |
|
1604 | - * search for files with the name matching $query |
|
1605 | - * |
|
1606 | - * @param string $query |
|
1607 | - * @return FileInfo[] |
|
1608 | - */ |
|
1609 | - public function searchRaw($query) { |
|
1610 | - return $this->searchCommon('search', [$query]); |
|
1611 | - } |
|
1612 | - |
|
1613 | - /** |
|
1614 | - * search for files by mimetype |
|
1615 | - * |
|
1616 | - * @param string $mimetype |
|
1617 | - * @return FileInfo[] |
|
1618 | - */ |
|
1619 | - public function searchByMime($mimetype) { |
|
1620 | - return $this->searchCommon('searchByMime', [$mimetype]); |
|
1621 | - } |
|
1622 | - |
|
1623 | - /** |
|
1624 | - * search for files by tag |
|
1625 | - * |
|
1626 | - * @param string|int $tag name or tag id |
|
1627 | - * @param string $userId owner of the tags |
|
1628 | - * @return FileInfo[] |
|
1629 | - */ |
|
1630 | - public function searchByTag($tag, $userId) { |
|
1631 | - return $this->searchCommon('searchByTag', [$tag, $userId]); |
|
1632 | - } |
|
1633 | - |
|
1634 | - /** |
|
1635 | - * @param string $method cache method |
|
1636 | - * @param array $args |
|
1637 | - * @return FileInfo[] |
|
1638 | - */ |
|
1639 | - private function searchCommon($method, $args) { |
|
1640 | - $files = []; |
|
1641 | - $rootLength = strlen($this->fakeRoot); |
|
1642 | - |
|
1643 | - $mount = $this->getMount(''); |
|
1644 | - $mountPoint = $mount->getMountPoint(); |
|
1645 | - $storage = $mount->getStorage(); |
|
1646 | - $userManager = \OC::$server->getUserManager(); |
|
1647 | - if ($storage) { |
|
1648 | - $cache = $storage->getCache(''); |
|
1649 | - |
|
1650 | - $results = call_user_func_array([$cache, $method], $args); |
|
1651 | - foreach ($results as $result) { |
|
1652 | - if (substr($mountPoint . $result['path'], 0, $rootLength + 1) === $this->fakeRoot . '/') { |
|
1653 | - $internalPath = $result['path']; |
|
1654 | - $path = $mountPoint . $result['path']; |
|
1655 | - $result['path'] = substr($mountPoint . $result['path'], $rootLength); |
|
1656 | - $owner = $userManager->get($storage->getOwner($internalPath)); |
|
1657 | - $files[] = new FileInfo($path, $storage, $internalPath, $result, $mount, $owner); |
|
1658 | - } |
|
1659 | - } |
|
1660 | - |
|
1661 | - $mounts = Filesystem::getMountManager()->findIn($this->fakeRoot); |
|
1662 | - foreach ($mounts as $mount) { |
|
1663 | - $mountPoint = $mount->getMountPoint(); |
|
1664 | - $storage = $mount->getStorage(); |
|
1665 | - if ($storage) { |
|
1666 | - $cache = $storage->getCache(''); |
|
1667 | - |
|
1668 | - $relativeMountPoint = substr($mountPoint, $rootLength); |
|
1669 | - $results = call_user_func_array([$cache, $method], $args); |
|
1670 | - if ($results) { |
|
1671 | - foreach ($results as $result) { |
|
1672 | - $internalPath = $result['path']; |
|
1673 | - $result['path'] = rtrim($relativeMountPoint . $result['path'], '/'); |
|
1674 | - $path = rtrim($mountPoint . $internalPath, '/'); |
|
1675 | - $owner = $userManager->get($storage->getOwner($internalPath)); |
|
1676 | - $files[] = new FileInfo($path, $storage, $internalPath, $result, $mount, $owner); |
|
1677 | - } |
|
1678 | - } |
|
1679 | - } |
|
1680 | - } |
|
1681 | - } |
|
1682 | - return $files; |
|
1683 | - } |
|
1684 | - |
|
1685 | - /** |
|
1686 | - * Get the owner for a file or folder |
|
1687 | - * |
|
1688 | - * @param string $path |
|
1689 | - * @return string the user id of the owner |
|
1690 | - * @throws NotFoundException |
|
1691 | - */ |
|
1692 | - public function getOwner($path) { |
|
1693 | - $info = $this->getFileInfo($path); |
|
1694 | - if (!$info) { |
|
1695 | - throw new NotFoundException($path . ' not found while trying to get owner'); |
|
1696 | - } |
|
1697 | - |
|
1698 | - if ($info->getOwner() === null) { |
|
1699 | - throw new NotFoundException($path . ' has no owner'); |
|
1700 | - } |
|
1701 | - |
|
1702 | - return $info->getOwner()->getUID(); |
|
1703 | - } |
|
1704 | - |
|
1705 | - /** |
|
1706 | - * get the ETag for a file or folder |
|
1707 | - * |
|
1708 | - * @param string $path |
|
1709 | - * @return string |
|
1710 | - */ |
|
1711 | - public function getETag($path) { |
|
1712 | - /** |
|
1713 | - * @var Storage\Storage $storage |
|
1714 | - * @var string $internalPath |
|
1715 | - */ |
|
1716 | - [$storage, $internalPath] = $this->resolvePath($path); |
|
1717 | - if ($storage) { |
|
1718 | - return $storage->getETag($internalPath); |
|
1719 | - } else { |
|
1720 | - return null; |
|
1721 | - } |
|
1722 | - } |
|
1723 | - |
|
1724 | - /** |
|
1725 | - * Get the path of a file by id, relative to the view |
|
1726 | - * |
|
1727 | - * Note that the resulting path is not guarantied to be unique for the id, multiple paths can point to the same file |
|
1728 | - * |
|
1729 | - * @param int $id |
|
1730 | - * @param int|null $storageId |
|
1731 | - * @return string |
|
1732 | - * @throws NotFoundException |
|
1733 | - */ |
|
1734 | - public function getPath($id, int $storageId = null) { |
|
1735 | - $id = (int)$id; |
|
1736 | - $manager = Filesystem::getMountManager(); |
|
1737 | - $mounts = $manager->findIn($this->fakeRoot); |
|
1738 | - $mounts[] = $manager->find($this->fakeRoot); |
|
1739 | - $mounts = array_filter($mounts); |
|
1740 | - // reverse the array, so we start with the storage this view is in |
|
1741 | - // which is the most likely to contain the file we're looking for |
|
1742 | - $mounts = array_reverse($mounts); |
|
1743 | - |
|
1744 | - // put non-shared mounts in front of the shared mount |
|
1745 | - // this prevents unneeded recursion into shares |
|
1746 | - usort($mounts, function (IMountPoint $a, IMountPoint $b) { |
|
1747 | - return $a instanceof SharedMount && (!$b instanceof SharedMount) ? 1 : -1; |
|
1748 | - }); |
|
1749 | - |
|
1750 | - if (!is_null($storageId)) { |
|
1751 | - $mounts = array_filter($mounts, function (IMountPoint $mount) use ($storageId) { |
|
1752 | - return $mount->getNumericStorageId() === $storageId; |
|
1753 | - }); |
|
1754 | - } |
|
1755 | - |
|
1756 | - foreach ($mounts as $mount) { |
|
1757 | - /** |
|
1758 | - * @var \OC\Files\Mount\MountPoint $mount |
|
1759 | - */ |
|
1760 | - if ($mount->getStorage()) { |
|
1761 | - $cache = $mount->getStorage()->getCache(); |
|
1762 | - $internalPath = $cache->getPathById($id); |
|
1763 | - if (is_string($internalPath)) { |
|
1764 | - $fullPath = $mount->getMountPoint() . $internalPath; |
|
1765 | - if (!is_null($path = $this->getRelativePath($fullPath))) { |
|
1766 | - return $path; |
|
1767 | - } |
|
1768 | - } |
|
1769 | - } |
|
1770 | - } |
|
1771 | - throw new NotFoundException(sprintf('File with id "%s" has not been found.', $id)); |
|
1772 | - } |
|
1773 | - |
|
1774 | - /** |
|
1775 | - * @param string $path |
|
1776 | - * @throws InvalidPathException |
|
1777 | - */ |
|
1778 | - private function assertPathLength($path) { |
|
1779 | - $maxLen = min(PHP_MAXPATHLEN, 4000); |
|
1780 | - // Check for the string length - performed using isset() instead of strlen() |
|
1781 | - // because isset() is about 5x-40x faster. |
|
1782 | - if (isset($path[$maxLen])) { |
|
1783 | - $pathLen = strlen($path); |
|
1784 | - throw new \OCP\Files\InvalidPathException("Path length($pathLen) exceeds max path length($maxLen): $path"); |
|
1785 | - } |
|
1786 | - } |
|
1787 | - |
|
1788 | - /** |
|
1789 | - * check if it is allowed to move a mount point to a given target. |
|
1790 | - * It is not allowed to move a mount point into a different mount point or |
|
1791 | - * into an already shared folder |
|
1792 | - * |
|
1793 | - * @param IStorage $targetStorage |
|
1794 | - * @param string $targetInternalPath |
|
1795 | - * @return boolean |
|
1796 | - */ |
|
1797 | - private function targetIsNotShared(IStorage $targetStorage, string $targetInternalPath) { |
|
1798 | - |
|
1799 | - // note: cannot use the view because the target is already locked |
|
1800 | - $fileId = (int)$targetStorage->getCache()->getId($targetInternalPath); |
|
1801 | - if ($fileId === -1) { |
|
1802 | - // target might not exist, need to check parent instead |
|
1803 | - $fileId = (int)$targetStorage->getCache()->getId(dirname($targetInternalPath)); |
|
1804 | - } |
|
1805 | - |
|
1806 | - // check if any of the parents were shared by the current owner (include collections) |
|
1807 | - $shares = \OCP\Share::getItemShared( |
|
1808 | - 'folder', |
|
1809 | - $fileId, |
|
1810 | - \OCP\Share::FORMAT_NONE, |
|
1811 | - null, |
|
1812 | - true |
|
1813 | - ); |
|
1814 | - |
|
1815 | - if (count($shares) > 0) { |
|
1816 | - \OCP\Util::writeLog('files', |
|
1817 | - 'It is not allowed to move one mount point into a shared folder', |
|
1818 | - ILogger::DEBUG); |
|
1819 | - return false; |
|
1820 | - } |
|
1821 | - |
|
1822 | - return true; |
|
1823 | - } |
|
1824 | - |
|
1825 | - /** |
|
1826 | - * Get a fileinfo object for files that are ignored in the cache (part files) |
|
1827 | - * |
|
1828 | - * @param string $path |
|
1829 | - * @return \OCP\Files\FileInfo |
|
1830 | - */ |
|
1831 | - private function getPartFileInfo($path) { |
|
1832 | - $mount = $this->getMount($path); |
|
1833 | - $storage = $mount->getStorage(); |
|
1834 | - $internalPath = $mount->getInternalPath($this->getAbsolutePath($path)); |
|
1835 | - $owner = \OC::$server->getUserManager()->get($storage->getOwner($internalPath)); |
|
1836 | - return new FileInfo( |
|
1837 | - $this->getAbsolutePath($path), |
|
1838 | - $storage, |
|
1839 | - $internalPath, |
|
1840 | - [ |
|
1841 | - 'fileid' => null, |
|
1842 | - 'mimetype' => $storage->getMimeType($internalPath), |
|
1843 | - 'name' => basename($path), |
|
1844 | - 'etag' => null, |
|
1845 | - 'size' => $storage->filesize($internalPath), |
|
1846 | - 'mtime' => $storage->filemtime($internalPath), |
|
1847 | - 'encrypted' => false, |
|
1848 | - 'permissions' => \OCP\Constants::PERMISSION_ALL |
|
1849 | - ], |
|
1850 | - $mount, |
|
1851 | - $owner |
|
1852 | - ); |
|
1853 | - } |
|
1854 | - |
|
1855 | - /** |
|
1856 | - * @param string $path |
|
1857 | - * @param string $fileName |
|
1858 | - * @throws InvalidPathException |
|
1859 | - */ |
|
1860 | - public function verifyPath($path, $fileName) { |
|
1861 | - try { |
|
1862 | - /** @type \OCP\Files\Storage $storage */ |
|
1863 | - [$storage, $internalPath] = $this->resolvePath($path); |
|
1864 | - $storage->verifyPath($internalPath, $fileName); |
|
1865 | - } catch (ReservedWordException $ex) { |
|
1866 | - $l = \OC::$server->getL10N('lib'); |
|
1867 | - throw new InvalidPathException($l->t('File name is a reserved word')); |
|
1868 | - } catch (InvalidCharacterInPathException $ex) { |
|
1869 | - $l = \OC::$server->getL10N('lib'); |
|
1870 | - throw new InvalidPathException($l->t('File name contains at least one invalid character')); |
|
1871 | - } catch (FileNameTooLongException $ex) { |
|
1872 | - $l = \OC::$server->getL10N('lib'); |
|
1873 | - throw new InvalidPathException($l->t('File name is too long')); |
|
1874 | - } catch (InvalidDirectoryException $ex) { |
|
1875 | - $l = \OC::$server->getL10N('lib'); |
|
1876 | - throw new InvalidPathException($l->t('Dot files are not allowed')); |
|
1877 | - } catch (EmptyFileNameException $ex) { |
|
1878 | - $l = \OC::$server->getL10N('lib'); |
|
1879 | - throw new InvalidPathException($l->t('Empty filename is not allowed')); |
|
1880 | - } |
|
1881 | - } |
|
1882 | - |
|
1883 | - /** |
|
1884 | - * get all parent folders of $path |
|
1885 | - * |
|
1886 | - * @param string $path |
|
1887 | - * @return string[] |
|
1888 | - */ |
|
1889 | - private function getParents($path) { |
|
1890 | - $path = trim($path, '/'); |
|
1891 | - if (!$path) { |
|
1892 | - return []; |
|
1893 | - } |
|
1894 | - |
|
1895 | - $parts = explode('/', $path); |
|
1896 | - |
|
1897 | - // remove the single file |
|
1898 | - array_pop($parts); |
|
1899 | - $result = ['/']; |
|
1900 | - $resultPath = ''; |
|
1901 | - foreach ($parts as $part) { |
|
1902 | - if ($part) { |
|
1903 | - $resultPath .= '/' . $part; |
|
1904 | - $result[] = $resultPath; |
|
1905 | - } |
|
1906 | - } |
|
1907 | - return $result; |
|
1908 | - } |
|
1909 | - |
|
1910 | - /** |
|
1911 | - * Returns the mount point for which to lock |
|
1912 | - * |
|
1913 | - * @param string $absolutePath absolute path |
|
1914 | - * @param bool $useParentMount true to return parent mount instead of whatever |
|
1915 | - * is mounted directly on the given path, false otherwise |
|
1916 | - * @return IMountPoint mount point for which to apply locks |
|
1917 | - */ |
|
1918 | - private function getMountForLock($absolutePath, $useParentMount = false) { |
|
1919 | - $mount = Filesystem::getMountManager()->find($absolutePath); |
|
1920 | - |
|
1921 | - if ($useParentMount) { |
|
1922 | - // find out if something is mounted directly on the path |
|
1923 | - $internalPath = $mount->getInternalPath($absolutePath); |
|
1924 | - if ($internalPath === '') { |
|
1925 | - // resolve the parent mount instead |
|
1926 | - $mount = Filesystem::getMountManager()->find(dirname($absolutePath)); |
|
1927 | - } |
|
1928 | - } |
|
1929 | - |
|
1930 | - return $mount; |
|
1931 | - } |
|
1932 | - |
|
1933 | - /** |
|
1934 | - * Lock the given path |
|
1935 | - * |
|
1936 | - * @param string $path the path of the file to lock, relative to the view |
|
1937 | - * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
|
1938 | - * @param bool $lockMountPoint true to lock the mount point, false to lock the attached mount/storage |
|
1939 | - * |
|
1940 | - * @return bool False if the path is excluded from locking, true otherwise |
|
1941 | - * @throws LockedException if the path is already locked |
|
1942 | - */ |
|
1943 | - private function lockPath($path, $type, $lockMountPoint = false) { |
|
1944 | - $absolutePath = $this->getAbsolutePath($path); |
|
1945 | - $absolutePath = Filesystem::normalizePath($absolutePath); |
|
1946 | - if (!$this->shouldLockFile($absolutePath)) { |
|
1947 | - return false; |
|
1948 | - } |
|
1949 | - |
|
1950 | - $mount = $this->getMountForLock($absolutePath, $lockMountPoint); |
|
1951 | - if ($mount) { |
|
1952 | - try { |
|
1953 | - $storage = $mount->getStorage(); |
|
1954 | - if ($storage && $storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) { |
|
1955 | - $storage->acquireLock( |
|
1956 | - $mount->getInternalPath($absolutePath), |
|
1957 | - $type, |
|
1958 | - $this->lockingProvider |
|
1959 | - ); |
|
1960 | - } |
|
1961 | - } catch (LockedException $e) { |
|
1962 | - // rethrow with the a human-readable path |
|
1963 | - throw new LockedException( |
|
1964 | - $this->getPathRelativeToFiles($absolutePath), |
|
1965 | - $e, |
|
1966 | - $e->getExistingLock() |
|
1967 | - ); |
|
1968 | - } |
|
1969 | - } |
|
1970 | - |
|
1971 | - return true; |
|
1972 | - } |
|
1973 | - |
|
1974 | - /** |
|
1975 | - * Change the lock type |
|
1976 | - * |
|
1977 | - * @param string $path the path of the file to lock, relative to the view |
|
1978 | - * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
|
1979 | - * @param bool $lockMountPoint true to lock the mount point, false to lock the attached mount/storage |
|
1980 | - * |
|
1981 | - * @return bool False if the path is excluded from locking, true otherwise |
|
1982 | - * @throws LockedException if the path is already locked |
|
1983 | - */ |
|
1984 | - public function changeLock($path, $type, $lockMountPoint = false) { |
|
1985 | - $path = Filesystem::normalizePath($path); |
|
1986 | - $absolutePath = $this->getAbsolutePath($path); |
|
1987 | - $absolutePath = Filesystem::normalizePath($absolutePath); |
|
1988 | - if (!$this->shouldLockFile($absolutePath)) { |
|
1989 | - return false; |
|
1990 | - } |
|
1991 | - |
|
1992 | - $mount = $this->getMountForLock($absolutePath, $lockMountPoint); |
|
1993 | - if ($mount) { |
|
1994 | - try { |
|
1995 | - $storage = $mount->getStorage(); |
|
1996 | - if ($storage && $storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) { |
|
1997 | - $storage->changeLock( |
|
1998 | - $mount->getInternalPath($absolutePath), |
|
1999 | - $type, |
|
2000 | - $this->lockingProvider |
|
2001 | - ); |
|
2002 | - } |
|
2003 | - } catch (LockedException $e) { |
|
2004 | - try { |
|
2005 | - // rethrow with the a human-readable path |
|
2006 | - throw new LockedException( |
|
2007 | - $this->getPathRelativeToFiles($absolutePath), |
|
2008 | - $e, |
|
2009 | - $e->getExistingLock() |
|
2010 | - ); |
|
2011 | - } catch (\InvalidArgumentException $ex) { |
|
2012 | - throw new LockedException( |
|
2013 | - $absolutePath, |
|
2014 | - $ex, |
|
2015 | - $e->getExistingLock() |
|
2016 | - ); |
|
2017 | - } |
|
2018 | - } |
|
2019 | - } |
|
2020 | - |
|
2021 | - return true; |
|
2022 | - } |
|
2023 | - |
|
2024 | - /** |
|
2025 | - * Unlock the given path |
|
2026 | - * |
|
2027 | - * @param string $path the path of the file to unlock, relative to the view |
|
2028 | - * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
|
2029 | - * @param bool $lockMountPoint true to lock the mount point, false to lock the attached mount/storage |
|
2030 | - * |
|
2031 | - * @return bool False if the path is excluded from locking, true otherwise |
|
2032 | - * @throws LockedException |
|
2033 | - */ |
|
2034 | - private function unlockPath($path, $type, $lockMountPoint = false) { |
|
2035 | - $absolutePath = $this->getAbsolutePath($path); |
|
2036 | - $absolutePath = Filesystem::normalizePath($absolutePath); |
|
2037 | - if (!$this->shouldLockFile($absolutePath)) { |
|
2038 | - return false; |
|
2039 | - } |
|
2040 | - |
|
2041 | - $mount = $this->getMountForLock($absolutePath, $lockMountPoint); |
|
2042 | - if ($mount) { |
|
2043 | - $storage = $mount->getStorage(); |
|
2044 | - if ($storage && $storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) { |
|
2045 | - $storage->releaseLock( |
|
2046 | - $mount->getInternalPath($absolutePath), |
|
2047 | - $type, |
|
2048 | - $this->lockingProvider |
|
2049 | - ); |
|
2050 | - } |
|
2051 | - } |
|
2052 | - |
|
2053 | - return true; |
|
2054 | - } |
|
2055 | - |
|
2056 | - /** |
|
2057 | - * Lock a path and all its parents up to the root of the view |
|
2058 | - * |
|
2059 | - * @param string $path the path of the file to lock relative to the view |
|
2060 | - * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
|
2061 | - * @param bool $lockMountPoint true to lock the mount point, false to lock the attached mount/storage |
|
2062 | - * |
|
2063 | - * @return bool False if the path is excluded from locking, true otherwise |
|
2064 | - * @throws LockedException |
|
2065 | - */ |
|
2066 | - public function lockFile($path, $type, $lockMountPoint = false) { |
|
2067 | - $absolutePath = $this->getAbsolutePath($path); |
|
2068 | - $absolutePath = Filesystem::normalizePath($absolutePath); |
|
2069 | - if (!$this->shouldLockFile($absolutePath)) { |
|
2070 | - return false; |
|
2071 | - } |
|
2072 | - |
|
2073 | - $this->lockPath($path, $type, $lockMountPoint); |
|
2074 | - |
|
2075 | - $parents = $this->getParents($path); |
|
2076 | - foreach ($parents as $parent) { |
|
2077 | - $this->lockPath($parent, ILockingProvider::LOCK_SHARED); |
|
2078 | - } |
|
2079 | - |
|
2080 | - return true; |
|
2081 | - } |
|
2082 | - |
|
2083 | - /** |
|
2084 | - * Unlock a path and all its parents up to the root of the view |
|
2085 | - * |
|
2086 | - * @param string $path the path of the file to lock relative to the view |
|
2087 | - * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
|
2088 | - * @param bool $lockMountPoint true to lock the mount point, false to lock the attached mount/storage |
|
2089 | - * |
|
2090 | - * @return bool False if the path is excluded from locking, true otherwise |
|
2091 | - * @throws LockedException |
|
2092 | - */ |
|
2093 | - public function unlockFile($path, $type, $lockMountPoint = false) { |
|
2094 | - $absolutePath = $this->getAbsolutePath($path); |
|
2095 | - $absolutePath = Filesystem::normalizePath($absolutePath); |
|
2096 | - if (!$this->shouldLockFile($absolutePath)) { |
|
2097 | - return false; |
|
2098 | - } |
|
2099 | - |
|
2100 | - $this->unlockPath($path, $type, $lockMountPoint); |
|
2101 | - |
|
2102 | - $parents = $this->getParents($path); |
|
2103 | - foreach ($parents as $parent) { |
|
2104 | - $this->unlockPath($parent, ILockingProvider::LOCK_SHARED); |
|
2105 | - } |
|
2106 | - |
|
2107 | - return true; |
|
2108 | - } |
|
2109 | - |
|
2110 | - /** |
|
2111 | - * Only lock files in data/user/files/ |
|
2112 | - * |
|
2113 | - * @param string $path Absolute path to the file/folder we try to (un)lock |
|
2114 | - * @return bool |
|
2115 | - */ |
|
2116 | - protected function shouldLockFile($path) { |
|
2117 | - $path = Filesystem::normalizePath($path); |
|
2118 | - |
|
2119 | - $pathSegments = explode('/', $path); |
|
2120 | - if (isset($pathSegments[2])) { |
|
2121 | - // E.g.: /username/files/path-to-file |
|
2122 | - return ($pathSegments[2] === 'files') && (count($pathSegments) > 3); |
|
2123 | - } |
|
2124 | - |
|
2125 | - return strpos($path, '/appdata_') !== 0; |
|
2126 | - } |
|
2127 | - |
|
2128 | - /** |
|
2129 | - * Shortens the given absolute path to be relative to |
|
2130 | - * "$user/files". |
|
2131 | - * |
|
2132 | - * @param string $absolutePath absolute path which is under "files" |
|
2133 | - * |
|
2134 | - * @return string path relative to "files" with trimmed slashes or null |
|
2135 | - * if the path was NOT relative to files |
|
2136 | - * |
|
2137 | - * @throws \InvalidArgumentException if the given path was not under "files" |
|
2138 | - * @since 8.1.0 |
|
2139 | - */ |
|
2140 | - public function getPathRelativeToFiles($absolutePath) { |
|
2141 | - $path = Filesystem::normalizePath($absolutePath); |
|
2142 | - $parts = explode('/', trim($path, '/'), 3); |
|
2143 | - // "$user", "files", "path/to/dir" |
|
2144 | - if (!isset($parts[1]) || $parts[1] !== 'files') { |
|
2145 | - $this->logger->error( |
|
2146 | - '$absolutePath must be relative to "files", value is "%s"', |
|
2147 | - [ |
|
2148 | - $absolutePath |
|
2149 | - ] |
|
2150 | - ); |
|
2151 | - throw new \InvalidArgumentException('$absolutePath must be relative to "files"'); |
|
2152 | - } |
|
2153 | - if (isset($parts[2])) { |
|
2154 | - return $parts[2]; |
|
2155 | - } |
|
2156 | - return ''; |
|
2157 | - } |
|
2158 | - |
|
2159 | - /** |
|
2160 | - * @param string $filename |
|
2161 | - * @return array |
|
2162 | - * @throws \OC\User\NoUserException |
|
2163 | - * @throws NotFoundException |
|
2164 | - */ |
|
2165 | - public function getUidAndFilename($filename) { |
|
2166 | - $info = $this->getFileInfo($filename); |
|
2167 | - if (!$info instanceof \OCP\Files\FileInfo) { |
|
2168 | - throw new NotFoundException($this->getAbsolutePath($filename) . ' not found'); |
|
2169 | - } |
|
2170 | - $uid = $info->getOwner()->getUID(); |
|
2171 | - if ($uid != \OC_User::getUser()) { |
|
2172 | - Filesystem::initMountPoints($uid); |
|
2173 | - $ownerView = new View('/' . $uid . '/files'); |
|
2174 | - try { |
|
2175 | - $filename = $ownerView->getPath($info['fileid']); |
|
2176 | - } catch (NotFoundException $e) { |
|
2177 | - throw new NotFoundException('File with id ' . $info['fileid'] . ' not found for user ' . $uid); |
|
2178 | - } |
|
2179 | - } |
|
2180 | - return [$uid, $filename]; |
|
2181 | - } |
|
2182 | - |
|
2183 | - /** |
|
2184 | - * Creates parent non-existing folders |
|
2185 | - * |
|
2186 | - * @param string $filePath |
|
2187 | - * @return bool |
|
2188 | - */ |
|
2189 | - private function createParentDirectories($filePath) { |
|
2190 | - $directoryParts = explode('/', $filePath); |
|
2191 | - $directoryParts = array_filter($directoryParts); |
|
2192 | - foreach ($directoryParts as $key => $part) { |
|
2193 | - $currentPathElements = array_slice($directoryParts, 0, $key); |
|
2194 | - $currentPath = '/' . implode('/', $currentPathElements); |
|
2195 | - if ($this->is_file($currentPath)) { |
|
2196 | - return false; |
|
2197 | - } |
|
2198 | - if (!$this->file_exists($currentPath)) { |
|
2199 | - $this->mkdir($currentPath); |
|
2200 | - } |
|
2201 | - } |
|
2202 | - |
|
2203 | - return true; |
|
2204 | - } |
|
87 | + /** @var string */ |
|
88 | + private $fakeRoot = ''; |
|
89 | + |
|
90 | + /** |
|
91 | + * @var \OCP\Lock\ILockingProvider |
|
92 | + */ |
|
93 | + protected $lockingProvider; |
|
94 | + |
|
95 | + private $lockingEnabled; |
|
96 | + |
|
97 | + private $updaterEnabled = true; |
|
98 | + |
|
99 | + /** @var \OC\User\Manager */ |
|
100 | + private $userManager; |
|
101 | + |
|
102 | + /** @var \OCP\ILogger */ |
|
103 | + private $logger; |
|
104 | + |
|
105 | + /** |
|
106 | + * @param string $root |
|
107 | + * @throws \Exception If $root contains an invalid path |
|
108 | + */ |
|
109 | + public function __construct($root = '') { |
|
110 | + if (is_null($root)) { |
|
111 | + throw new \InvalidArgumentException('Root can\'t be null'); |
|
112 | + } |
|
113 | + if (!Filesystem::isValidPath($root)) { |
|
114 | + throw new \Exception(); |
|
115 | + } |
|
116 | + |
|
117 | + $this->fakeRoot = $root; |
|
118 | + $this->lockingProvider = \OC::$server->getLockingProvider(); |
|
119 | + $this->lockingEnabled = !($this->lockingProvider instanceof \OC\Lock\NoopLockingProvider); |
|
120 | + $this->userManager = \OC::$server->getUserManager(); |
|
121 | + $this->logger = \OC::$server->getLogger(); |
|
122 | + } |
|
123 | + |
|
124 | + public function getAbsolutePath($path = '/') { |
|
125 | + if ($path === null) { |
|
126 | + return null; |
|
127 | + } |
|
128 | + $this->assertPathLength($path); |
|
129 | + if ($path === '') { |
|
130 | + $path = '/'; |
|
131 | + } |
|
132 | + if ($path[0] !== '/') { |
|
133 | + $path = '/' . $path; |
|
134 | + } |
|
135 | + return $this->fakeRoot . $path; |
|
136 | + } |
|
137 | + |
|
138 | + /** |
|
139 | + * change the root to a fake root |
|
140 | + * |
|
141 | + * @param string $fakeRoot |
|
142 | + * @return boolean|null |
|
143 | + */ |
|
144 | + public function chroot($fakeRoot) { |
|
145 | + if (!$fakeRoot == '') { |
|
146 | + if ($fakeRoot[0] !== '/') { |
|
147 | + $fakeRoot = '/' . $fakeRoot; |
|
148 | + } |
|
149 | + } |
|
150 | + $this->fakeRoot = $fakeRoot; |
|
151 | + } |
|
152 | + |
|
153 | + /** |
|
154 | + * get the fake root |
|
155 | + * |
|
156 | + * @return string |
|
157 | + */ |
|
158 | + public function getRoot() { |
|
159 | + return $this->fakeRoot; |
|
160 | + } |
|
161 | + |
|
162 | + /** |
|
163 | + * get path relative to the root of the view |
|
164 | + * |
|
165 | + * @param string $path |
|
166 | + * @return string |
|
167 | + */ |
|
168 | + public function getRelativePath($path) { |
|
169 | + $this->assertPathLength($path); |
|
170 | + if ($this->fakeRoot == '') { |
|
171 | + return $path; |
|
172 | + } |
|
173 | + |
|
174 | + if (rtrim($path, '/') === rtrim($this->fakeRoot, '/')) { |
|
175 | + return '/'; |
|
176 | + } |
|
177 | + |
|
178 | + // missing slashes can cause wrong matches! |
|
179 | + $root = rtrim($this->fakeRoot, '/') . '/'; |
|
180 | + |
|
181 | + if (strpos($path, $root) !== 0) { |
|
182 | + return null; |
|
183 | + } else { |
|
184 | + $path = substr($path, strlen($this->fakeRoot)); |
|
185 | + if (strlen($path) === 0) { |
|
186 | + return '/'; |
|
187 | + } else { |
|
188 | + return $path; |
|
189 | + } |
|
190 | + } |
|
191 | + } |
|
192 | + |
|
193 | + /** |
|
194 | + * get the mountpoint of the storage object for a path |
|
195 | + * ( note: because a storage is not always mounted inside the fakeroot, the |
|
196 | + * returned mountpoint is relative to the absolute root of the filesystem |
|
197 | + * and does not take the chroot into account ) |
|
198 | + * |
|
199 | + * @param string $path |
|
200 | + * @return string |
|
201 | + */ |
|
202 | + public function getMountPoint($path) { |
|
203 | + return Filesystem::getMountPoint($this->getAbsolutePath($path)); |
|
204 | + } |
|
205 | + |
|
206 | + /** |
|
207 | + * get the mountpoint of the storage object for a path |
|
208 | + * ( note: because a storage is not always mounted inside the fakeroot, the |
|
209 | + * returned mountpoint is relative to the absolute root of the filesystem |
|
210 | + * and does not take the chroot into account ) |
|
211 | + * |
|
212 | + * @param string $path |
|
213 | + * @return \OCP\Files\Mount\IMountPoint |
|
214 | + */ |
|
215 | + public function getMount($path) { |
|
216 | + return Filesystem::getMountManager()->find($this->getAbsolutePath($path)); |
|
217 | + } |
|
218 | + |
|
219 | + /** |
|
220 | + * resolve a path to a storage and internal path |
|
221 | + * |
|
222 | + * @param string $path |
|
223 | + * @return array an array consisting of the storage and the internal path |
|
224 | + */ |
|
225 | + public function resolvePath($path) { |
|
226 | + $a = $this->getAbsolutePath($path); |
|
227 | + $p = Filesystem::normalizePath($a); |
|
228 | + return Filesystem::resolvePath($p); |
|
229 | + } |
|
230 | + |
|
231 | + /** |
|
232 | + * return the path to a local version of the file |
|
233 | + * we need this because we can't know if a file is stored local or not from |
|
234 | + * outside the filestorage and for some purposes a local file is needed |
|
235 | + * |
|
236 | + * @param string $path |
|
237 | + * @return string |
|
238 | + */ |
|
239 | + public function getLocalFile($path) { |
|
240 | + $parent = substr($path, 0, strrpos($path, '/')); |
|
241 | + $path = $this->getAbsolutePath($path); |
|
242 | + [$storage, $internalPath] = Filesystem::resolvePath($path); |
|
243 | + if (Filesystem::isValidPath($parent) and $storage) { |
|
244 | + return $storage->getLocalFile($internalPath); |
|
245 | + } else { |
|
246 | + return null; |
|
247 | + } |
|
248 | + } |
|
249 | + |
|
250 | + /** |
|
251 | + * @param string $path |
|
252 | + * @return string |
|
253 | + */ |
|
254 | + public function getLocalFolder($path) { |
|
255 | + $parent = substr($path, 0, strrpos($path, '/')); |
|
256 | + $path = $this->getAbsolutePath($path); |
|
257 | + [$storage, $internalPath] = Filesystem::resolvePath($path); |
|
258 | + if (Filesystem::isValidPath($parent) and $storage) { |
|
259 | + return $storage->getLocalFolder($internalPath); |
|
260 | + } else { |
|
261 | + return null; |
|
262 | + } |
|
263 | + } |
|
264 | + |
|
265 | + /** |
|
266 | + * the following functions operate with arguments and return values identical |
|
267 | + * to those of their PHP built-in equivalents. Mostly they are merely wrappers |
|
268 | + * for \OC\Files\Storage\Storage via basicOperation(). |
|
269 | + */ |
|
270 | + public function mkdir($path) { |
|
271 | + return $this->basicOperation('mkdir', $path, ['create', 'write']); |
|
272 | + } |
|
273 | + |
|
274 | + /** |
|
275 | + * remove mount point |
|
276 | + * |
|
277 | + * @param IMountPoint $mount |
|
278 | + * @param string $path relative to data/ |
|
279 | + * @return boolean |
|
280 | + */ |
|
281 | + protected function removeMount($mount, $path) { |
|
282 | + if ($mount instanceof MoveableMount) { |
|
283 | + // cut of /user/files to get the relative path to data/user/files |
|
284 | + $pathParts = explode('/', $path, 4); |
|
285 | + $relPath = '/' . $pathParts[3]; |
|
286 | + $this->lockFile($relPath, ILockingProvider::LOCK_SHARED, true); |
|
287 | + \OC_Hook::emit( |
|
288 | + Filesystem::CLASSNAME, "umount", |
|
289 | + [Filesystem::signal_param_path => $relPath] |
|
290 | + ); |
|
291 | + $this->changeLock($relPath, ILockingProvider::LOCK_EXCLUSIVE, true); |
|
292 | + $result = $mount->removeMount(); |
|
293 | + $this->changeLock($relPath, ILockingProvider::LOCK_SHARED, true); |
|
294 | + if ($result) { |
|
295 | + \OC_Hook::emit( |
|
296 | + Filesystem::CLASSNAME, "post_umount", |
|
297 | + [Filesystem::signal_param_path => $relPath] |
|
298 | + ); |
|
299 | + } |
|
300 | + $this->unlockFile($relPath, ILockingProvider::LOCK_SHARED, true); |
|
301 | + return $result; |
|
302 | + } else { |
|
303 | + // do not allow deleting the storage's root / the mount point |
|
304 | + // because for some storages it might delete the whole contents |
|
305 | + // but isn't supposed to work that way |
|
306 | + return false; |
|
307 | + } |
|
308 | + } |
|
309 | + |
|
310 | + public function disableCacheUpdate() { |
|
311 | + $this->updaterEnabled = false; |
|
312 | + } |
|
313 | + |
|
314 | + public function enableCacheUpdate() { |
|
315 | + $this->updaterEnabled = true; |
|
316 | + } |
|
317 | + |
|
318 | + protected function writeUpdate(Storage $storage, $internalPath, $time = null) { |
|
319 | + if ($this->updaterEnabled) { |
|
320 | + if (is_null($time)) { |
|
321 | + $time = time(); |
|
322 | + } |
|
323 | + $storage->getUpdater()->update($internalPath, $time); |
|
324 | + } |
|
325 | + } |
|
326 | + |
|
327 | + protected function removeUpdate(Storage $storage, $internalPath) { |
|
328 | + if ($this->updaterEnabled) { |
|
329 | + $storage->getUpdater()->remove($internalPath); |
|
330 | + } |
|
331 | + } |
|
332 | + |
|
333 | + protected function renameUpdate(Storage $sourceStorage, Storage $targetStorage, $sourceInternalPath, $targetInternalPath) { |
|
334 | + if ($this->updaterEnabled) { |
|
335 | + $targetStorage->getUpdater()->renameFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath); |
|
336 | + } |
|
337 | + } |
|
338 | + |
|
339 | + /** |
|
340 | + * @param string $path |
|
341 | + * @return bool|mixed |
|
342 | + */ |
|
343 | + public function rmdir($path) { |
|
344 | + $absolutePath = $this->getAbsolutePath($path); |
|
345 | + $mount = Filesystem::getMountManager()->find($absolutePath); |
|
346 | + if ($mount->getInternalPath($absolutePath) === '') { |
|
347 | + return $this->removeMount($mount, $absolutePath); |
|
348 | + } |
|
349 | + if ($this->is_dir($path)) { |
|
350 | + $result = $this->basicOperation('rmdir', $path, ['delete']); |
|
351 | + } else { |
|
352 | + $result = false; |
|
353 | + } |
|
354 | + |
|
355 | + if (!$result && !$this->file_exists($path)) { //clear ghost files from the cache on delete |
|
356 | + $storage = $mount->getStorage(); |
|
357 | + $internalPath = $mount->getInternalPath($absolutePath); |
|
358 | + $storage->getUpdater()->remove($internalPath); |
|
359 | + } |
|
360 | + return $result; |
|
361 | + } |
|
362 | + |
|
363 | + /** |
|
364 | + * @param string $path |
|
365 | + * @return resource |
|
366 | + */ |
|
367 | + public function opendir($path) { |
|
368 | + return $this->basicOperation('opendir', $path, ['read']); |
|
369 | + } |
|
370 | + |
|
371 | + /** |
|
372 | + * @param string $path |
|
373 | + * @return bool|mixed |
|
374 | + */ |
|
375 | + public function is_dir($path) { |
|
376 | + if ($path == '/') { |
|
377 | + return true; |
|
378 | + } |
|
379 | + return $this->basicOperation('is_dir', $path); |
|
380 | + } |
|
381 | + |
|
382 | + /** |
|
383 | + * @param string $path |
|
384 | + * @return bool|mixed |
|
385 | + */ |
|
386 | + public function is_file($path) { |
|
387 | + if ($path == '/') { |
|
388 | + return false; |
|
389 | + } |
|
390 | + return $this->basicOperation('is_file', $path); |
|
391 | + } |
|
392 | + |
|
393 | + /** |
|
394 | + * @param string $path |
|
395 | + * @return mixed |
|
396 | + */ |
|
397 | + public function stat($path) { |
|
398 | + return $this->basicOperation('stat', $path); |
|
399 | + } |
|
400 | + |
|
401 | + /** |
|
402 | + * @param string $path |
|
403 | + * @return mixed |
|
404 | + */ |
|
405 | + public function filetype($path) { |
|
406 | + return $this->basicOperation('filetype', $path); |
|
407 | + } |
|
408 | + |
|
409 | + /** |
|
410 | + * @param string $path |
|
411 | + * @return mixed |
|
412 | + */ |
|
413 | + public function filesize($path) { |
|
414 | + return $this->basicOperation('filesize', $path); |
|
415 | + } |
|
416 | + |
|
417 | + /** |
|
418 | + * @param string $path |
|
419 | + * @return bool|mixed |
|
420 | + * @throws \OCP\Files\InvalidPathException |
|
421 | + */ |
|
422 | + public function readfile($path) { |
|
423 | + $this->assertPathLength($path); |
|
424 | + if (ob_get_level()) { |
|
425 | + ob_end_clean(); |
|
426 | + } |
|
427 | + $handle = $this->fopen($path, 'rb'); |
|
428 | + if ($handle) { |
|
429 | + $chunkSize = 524288; // 512 kB chunks |
|
430 | + while (!feof($handle)) { |
|
431 | + echo fread($handle, $chunkSize); |
|
432 | + flush(); |
|
433 | + } |
|
434 | + fclose($handle); |
|
435 | + return $this->filesize($path); |
|
436 | + } |
|
437 | + return false; |
|
438 | + } |
|
439 | + |
|
440 | + /** |
|
441 | + * @param string $path |
|
442 | + * @param int $from |
|
443 | + * @param int $to |
|
444 | + * @return bool|mixed |
|
445 | + * @throws \OCP\Files\InvalidPathException |
|
446 | + * @throws \OCP\Files\UnseekableException |
|
447 | + */ |
|
448 | + public function readfilePart($path, $from, $to) { |
|
449 | + $this->assertPathLength($path); |
|
450 | + if (ob_get_level()) { |
|
451 | + ob_end_clean(); |
|
452 | + } |
|
453 | + $handle = $this->fopen($path, 'rb'); |
|
454 | + if ($handle) { |
|
455 | + $chunkSize = 524288; // 512 kB chunks |
|
456 | + $startReading = true; |
|
457 | + |
|
458 | + if ($from !== 0 && $from !== '0' && fseek($handle, $from) !== 0) { |
|
459 | + // forward file handle via chunked fread because fseek seem to have failed |
|
460 | + |
|
461 | + $end = $from + 1; |
|
462 | + while (!feof($handle) && ftell($handle) < $end && ftell($handle) !== $from) { |
|
463 | + $len = $from - ftell($handle); |
|
464 | + if ($len > $chunkSize) { |
|
465 | + $len = $chunkSize; |
|
466 | + } |
|
467 | + $result = fread($handle, $len); |
|
468 | + |
|
469 | + if ($result === false) { |
|
470 | + $startReading = false; |
|
471 | + break; |
|
472 | + } |
|
473 | + } |
|
474 | + } |
|
475 | + |
|
476 | + if ($startReading) { |
|
477 | + $end = $to + 1; |
|
478 | + while (!feof($handle) && ftell($handle) < $end) { |
|
479 | + $len = $end - ftell($handle); |
|
480 | + if ($len > $chunkSize) { |
|
481 | + $len = $chunkSize; |
|
482 | + } |
|
483 | + echo fread($handle, $len); |
|
484 | + flush(); |
|
485 | + } |
|
486 | + return ftell($handle) - $from; |
|
487 | + } |
|
488 | + |
|
489 | + throw new \OCP\Files\UnseekableException('fseek error'); |
|
490 | + } |
|
491 | + return false; |
|
492 | + } |
|
493 | + |
|
494 | + /** |
|
495 | + * @param string $path |
|
496 | + * @return mixed |
|
497 | + */ |
|
498 | + public function isCreatable($path) { |
|
499 | + return $this->basicOperation('isCreatable', $path); |
|
500 | + } |
|
501 | + |
|
502 | + /** |
|
503 | + * @param string $path |
|
504 | + * @return mixed |
|
505 | + */ |
|
506 | + public function isReadable($path) { |
|
507 | + return $this->basicOperation('isReadable', $path); |
|
508 | + } |
|
509 | + |
|
510 | + /** |
|
511 | + * @param string $path |
|
512 | + * @return mixed |
|
513 | + */ |
|
514 | + public function isUpdatable($path) { |
|
515 | + return $this->basicOperation('isUpdatable', $path); |
|
516 | + } |
|
517 | + |
|
518 | + /** |
|
519 | + * @param string $path |
|
520 | + * @return bool|mixed |
|
521 | + */ |
|
522 | + public function isDeletable($path) { |
|
523 | + $absolutePath = $this->getAbsolutePath($path); |
|
524 | + $mount = Filesystem::getMountManager()->find($absolutePath); |
|
525 | + if ($mount->getInternalPath($absolutePath) === '') { |
|
526 | + return $mount instanceof MoveableMount; |
|
527 | + } |
|
528 | + return $this->basicOperation('isDeletable', $path); |
|
529 | + } |
|
530 | + |
|
531 | + /** |
|
532 | + * @param string $path |
|
533 | + * @return mixed |
|
534 | + */ |
|
535 | + public function isSharable($path) { |
|
536 | + return $this->basicOperation('isSharable', $path); |
|
537 | + } |
|
538 | + |
|
539 | + /** |
|
540 | + * @param string $path |
|
541 | + * @return bool|mixed |
|
542 | + */ |
|
543 | + public function file_exists($path) { |
|
544 | + if ($path == '/') { |
|
545 | + return true; |
|
546 | + } |
|
547 | + return $this->basicOperation('file_exists', $path); |
|
548 | + } |
|
549 | + |
|
550 | + /** |
|
551 | + * @param string $path |
|
552 | + * @return mixed |
|
553 | + */ |
|
554 | + public function filemtime($path) { |
|
555 | + return $this->basicOperation('filemtime', $path); |
|
556 | + } |
|
557 | + |
|
558 | + /** |
|
559 | + * @param string $path |
|
560 | + * @param int|string $mtime |
|
561 | + * @return bool |
|
562 | + */ |
|
563 | + public function touch($path, $mtime = null) { |
|
564 | + if (!is_null($mtime) and !is_numeric($mtime)) { |
|
565 | + $mtime = strtotime($mtime); |
|
566 | + } |
|
567 | + |
|
568 | + $hooks = ['touch']; |
|
569 | + |
|
570 | + if (!$this->file_exists($path)) { |
|
571 | + $hooks[] = 'create'; |
|
572 | + $hooks[] = 'write'; |
|
573 | + } |
|
574 | + try { |
|
575 | + $result = $this->basicOperation('touch', $path, $hooks, $mtime); |
|
576 | + } catch (\Exception $e) { |
|
577 | + $this->logger->logException($e, ['level' => ILogger::INFO, 'message' => 'Error while setting modified time']); |
|
578 | + $result = false; |
|
579 | + } |
|
580 | + if (!$result) { |
|
581 | + // If create file fails because of permissions on external storage like SMB folders, |
|
582 | + // check file exists and return false if not. |
|
583 | + if (!$this->file_exists($path)) { |
|
584 | + return false; |
|
585 | + } |
|
586 | + if (is_null($mtime)) { |
|
587 | + $mtime = time(); |
|
588 | + } |
|
589 | + //if native touch fails, we emulate it by changing the mtime in the cache |
|
590 | + $this->putFileInfo($path, ['mtime' => floor($mtime)]); |
|
591 | + } |
|
592 | + return true; |
|
593 | + } |
|
594 | + |
|
595 | + /** |
|
596 | + * @param string $path |
|
597 | + * @return mixed |
|
598 | + * @throws LockedException |
|
599 | + */ |
|
600 | + public function file_get_contents($path) { |
|
601 | + return $this->basicOperation('file_get_contents', $path, ['read']); |
|
602 | + } |
|
603 | + |
|
604 | + /** |
|
605 | + * @param bool $exists |
|
606 | + * @param string $path |
|
607 | + * @param bool $run |
|
608 | + */ |
|
609 | + protected function emit_file_hooks_pre($exists, $path, &$run) { |
|
610 | + if (!$exists) { |
|
611 | + \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_create, [ |
|
612 | + Filesystem::signal_param_path => $this->getHookPath($path), |
|
613 | + Filesystem::signal_param_run => &$run, |
|
614 | + ]); |
|
615 | + } else { |
|
616 | + \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_update, [ |
|
617 | + Filesystem::signal_param_path => $this->getHookPath($path), |
|
618 | + Filesystem::signal_param_run => &$run, |
|
619 | + ]); |
|
620 | + } |
|
621 | + \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_write, [ |
|
622 | + Filesystem::signal_param_path => $this->getHookPath($path), |
|
623 | + Filesystem::signal_param_run => &$run, |
|
624 | + ]); |
|
625 | + } |
|
626 | + |
|
627 | + /** |
|
628 | + * @param bool $exists |
|
629 | + * @param string $path |
|
630 | + */ |
|
631 | + protected function emit_file_hooks_post($exists, $path) { |
|
632 | + if (!$exists) { |
|
633 | + \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_create, [ |
|
634 | + Filesystem::signal_param_path => $this->getHookPath($path), |
|
635 | + ]); |
|
636 | + } else { |
|
637 | + \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_update, [ |
|
638 | + Filesystem::signal_param_path => $this->getHookPath($path), |
|
639 | + ]); |
|
640 | + } |
|
641 | + \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_write, [ |
|
642 | + Filesystem::signal_param_path => $this->getHookPath($path), |
|
643 | + ]); |
|
644 | + } |
|
645 | + |
|
646 | + /** |
|
647 | + * @param string $path |
|
648 | + * @param string|resource $data |
|
649 | + * @return bool|mixed |
|
650 | + * @throws LockedException |
|
651 | + */ |
|
652 | + public function file_put_contents($path, $data) { |
|
653 | + if (is_resource($data)) { //not having to deal with streams in file_put_contents makes life easier |
|
654 | + $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); |
|
655 | + if (Filesystem::isValidPath($path) |
|
656 | + and !Filesystem::isFileBlacklisted($path) |
|
657 | + ) { |
|
658 | + $path = $this->getRelativePath($absolutePath); |
|
659 | + |
|
660 | + $this->lockFile($path, ILockingProvider::LOCK_SHARED); |
|
661 | + |
|
662 | + $exists = $this->file_exists($path); |
|
663 | + $run = true; |
|
664 | + if ($this->shouldEmitHooks($path)) { |
|
665 | + $this->emit_file_hooks_pre($exists, $path, $run); |
|
666 | + } |
|
667 | + if (!$run) { |
|
668 | + $this->unlockFile($path, ILockingProvider::LOCK_SHARED); |
|
669 | + return false; |
|
670 | + } |
|
671 | + |
|
672 | + try { |
|
673 | + $this->changeLock($path, ILockingProvider::LOCK_EXCLUSIVE); |
|
674 | + } catch (\Exception $e) { |
|
675 | + // Release the shared lock before throwing. |
|
676 | + $this->unlockFile($path, ILockingProvider::LOCK_SHARED); |
|
677 | + throw $e; |
|
678 | + } |
|
679 | + |
|
680 | + /** @var \OC\Files\Storage\Storage $storage */ |
|
681 | + [$storage, $internalPath] = $this->resolvePath($path); |
|
682 | + $target = $storage->fopen($internalPath, 'w'); |
|
683 | + if ($target) { |
|
684 | + [, $result] = \OC_Helper::streamCopy($data, $target); |
|
685 | + fclose($target); |
|
686 | + fclose($data); |
|
687 | + |
|
688 | + $this->writeUpdate($storage, $internalPath); |
|
689 | + |
|
690 | + $this->changeLock($path, ILockingProvider::LOCK_SHARED); |
|
691 | + |
|
692 | + if ($this->shouldEmitHooks($path) && $result !== false) { |
|
693 | + $this->emit_file_hooks_post($exists, $path); |
|
694 | + } |
|
695 | + $this->unlockFile($path, ILockingProvider::LOCK_SHARED); |
|
696 | + return $result; |
|
697 | + } else { |
|
698 | + $this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE); |
|
699 | + return false; |
|
700 | + } |
|
701 | + } else { |
|
702 | + return false; |
|
703 | + } |
|
704 | + } else { |
|
705 | + $hooks = $this->file_exists($path) ? ['update', 'write'] : ['create', 'write']; |
|
706 | + return $this->basicOperation('file_put_contents', $path, $hooks, $data); |
|
707 | + } |
|
708 | + } |
|
709 | + |
|
710 | + /** |
|
711 | + * @param string $path |
|
712 | + * @return bool|mixed |
|
713 | + */ |
|
714 | + public function unlink($path) { |
|
715 | + if ($path === '' || $path === '/') { |
|
716 | + // do not allow deleting the root |
|
717 | + return false; |
|
718 | + } |
|
719 | + $postFix = (substr($path, -1) === '/') ? '/' : ''; |
|
720 | + $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); |
|
721 | + $mount = Filesystem::getMountManager()->find($absolutePath . $postFix); |
|
722 | + if ($mount->getInternalPath($absolutePath) === '') { |
|
723 | + return $this->removeMount($mount, $absolutePath); |
|
724 | + } |
|
725 | + if ($this->is_dir($path)) { |
|
726 | + $result = $this->basicOperation('rmdir', $path, ['delete']); |
|
727 | + } else { |
|
728 | + $result = $this->basicOperation('unlink', $path, ['delete']); |
|
729 | + } |
|
730 | + if (!$result && !$this->file_exists($path)) { //clear ghost files from the cache on delete |
|
731 | + $storage = $mount->getStorage(); |
|
732 | + $internalPath = $mount->getInternalPath($absolutePath); |
|
733 | + $storage->getUpdater()->remove($internalPath); |
|
734 | + return true; |
|
735 | + } else { |
|
736 | + return $result; |
|
737 | + } |
|
738 | + } |
|
739 | + |
|
740 | + /** |
|
741 | + * @param string $directory |
|
742 | + * @return bool|mixed |
|
743 | + */ |
|
744 | + public function deleteAll($directory) { |
|
745 | + return $this->rmdir($directory); |
|
746 | + } |
|
747 | + |
|
748 | + /** |
|
749 | + * Rename/move a file or folder from the source path to target path. |
|
750 | + * |
|
751 | + * @param string $path1 source path |
|
752 | + * @param string $path2 target path |
|
753 | + * |
|
754 | + * @return bool|mixed |
|
755 | + * @throws LockedException |
|
756 | + */ |
|
757 | + public function rename($path1, $path2) { |
|
758 | + $absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1)); |
|
759 | + $absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2)); |
|
760 | + $result = false; |
|
761 | + if ( |
|
762 | + Filesystem::isValidPath($path2) |
|
763 | + and Filesystem::isValidPath($path1) |
|
764 | + and !Filesystem::isFileBlacklisted($path2) |
|
765 | + ) { |
|
766 | + $path1 = $this->getRelativePath($absolutePath1); |
|
767 | + $path2 = $this->getRelativePath($absolutePath2); |
|
768 | + $exists = $this->file_exists($path2); |
|
769 | + |
|
770 | + if ($path1 == null or $path2 == null) { |
|
771 | + return false; |
|
772 | + } |
|
773 | + |
|
774 | + $this->lockFile($path1, ILockingProvider::LOCK_SHARED, true); |
|
775 | + try { |
|
776 | + $this->lockFile($path2, ILockingProvider::LOCK_SHARED, true); |
|
777 | + |
|
778 | + $run = true; |
|
779 | + if ($this->shouldEmitHooks($path1) && (Cache\Scanner::isPartialFile($path1) && !Cache\Scanner::isPartialFile($path2))) { |
|
780 | + // if it was a rename from a part file to a regular file it was a write and not a rename operation |
|
781 | + $this->emit_file_hooks_pre($exists, $path2, $run); |
|
782 | + } elseif ($this->shouldEmitHooks($path1)) { |
|
783 | + \OC_Hook::emit( |
|
784 | + Filesystem::CLASSNAME, Filesystem::signal_rename, |
|
785 | + [ |
|
786 | + Filesystem::signal_param_oldpath => $this->getHookPath($path1), |
|
787 | + Filesystem::signal_param_newpath => $this->getHookPath($path2), |
|
788 | + Filesystem::signal_param_run => &$run |
|
789 | + ] |
|
790 | + ); |
|
791 | + } |
|
792 | + if ($run) { |
|
793 | + $this->verifyPath(dirname($path2), basename($path2)); |
|
794 | + |
|
795 | + $manager = Filesystem::getMountManager(); |
|
796 | + $mount1 = $this->getMount($path1); |
|
797 | + $mount2 = $this->getMount($path2); |
|
798 | + $storage1 = $mount1->getStorage(); |
|
799 | + $storage2 = $mount2->getStorage(); |
|
800 | + $internalPath1 = $mount1->getInternalPath($absolutePath1); |
|
801 | + $internalPath2 = $mount2->getInternalPath($absolutePath2); |
|
802 | + |
|
803 | + $this->changeLock($path1, ILockingProvider::LOCK_EXCLUSIVE, true); |
|
804 | + try { |
|
805 | + $this->changeLock($path2, ILockingProvider::LOCK_EXCLUSIVE, true); |
|
806 | + |
|
807 | + if ($internalPath1 === '') { |
|
808 | + if ($mount1 instanceof MoveableMount) { |
|
809 | + $sourceParentMount = $this->getMount(dirname($path1)); |
|
810 | + if ($sourceParentMount === $mount2 && $this->targetIsNotShared($storage2, $internalPath2)) { |
|
811 | + /** |
|
812 | + * @var \OC\Files\Mount\MountPoint | \OC\Files\Mount\MoveableMount $mount1 |
|
813 | + */ |
|
814 | + $sourceMountPoint = $mount1->getMountPoint(); |
|
815 | + $result = $mount1->moveMount($absolutePath2); |
|
816 | + $manager->moveMount($sourceMountPoint, $mount1->getMountPoint()); |
|
817 | + } else { |
|
818 | + $result = false; |
|
819 | + } |
|
820 | + } else { |
|
821 | + $result = false; |
|
822 | + } |
|
823 | + // moving a file/folder within the same mount point |
|
824 | + } elseif ($storage1 === $storage2) { |
|
825 | + if ($storage1) { |
|
826 | + $result = $storage1->rename($internalPath1, $internalPath2); |
|
827 | + } else { |
|
828 | + $result = false; |
|
829 | + } |
|
830 | + // moving a file/folder between storages (from $storage1 to $storage2) |
|
831 | + } else { |
|
832 | + $result = $storage2->moveFromStorage($storage1, $internalPath1, $internalPath2); |
|
833 | + } |
|
834 | + |
|
835 | + if ((Cache\Scanner::isPartialFile($path1) && !Cache\Scanner::isPartialFile($path2)) && $result !== false) { |
|
836 | + // if it was a rename from a part file to a regular file it was a write and not a rename operation |
|
837 | + $this->writeUpdate($storage2, $internalPath2); |
|
838 | + } elseif ($result) { |
|
839 | + if ($internalPath1 !== '') { // don't do a cache update for moved mounts |
|
840 | + $this->renameUpdate($storage1, $storage2, $internalPath1, $internalPath2); |
|
841 | + } |
|
842 | + } |
|
843 | + } catch (\Exception $e) { |
|
844 | + throw $e; |
|
845 | + } finally { |
|
846 | + $this->changeLock($path1, ILockingProvider::LOCK_SHARED, true); |
|
847 | + $this->changeLock($path2, ILockingProvider::LOCK_SHARED, true); |
|
848 | + } |
|
849 | + |
|
850 | + if ((Cache\Scanner::isPartialFile($path1) && !Cache\Scanner::isPartialFile($path2)) && $result !== false) { |
|
851 | + if ($this->shouldEmitHooks()) { |
|
852 | + $this->emit_file_hooks_post($exists, $path2); |
|
853 | + } |
|
854 | + } elseif ($result) { |
|
855 | + if ($this->shouldEmitHooks($path1) and $this->shouldEmitHooks($path2)) { |
|
856 | + \OC_Hook::emit( |
|
857 | + Filesystem::CLASSNAME, |
|
858 | + Filesystem::signal_post_rename, |
|
859 | + [ |
|
860 | + Filesystem::signal_param_oldpath => $this->getHookPath($path1), |
|
861 | + Filesystem::signal_param_newpath => $this->getHookPath($path2) |
|
862 | + ] |
|
863 | + ); |
|
864 | + } |
|
865 | + } |
|
866 | + } |
|
867 | + } catch (\Exception $e) { |
|
868 | + throw $e; |
|
869 | + } finally { |
|
870 | + $this->unlockFile($path1, ILockingProvider::LOCK_SHARED, true); |
|
871 | + $this->unlockFile($path2, ILockingProvider::LOCK_SHARED, true); |
|
872 | + } |
|
873 | + } |
|
874 | + return $result; |
|
875 | + } |
|
876 | + |
|
877 | + /** |
|
878 | + * Copy a file/folder from the source path to target path |
|
879 | + * |
|
880 | + * @param string $path1 source path |
|
881 | + * @param string $path2 target path |
|
882 | + * @param bool $preserveMtime whether to preserve mtime on the copy |
|
883 | + * |
|
884 | + * @return bool|mixed |
|
885 | + */ |
|
886 | + public function copy($path1, $path2, $preserveMtime = false) { |
|
887 | + $absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1)); |
|
888 | + $absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2)); |
|
889 | + $result = false; |
|
890 | + if ( |
|
891 | + Filesystem::isValidPath($path2) |
|
892 | + and Filesystem::isValidPath($path1) |
|
893 | + and !Filesystem::isFileBlacklisted($path2) |
|
894 | + ) { |
|
895 | + $path1 = $this->getRelativePath($absolutePath1); |
|
896 | + $path2 = $this->getRelativePath($absolutePath2); |
|
897 | + |
|
898 | + if ($path1 == null or $path2 == null) { |
|
899 | + return false; |
|
900 | + } |
|
901 | + $run = true; |
|
902 | + |
|
903 | + $this->lockFile($path2, ILockingProvider::LOCK_SHARED); |
|
904 | + $this->lockFile($path1, ILockingProvider::LOCK_SHARED); |
|
905 | + $lockTypePath1 = ILockingProvider::LOCK_SHARED; |
|
906 | + $lockTypePath2 = ILockingProvider::LOCK_SHARED; |
|
907 | + |
|
908 | + try { |
|
909 | + $exists = $this->file_exists($path2); |
|
910 | + if ($this->shouldEmitHooks()) { |
|
911 | + \OC_Hook::emit( |
|
912 | + Filesystem::CLASSNAME, |
|
913 | + Filesystem::signal_copy, |
|
914 | + [ |
|
915 | + Filesystem::signal_param_oldpath => $this->getHookPath($path1), |
|
916 | + Filesystem::signal_param_newpath => $this->getHookPath($path2), |
|
917 | + Filesystem::signal_param_run => &$run |
|
918 | + ] |
|
919 | + ); |
|
920 | + $this->emit_file_hooks_pre($exists, $path2, $run); |
|
921 | + } |
|
922 | + if ($run) { |
|
923 | + $mount1 = $this->getMount($path1); |
|
924 | + $mount2 = $this->getMount($path2); |
|
925 | + $storage1 = $mount1->getStorage(); |
|
926 | + $internalPath1 = $mount1->getInternalPath($absolutePath1); |
|
927 | + $storage2 = $mount2->getStorage(); |
|
928 | + $internalPath2 = $mount2->getInternalPath($absolutePath2); |
|
929 | + |
|
930 | + $this->changeLock($path2, ILockingProvider::LOCK_EXCLUSIVE); |
|
931 | + $lockTypePath2 = ILockingProvider::LOCK_EXCLUSIVE; |
|
932 | + |
|
933 | + if ($mount1->getMountPoint() == $mount2->getMountPoint()) { |
|
934 | + if ($storage1) { |
|
935 | + $result = $storage1->copy($internalPath1, $internalPath2); |
|
936 | + } else { |
|
937 | + $result = false; |
|
938 | + } |
|
939 | + } else { |
|
940 | + $result = $storage2->copyFromStorage($storage1, $internalPath1, $internalPath2); |
|
941 | + } |
|
942 | + |
|
943 | + $this->writeUpdate($storage2, $internalPath2); |
|
944 | + |
|
945 | + $this->changeLock($path2, ILockingProvider::LOCK_SHARED); |
|
946 | + $lockTypePath2 = ILockingProvider::LOCK_SHARED; |
|
947 | + |
|
948 | + if ($this->shouldEmitHooks() && $result !== false) { |
|
949 | + \OC_Hook::emit( |
|
950 | + Filesystem::CLASSNAME, |
|
951 | + Filesystem::signal_post_copy, |
|
952 | + [ |
|
953 | + Filesystem::signal_param_oldpath => $this->getHookPath($path1), |
|
954 | + Filesystem::signal_param_newpath => $this->getHookPath($path2) |
|
955 | + ] |
|
956 | + ); |
|
957 | + $this->emit_file_hooks_post($exists, $path2); |
|
958 | + } |
|
959 | + } |
|
960 | + } catch (\Exception $e) { |
|
961 | + $this->unlockFile($path2, $lockTypePath2); |
|
962 | + $this->unlockFile($path1, $lockTypePath1); |
|
963 | + throw $e; |
|
964 | + } |
|
965 | + |
|
966 | + $this->unlockFile($path2, $lockTypePath2); |
|
967 | + $this->unlockFile($path1, $lockTypePath1); |
|
968 | + } |
|
969 | + return $result; |
|
970 | + } |
|
971 | + |
|
972 | + /** |
|
973 | + * @param string $path |
|
974 | + * @param string $mode 'r' or 'w' |
|
975 | + * @return resource |
|
976 | + * @throws LockedException |
|
977 | + */ |
|
978 | + public function fopen($path, $mode) { |
|
979 | + $mode = str_replace('b', '', $mode); // the binary flag is a windows only feature which we do not support |
|
980 | + $hooks = []; |
|
981 | + switch ($mode) { |
|
982 | + case 'r': |
|
983 | + $hooks[] = 'read'; |
|
984 | + break; |
|
985 | + case 'r+': |
|
986 | + case 'w+': |
|
987 | + case 'x+': |
|
988 | + case 'a+': |
|
989 | + $hooks[] = 'read'; |
|
990 | + $hooks[] = 'write'; |
|
991 | + break; |
|
992 | + case 'w': |
|
993 | + case 'x': |
|
994 | + case 'a': |
|
995 | + $hooks[] = 'write'; |
|
996 | + break; |
|
997 | + default: |
|
998 | + \OCP\Util::writeLog('core', 'invalid mode (' . $mode . ') for ' . $path, ILogger::ERROR); |
|
999 | + } |
|
1000 | + |
|
1001 | + if ($mode !== 'r' && $mode !== 'w') { |
|
1002 | + \OC::$server->getLogger()->info('Trying to open a file with a mode other than "r" or "w" can cause severe performance issues with some backends'); |
|
1003 | + } |
|
1004 | + |
|
1005 | + return $this->basicOperation('fopen', $path, $hooks, $mode); |
|
1006 | + } |
|
1007 | + |
|
1008 | + /** |
|
1009 | + * @param string $path |
|
1010 | + * @return bool|string |
|
1011 | + * @throws \OCP\Files\InvalidPathException |
|
1012 | + */ |
|
1013 | + public function toTmpFile($path) { |
|
1014 | + $this->assertPathLength($path); |
|
1015 | + if (Filesystem::isValidPath($path)) { |
|
1016 | + $source = $this->fopen($path, 'r'); |
|
1017 | + if ($source) { |
|
1018 | + $extension = pathinfo($path, PATHINFO_EXTENSION); |
|
1019 | + $tmpFile = \OC::$server->getTempManager()->getTemporaryFile($extension); |
|
1020 | + file_put_contents($tmpFile, $source); |
|
1021 | + return $tmpFile; |
|
1022 | + } else { |
|
1023 | + return false; |
|
1024 | + } |
|
1025 | + } else { |
|
1026 | + return false; |
|
1027 | + } |
|
1028 | + } |
|
1029 | + |
|
1030 | + /** |
|
1031 | + * @param string $tmpFile |
|
1032 | + * @param string $path |
|
1033 | + * @return bool|mixed |
|
1034 | + * @throws \OCP\Files\InvalidPathException |
|
1035 | + */ |
|
1036 | + public function fromTmpFile($tmpFile, $path) { |
|
1037 | + $this->assertPathLength($path); |
|
1038 | + if (Filesystem::isValidPath($path)) { |
|
1039 | + |
|
1040 | + // Get directory that the file is going into |
|
1041 | + $filePath = dirname($path); |
|
1042 | + |
|
1043 | + // Create the directories if any |
|
1044 | + if (!$this->file_exists($filePath)) { |
|
1045 | + $result = $this->createParentDirectories($filePath); |
|
1046 | + if ($result === false) { |
|
1047 | + return false; |
|
1048 | + } |
|
1049 | + } |
|
1050 | + |
|
1051 | + $source = fopen($tmpFile, 'r'); |
|
1052 | + if ($source) { |
|
1053 | + $result = $this->file_put_contents($path, $source); |
|
1054 | + // $this->file_put_contents() might have already closed |
|
1055 | + // the resource, so we check it, before trying to close it |
|
1056 | + // to avoid messages in the error log. |
|
1057 | + if (is_resource($source)) { |
|
1058 | + fclose($source); |
|
1059 | + } |
|
1060 | + unlink($tmpFile); |
|
1061 | + return $result; |
|
1062 | + } else { |
|
1063 | + return false; |
|
1064 | + } |
|
1065 | + } else { |
|
1066 | + return false; |
|
1067 | + } |
|
1068 | + } |
|
1069 | + |
|
1070 | + |
|
1071 | + /** |
|
1072 | + * @param string $path |
|
1073 | + * @return mixed |
|
1074 | + * @throws \OCP\Files\InvalidPathException |
|
1075 | + */ |
|
1076 | + public function getMimeType($path) { |
|
1077 | + $this->assertPathLength($path); |
|
1078 | + return $this->basicOperation('getMimeType', $path); |
|
1079 | + } |
|
1080 | + |
|
1081 | + /** |
|
1082 | + * @param string $type |
|
1083 | + * @param string $path |
|
1084 | + * @param bool $raw |
|
1085 | + * @return bool|string |
|
1086 | + */ |
|
1087 | + public function hash($type, $path, $raw = false) { |
|
1088 | + $postFix = (substr($path, -1) === '/') ? '/' : ''; |
|
1089 | + $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); |
|
1090 | + if (Filesystem::isValidPath($path)) { |
|
1091 | + $path = $this->getRelativePath($absolutePath); |
|
1092 | + if ($path == null) { |
|
1093 | + return false; |
|
1094 | + } |
|
1095 | + if ($this->shouldEmitHooks($path)) { |
|
1096 | + \OC_Hook::emit( |
|
1097 | + Filesystem::CLASSNAME, |
|
1098 | + Filesystem::signal_read, |
|
1099 | + [Filesystem::signal_param_path => $this->getHookPath($path)] |
|
1100 | + ); |
|
1101 | + } |
|
1102 | + /** @var Storage|null $storage */ |
|
1103 | + [$storage, $internalPath] = Filesystem::resolvePath($absolutePath . $postFix); |
|
1104 | + if ($storage) { |
|
1105 | + return $storage->hash($type, $internalPath, $raw); |
|
1106 | + } |
|
1107 | + } |
|
1108 | + return false; |
|
1109 | + } |
|
1110 | + |
|
1111 | + /** |
|
1112 | + * @param string $path |
|
1113 | + * @return mixed |
|
1114 | + * @throws \OCP\Files\InvalidPathException |
|
1115 | + */ |
|
1116 | + public function free_space($path = '/') { |
|
1117 | + $this->assertPathLength($path); |
|
1118 | + $result = $this->basicOperation('free_space', $path); |
|
1119 | + if ($result === null) { |
|
1120 | + throw new InvalidPathException(); |
|
1121 | + } |
|
1122 | + return $result; |
|
1123 | + } |
|
1124 | + |
|
1125 | + /** |
|
1126 | + * abstraction layer for basic filesystem functions: wrapper for \OC\Files\Storage\Storage |
|
1127 | + * |
|
1128 | + * @param string $operation |
|
1129 | + * @param string $path |
|
1130 | + * @param array $hooks (optional) |
|
1131 | + * @param mixed $extraParam (optional) |
|
1132 | + * @return mixed |
|
1133 | + * @throws LockedException |
|
1134 | + * |
|
1135 | + * This method takes requests for basic filesystem functions (e.g. reading & writing |
|
1136 | + * files), processes hooks and proxies, sanitises paths, and finally passes them on to |
|
1137 | + * \OC\Files\Storage\Storage for delegation to a storage backend for execution |
|
1138 | + */ |
|
1139 | + private function basicOperation($operation, $path, $hooks = [], $extraParam = null) { |
|
1140 | + $postFix = (substr($path, -1) === '/') ? '/' : ''; |
|
1141 | + $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); |
|
1142 | + if (Filesystem::isValidPath($path) |
|
1143 | + and !Filesystem::isFileBlacklisted($path) |
|
1144 | + ) { |
|
1145 | + $path = $this->getRelativePath($absolutePath); |
|
1146 | + if ($path == null) { |
|
1147 | + return false; |
|
1148 | + } |
|
1149 | + |
|
1150 | + if (in_array('write', $hooks) || in_array('delete', $hooks) || in_array('read', $hooks)) { |
|
1151 | + // always a shared lock during pre-hooks so the hook can read the file |
|
1152 | + $this->lockFile($path, ILockingProvider::LOCK_SHARED); |
|
1153 | + } |
|
1154 | + |
|
1155 | + $run = $this->runHooks($hooks, $path); |
|
1156 | + /** @var \OC\Files\Storage\Storage $storage */ |
|
1157 | + [$storage, $internalPath] = Filesystem::resolvePath($absolutePath . $postFix); |
|
1158 | + if ($run and $storage) { |
|
1159 | + if (in_array('write', $hooks) || in_array('delete', $hooks)) { |
|
1160 | + try { |
|
1161 | + $this->changeLock($path, ILockingProvider::LOCK_EXCLUSIVE); |
|
1162 | + } catch (LockedException $e) { |
|
1163 | + // release the shared lock we acquired before quiting |
|
1164 | + $this->unlockFile($path, ILockingProvider::LOCK_SHARED); |
|
1165 | + throw $e; |
|
1166 | + } |
|
1167 | + } |
|
1168 | + try { |
|
1169 | + if (!is_null($extraParam)) { |
|
1170 | + $result = $storage->$operation($internalPath, $extraParam); |
|
1171 | + } else { |
|
1172 | + $result = $storage->$operation($internalPath); |
|
1173 | + } |
|
1174 | + } catch (\Exception $e) { |
|
1175 | + if (in_array('write', $hooks) || in_array('delete', $hooks)) { |
|
1176 | + $this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE); |
|
1177 | + } elseif (in_array('read', $hooks)) { |
|
1178 | + $this->unlockFile($path, ILockingProvider::LOCK_SHARED); |
|
1179 | + } |
|
1180 | + throw $e; |
|
1181 | + } |
|
1182 | + |
|
1183 | + if ($result && in_array('delete', $hooks) and $result) { |
|
1184 | + $this->removeUpdate($storage, $internalPath); |
|
1185 | + } |
|
1186 | + if ($result && in_array('write', $hooks, true) && $operation !== 'fopen' && $operation !== 'touch') { |
|
1187 | + $this->writeUpdate($storage, $internalPath); |
|
1188 | + } |
|
1189 | + if ($result && in_array('touch', $hooks)) { |
|
1190 | + $this->writeUpdate($storage, $internalPath, $extraParam); |
|
1191 | + } |
|
1192 | + |
|
1193 | + if ((in_array('write', $hooks) || in_array('delete', $hooks)) && ($operation !== 'fopen' || $result === false)) { |
|
1194 | + $this->changeLock($path, ILockingProvider::LOCK_SHARED); |
|
1195 | + } |
|
1196 | + |
|
1197 | + $unlockLater = false; |
|
1198 | + if ($this->lockingEnabled && $operation === 'fopen' && is_resource($result)) { |
|
1199 | + $unlockLater = true; |
|
1200 | + // make sure our unlocking callback will still be called if connection is aborted |
|
1201 | + ignore_user_abort(true); |
|
1202 | + $result = CallbackWrapper::wrap($result, null, null, function () use ($hooks, $path) { |
|
1203 | + if (in_array('write', $hooks)) { |
|
1204 | + $this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE); |
|
1205 | + } elseif (in_array('read', $hooks)) { |
|
1206 | + $this->unlockFile($path, ILockingProvider::LOCK_SHARED); |
|
1207 | + } |
|
1208 | + }); |
|
1209 | + } |
|
1210 | + |
|
1211 | + if ($this->shouldEmitHooks($path) && $result !== false) { |
|
1212 | + if ($operation != 'fopen') { //no post hooks for fopen, the file stream is still open |
|
1213 | + $this->runHooks($hooks, $path, true); |
|
1214 | + } |
|
1215 | + } |
|
1216 | + |
|
1217 | + if (!$unlockLater |
|
1218 | + && (in_array('write', $hooks) || in_array('delete', $hooks) || in_array('read', $hooks)) |
|
1219 | + ) { |
|
1220 | + $this->unlockFile($path, ILockingProvider::LOCK_SHARED); |
|
1221 | + } |
|
1222 | + return $result; |
|
1223 | + } else { |
|
1224 | + $this->unlockFile($path, ILockingProvider::LOCK_SHARED); |
|
1225 | + } |
|
1226 | + } |
|
1227 | + return null; |
|
1228 | + } |
|
1229 | + |
|
1230 | + /** |
|
1231 | + * get the path relative to the default root for hook usage |
|
1232 | + * |
|
1233 | + * @param string $path |
|
1234 | + * @return string |
|
1235 | + */ |
|
1236 | + private function getHookPath($path) { |
|
1237 | + if (!Filesystem::getView()) { |
|
1238 | + return $path; |
|
1239 | + } |
|
1240 | + return Filesystem::getView()->getRelativePath($this->getAbsolutePath($path)); |
|
1241 | + } |
|
1242 | + |
|
1243 | + private function shouldEmitHooks($path = '') { |
|
1244 | + if ($path && Cache\Scanner::isPartialFile($path)) { |
|
1245 | + return false; |
|
1246 | + } |
|
1247 | + if (!Filesystem::$loaded) { |
|
1248 | + return false; |
|
1249 | + } |
|
1250 | + $defaultRoot = Filesystem::getRoot(); |
|
1251 | + if ($defaultRoot === null) { |
|
1252 | + return false; |
|
1253 | + } |
|
1254 | + if ($this->fakeRoot === $defaultRoot) { |
|
1255 | + return true; |
|
1256 | + } |
|
1257 | + $fullPath = $this->getAbsolutePath($path); |
|
1258 | + |
|
1259 | + if ($fullPath === $defaultRoot) { |
|
1260 | + return true; |
|
1261 | + } |
|
1262 | + |
|
1263 | + return (strlen($fullPath) > strlen($defaultRoot)) && (substr($fullPath, 0, strlen($defaultRoot) + 1) === $defaultRoot . '/'); |
|
1264 | + } |
|
1265 | + |
|
1266 | + /** |
|
1267 | + * @param string[] $hooks |
|
1268 | + * @param string $path |
|
1269 | + * @param bool $post |
|
1270 | + * @return bool |
|
1271 | + */ |
|
1272 | + private function runHooks($hooks, $path, $post = false) { |
|
1273 | + $relativePath = $path; |
|
1274 | + $path = $this->getHookPath($path); |
|
1275 | + $prefix = $post ? 'post_' : ''; |
|
1276 | + $run = true; |
|
1277 | + if ($this->shouldEmitHooks($relativePath)) { |
|
1278 | + foreach ($hooks as $hook) { |
|
1279 | + if ($hook != 'read') { |
|
1280 | + \OC_Hook::emit( |
|
1281 | + Filesystem::CLASSNAME, |
|
1282 | + $prefix . $hook, |
|
1283 | + [ |
|
1284 | + Filesystem::signal_param_run => &$run, |
|
1285 | + Filesystem::signal_param_path => $path |
|
1286 | + ] |
|
1287 | + ); |
|
1288 | + } elseif (!$post) { |
|
1289 | + \OC_Hook::emit( |
|
1290 | + Filesystem::CLASSNAME, |
|
1291 | + $prefix . $hook, |
|
1292 | + [ |
|
1293 | + Filesystem::signal_param_path => $path |
|
1294 | + ] |
|
1295 | + ); |
|
1296 | + } |
|
1297 | + } |
|
1298 | + } |
|
1299 | + return $run; |
|
1300 | + } |
|
1301 | + |
|
1302 | + /** |
|
1303 | + * check if a file or folder has been updated since $time |
|
1304 | + * |
|
1305 | + * @param string $path |
|
1306 | + * @param int $time |
|
1307 | + * @return bool |
|
1308 | + */ |
|
1309 | + public function hasUpdated($path, $time) { |
|
1310 | + return $this->basicOperation('hasUpdated', $path, [], $time); |
|
1311 | + } |
|
1312 | + |
|
1313 | + /** |
|
1314 | + * @param string $ownerId |
|
1315 | + * @return \OC\User\User |
|
1316 | + */ |
|
1317 | + private function getUserObjectForOwner($ownerId) { |
|
1318 | + $owner = $this->userManager->get($ownerId); |
|
1319 | + if ($owner instanceof IUser) { |
|
1320 | + return $owner; |
|
1321 | + } else { |
|
1322 | + return new User($ownerId, null, \OC::$server->getEventDispatcher()); |
|
1323 | + } |
|
1324 | + } |
|
1325 | + |
|
1326 | + /** |
|
1327 | + * Get file info from cache |
|
1328 | + * |
|
1329 | + * If the file is not in cached it will be scanned |
|
1330 | + * If the file has changed on storage the cache will be updated |
|
1331 | + * |
|
1332 | + * @param \OC\Files\Storage\Storage $storage |
|
1333 | + * @param string $internalPath |
|
1334 | + * @param string $relativePath |
|
1335 | + * @return ICacheEntry|bool |
|
1336 | + */ |
|
1337 | + private function getCacheEntry($storage, $internalPath, $relativePath) { |
|
1338 | + $cache = $storage->getCache($internalPath); |
|
1339 | + $data = $cache->get($internalPath); |
|
1340 | + $watcher = $storage->getWatcher($internalPath); |
|
1341 | + |
|
1342 | + try { |
|
1343 | + // if the file is not in the cache or needs to be updated, trigger the scanner and reload the data |
|
1344 | + if (!$data || (isset($data['size']) && $data['size'] === -1)) { |
|
1345 | + if (!$storage->file_exists($internalPath)) { |
|
1346 | + return false; |
|
1347 | + } |
|
1348 | + // don't need to get a lock here since the scanner does it's own locking |
|
1349 | + $scanner = $storage->getScanner($internalPath); |
|
1350 | + $scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW); |
|
1351 | + $data = $cache->get($internalPath); |
|
1352 | + } elseif (!Cache\Scanner::isPartialFile($internalPath) && $watcher->needsUpdate($internalPath, $data)) { |
|
1353 | + $this->lockFile($relativePath, ILockingProvider::LOCK_SHARED); |
|
1354 | + $watcher->update($internalPath, $data); |
|
1355 | + $storage->getPropagator()->propagateChange($internalPath, time()); |
|
1356 | + $data = $cache->get($internalPath); |
|
1357 | + $this->unlockFile($relativePath, ILockingProvider::LOCK_SHARED); |
|
1358 | + } |
|
1359 | + } catch (LockedException $e) { |
|
1360 | + // if the file is locked we just use the old cache info |
|
1361 | + } |
|
1362 | + |
|
1363 | + return $data; |
|
1364 | + } |
|
1365 | + |
|
1366 | + /** |
|
1367 | + * get the filesystem info |
|
1368 | + * |
|
1369 | + * @param string $path |
|
1370 | + * @param boolean|string $includeMountPoints true to add mountpoint sizes, |
|
1371 | + * 'ext' to add only ext storage mount point sizes. Defaults to true. |
|
1372 | + * defaults to true |
|
1373 | + * @return \OC\Files\FileInfo|false False if file does not exist |
|
1374 | + */ |
|
1375 | + public function getFileInfo($path, $includeMountPoints = true) { |
|
1376 | + $this->assertPathLength($path); |
|
1377 | + if (!Filesystem::isValidPath($path)) { |
|
1378 | + return false; |
|
1379 | + } |
|
1380 | + if (Cache\Scanner::isPartialFile($path)) { |
|
1381 | + return $this->getPartFileInfo($path); |
|
1382 | + } |
|
1383 | + $relativePath = $path; |
|
1384 | + $path = Filesystem::normalizePath($this->fakeRoot . '/' . $path); |
|
1385 | + |
|
1386 | + $mount = Filesystem::getMountManager()->find($path); |
|
1387 | + $storage = $mount->getStorage(); |
|
1388 | + $internalPath = $mount->getInternalPath($path); |
|
1389 | + if ($storage) { |
|
1390 | + $data = $this->getCacheEntry($storage, $internalPath, $relativePath); |
|
1391 | + |
|
1392 | + if (!$data instanceof ICacheEntry) { |
|
1393 | + return false; |
|
1394 | + } |
|
1395 | + |
|
1396 | + if ($mount instanceof MoveableMount && $internalPath === '') { |
|
1397 | + $data['permissions'] |= \OCP\Constants::PERMISSION_DELETE; |
|
1398 | + } |
|
1399 | + $ownerId = $storage->getOwner($internalPath); |
|
1400 | + $owner = null; |
|
1401 | + if ($ownerId !== null && $ownerId !== false) { |
|
1402 | + // ownerId might be null if files are accessed with an access token without file system access |
|
1403 | + $owner = $this->getUserObjectForOwner($ownerId); |
|
1404 | + } |
|
1405 | + $info = new FileInfo($path, $storage, $internalPath, $data, $mount, $owner); |
|
1406 | + |
|
1407 | + if (isset($data['fileid'])) { |
|
1408 | + if ($includeMountPoints and $data['mimetype'] === 'httpd/unix-directory') { |
|
1409 | + //add the sizes of other mount points to the folder |
|
1410 | + $extOnly = ($includeMountPoints === 'ext'); |
|
1411 | + $mounts = Filesystem::getMountManager()->findIn($path); |
|
1412 | + $info->setSubMounts(array_filter($mounts, function (IMountPoint $mount) use ($extOnly) { |
|
1413 | + $subStorage = $mount->getStorage(); |
|
1414 | + return !($extOnly && $subStorage instanceof \OCA\Files_Sharing\SharedStorage); |
|
1415 | + })); |
|
1416 | + } |
|
1417 | + } |
|
1418 | + |
|
1419 | + return $info; |
|
1420 | + } else { |
|
1421 | + \OC::$server->getLogger()->warning('Storage not valid for mountpoint: ' . $mount->getMountPoint()); |
|
1422 | + } |
|
1423 | + |
|
1424 | + return false; |
|
1425 | + } |
|
1426 | + |
|
1427 | + /** |
|
1428 | + * get the content of a directory |
|
1429 | + * |
|
1430 | + * @param string $directory path under datadirectory |
|
1431 | + * @param string $mimetype_filter limit returned content to this mimetype or mimepart |
|
1432 | + * @return FileInfo[] |
|
1433 | + */ |
|
1434 | + public function getDirectoryContent($directory, $mimetype_filter = '') { |
|
1435 | + $this->assertPathLength($directory); |
|
1436 | + if (!Filesystem::isValidPath($directory)) { |
|
1437 | + return []; |
|
1438 | + } |
|
1439 | + $path = $this->getAbsolutePath($directory); |
|
1440 | + $path = Filesystem::normalizePath($path); |
|
1441 | + $mount = $this->getMount($directory); |
|
1442 | + if (!$mount) { |
|
1443 | + return []; |
|
1444 | + } |
|
1445 | + $storage = $mount->getStorage(); |
|
1446 | + $internalPath = $mount->getInternalPath($path); |
|
1447 | + if ($storage) { |
|
1448 | + $cache = $storage->getCache($internalPath); |
|
1449 | + $user = \OC_User::getUser(); |
|
1450 | + |
|
1451 | + $data = $this->getCacheEntry($storage, $internalPath, $directory); |
|
1452 | + |
|
1453 | + if (!$data instanceof ICacheEntry || !isset($data['fileid']) || !($data->getPermissions() && Constants::PERMISSION_READ)) { |
|
1454 | + return []; |
|
1455 | + } |
|
1456 | + |
|
1457 | + $folderId = $data['fileid']; |
|
1458 | + $contents = $cache->getFolderContentsById($folderId); //TODO: mimetype_filter |
|
1459 | + |
|
1460 | + $sharingDisabled = \OCP\Util::isSharingDisabledForUser(); |
|
1461 | + |
|
1462 | + $fileNames = array_map(function (ICacheEntry $content) { |
|
1463 | + return $content->getName(); |
|
1464 | + }, $contents); |
|
1465 | + /** |
|
1466 | + * @var \OC\Files\FileInfo[] $fileInfos |
|
1467 | + */ |
|
1468 | + $fileInfos = array_map(function (ICacheEntry $content) use ($path, $storage, $mount, $sharingDisabled) { |
|
1469 | + if ($sharingDisabled) { |
|
1470 | + $content['permissions'] = $content['permissions'] & ~\OCP\Constants::PERMISSION_SHARE; |
|
1471 | + } |
|
1472 | + $owner = $this->getUserObjectForOwner($storage->getOwner($content['path'])); |
|
1473 | + return new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content, $mount, $owner); |
|
1474 | + }, $contents); |
|
1475 | + $files = array_combine($fileNames, $fileInfos); |
|
1476 | + |
|
1477 | + //add a folder for any mountpoint in this directory and add the sizes of other mountpoints to the folders |
|
1478 | + $mounts = Filesystem::getMountManager()->findIn($path); |
|
1479 | + $dirLength = strlen($path); |
|
1480 | + foreach ($mounts as $mount) { |
|
1481 | + $mountPoint = $mount->getMountPoint(); |
|
1482 | + $subStorage = $mount->getStorage(); |
|
1483 | + if ($subStorage) { |
|
1484 | + $subCache = $subStorage->getCache(''); |
|
1485 | + |
|
1486 | + $rootEntry = $subCache->get(''); |
|
1487 | + if (!$rootEntry) { |
|
1488 | + $subScanner = $subStorage->getScanner(); |
|
1489 | + try { |
|
1490 | + $subScanner->scanFile(''); |
|
1491 | + } catch (\OCP\Files\StorageNotAvailableException $e) { |
|
1492 | + continue; |
|
1493 | + } catch (\OCP\Files\StorageInvalidException $e) { |
|
1494 | + continue; |
|
1495 | + } catch (\Exception $e) { |
|
1496 | + // sometimes when the storage is not available it can be any exception |
|
1497 | + \OC::$server->getLogger()->logException($e, [ |
|
1498 | + 'message' => 'Exception while scanning storage "' . $subStorage->getId() . '"', |
|
1499 | + 'level' => ILogger::ERROR, |
|
1500 | + 'app' => 'lib', |
|
1501 | + ]); |
|
1502 | + continue; |
|
1503 | + } |
|
1504 | + $rootEntry = $subCache->get(''); |
|
1505 | + } |
|
1506 | + |
|
1507 | + if ($rootEntry && ($rootEntry->getPermissions() && Constants::PERMISSION_READ)) { |
|
1508 | + $relativePath = trim(substr($mountPoint, $dirLength), '/'); |
|
1509 | + if ($pos = strpos($relativePath, '/')) { |
|
1510 | + //mountpoint inside subfolder add size to the correct folder |
|
1511 | + $entryName = substr($relativePath, 0, $pos); |
|
1512 | + foreach ($files as &$entry) { |
|
1513 | + if ($entry->getName() === $entryName) { |
|
1514 | + $entry->addSubEntry($rootEntry, $mountPoint); |
|
1515 | + } |
|
1516 | + } |
|
1517 | + } else { //mountpoint in this folder, add an entry for it |
|
1518 | + $rootEntry['name'] = $relativePath; |
|
1519 | + $rootEntry['type'] = $rootEntry['mimetype'] === 'httpd/unix-directory' ? 'dir' : 'file'; |
|
1520 | + $permissions = $rootEntry['permissions']; |
|
1521 | + // do not allow renaming/deleting the mount point if they are not shared files/folders |
|
1522 | + // for shared files/folders we use the permissions given by the owner |
|
1523 | + if ($mount instanceof MoveableMount) { |
|
1524 | + $rootEntry['permissions'] = $permissions | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE; |
|
1525 | + } else { |
|
1526 | + $rootEntry['permissions'] = $permissions & (\OCP\Constants::PERMISSION_ALL - (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE)); |
|
1527 | + } |
|
1528 | + |
|
1529 | + $rootEntry['path'] = substr(Filesystem::normalizePath($path . '/' . $rootEntry['name']), strlen($user) + 2); // full path without /$user/ |
|
1530 | + |
|
1531 | + // if sharing was disabled for the user we remove the share permissions |
|
1532 | + if (\OCP\Util::isSharingDisabledForUser()) { |
|
1533 | + $rootEntry['permissions'] = $rootEntry['permissions'] & ~\OCP\Constants::PERMISSION_SHARE; |
|
1534 | + } |
|
1535 | + |
|
1536 | + $owner = $this->getUserObjectForOwner($subStorage->getOwner('')); |
|
1537 | + $files[$rootEntry->getName()] = new FileInfo($path . '/' . $rootEntry['name'], $subStorage, '', $rootEntry, $mount, $owner); |
|
1538 | + } |
|
1539 | + } |
|
1540 | + } |
|
1541 | + } |
|
1542 | + |
|
1543 | + if ($mimetype_filter) { |
|
1544 | + $files = array_filter($files, function (FileInfo $file) use ($mimetype_filter) { |
|
1545 | + if (strpos($mimetype_filter, '/')) { |
|
1546 | + return $file->getMimetype() === $mimetype_filter; |
|
1547 | + } else { |
|
1548 | + return $file->getMimePart() === $mimetype_filter; |
|
1549 | + } |
|
1550 | + }); |
|
1551 | + } |
|
1552 | + |
|
1553 | + return array_values($files); |
|
1554 | + } else { |
|
1555 | + return []; |
|
1556 | + } |
|
1557 | + } |
|
1558 | + |
|
1559 | + /** |
|
1560 | + * change file metadata |
|
1561 | + * |
|
1562 | + * @param string $path |
|
1563 | + * @param array|\OCP\Files\FileInfo $data |
|
1564 | + * @return int |
|
1565 | + * |
|
1566 | + * returns the fileid of the updated file |
|
1567 | + */ |
|
1568 | + public function putFileInfo($path, $data) { |
|
1569 | + $this->assertPathLength($path); |
|
1570 | + if ($data instanceof FileInfo) { |
|
1571 | + $data = $data->getData(); |
|
1572 | + } |
|
1573 | + $path = Filesystem::normalizePath($this->fakeRoot . '/' . $path); |
|
1574 | + /** |
|
1575 | + * @var \OC\Files\Storage\Storage $storage |
|
1576 | + * @var string $internalPath |
|
1577 | + */ |
|
1578 | + [$storage, $internalPath] = Filesystem::resolvePath($path); |
|
1579 | + if ($storage) { |
|
1580 | + $cache = $storage->getCache($path); |
|
1581 | + |
|
1582 | + if (!$cache->inCache($internalPath)) { |
|
1583 | + $scanner = $storage->getScanner($internalPath); |
|
1584 | + $scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW); |
|
1585 | + } |
|
1586 | + |
|
1587 | + return $cache->put($internalPath, $data); |
|
1588 | + } else { |
|
1589 | + return -1; |
|
1590 | + } |
|
1591 | + } |
|
1592 | + |
|
1593 | + /** |
|
1594 | + * search for files with the name matching $query |
|
1595 | + * |
|
1596 | + * @param string $query |
|
1597 | + * @return FileInfo[] |
|
1598 | + */ |
|
1599 | + public function search($query) { |
|
1600 | + return $this->searchCommon('search', ['%' . $query . '%']); |
|
1601 | + } |
|
1602 | + |
|
1603 | + /** |
|
1604 | + * search for files with the name matching $query |
|
1605 | + * |
|
1606 | + * @param string $query |
|
1607 | + * @return FileInfo[] |
|
1608 | + */ |
|
1609 | + public function searchRaw($query) { |
|
1610 | + return $this->searchCommon('search', [$query]); |
|
1611 | + } |
|
1612 | + |
|
1613 | + /** |
|
1614 | + * search for files by mimetype |
|
1615 | + * |
|
1616 | + * @param string $mimetype |
|
1617 | + * @return FileInfo[] |
|
1618 | + */ |
|
1619 | + public function searchByMime($mimetype) { |
|
1620 | + return $this->searchCommon('searchByMime', [$mimetype]); |
|
1621 | + } |
|
1622 | + |
|
1623 | + /** |
|
1624 | + * search for files by tag |
|
1625 | + * |
|
1626 | + * @param string|int $tag name or tag id |
|
1627 | + * @param string $userId owner of the tags |
|
1628 | + * @return FileInfo[] |
|
1629 | + */ |
|
1630 | + public function searchByTag($tag, $userId) { |
|
1631 | + return $this->searchCommon('searchByTag', [$tag, $userId]); |
|
1632 | + } |
|
1633 | + |
|
1634 | + /** |
|
1635 | + * @param string $method cache method |
|
1636 | + * @param array $args |
|
1637 | + * @return FileInfo[] |
|
1638 | + */ |
|
1639 | + private function searchCommon($method, $args) { |
|
1640 | + $files = []; |
|
1641 | + $rootLength = strlen($this->fakeRoot); |
|
1642 | + |
|
1643 | + $mount = $this->getMount(''); |
|
1644 | + $mountPoint = $mount->getMountPoint(); |
|
1645 | + $storage = $mount->getStorage(); |
|
1646 | + $userManager = \OC::$server->getUserManager(); |
|
1647 | + if ($storage) { |
|
1648 | + $cache = $storage->getCache(''); |
|
1649 | + |
|
1650 | + $results = call_user_func_array([$cache, $method], $args); |
|
1651 | + foreach ($results as $result) { |
|
1652 | + if (substr($mountPoint . $result['path'], 0, $rootLength + 1) === $this->fakeRoot . '/') { |
|
1653 | + $internalPath = $result['path']; |
|
1654 | + $path = $mountPoint . $result['path']; |
|
1655 | + $result['path'] = substr($mountPoint . $result['path'], $rootLength); |
|
1656 | + $owner = $userManager->get($storage->getOwner($internalPath)); |
|
1657 | + $files[] = new FileInfo($path, $storage, $internalPath, $result, $mount, $owner); |
|
1658 | + } |
|
1659 | + } |
|
1660 | + |
|
1661 | + $mounts = Filesystem::getMountManager()->findIn($this->fakeRoot); |
|
1662 | + foreach ($mounts as $mount) { |
|
1663 | + $mountPoint = $mount->getMountPoint(); |
|
1664 | + $storage = $mount->getStorage(); |
|
1665 | + if ($storage) { |
|
1666 | + $cache = $storage->getCache(''); |
|
1667 | + |
|
1668 | + $relativeMountPoint = substr($mountPoint, $rootLength); |
|
1669 | + $results = call_user_func_array([$cache, $method], $args); |
|
1670 | + if ($results) { |
|
1671 | + foreach ($results as $result) { |
|
1672 | + $internalPath = $result['path']; |
|
1673 | + $result['path'] = rtrim($relativeMountPoint . $result['path'], '/'); |
|
1674 | + $path = rtrim($mountPoint . $internalPath, '/'); |
|
1675 | + $owner = $userManager->get($storage->getOwner($internalPath)); |
|
1676 | + $files[] = new FileInfo($path, $storage, $internalPath, $result, $mount, $owner); |
|
1677 | + } |
|
1678 | + } |
|
1679 | + } |
|
1680 | + } |
|
1681 | + } |
|
1682 | + return $files; |
|
1683 | + } |
|
1684 | + |
|
1685 | + /** |
|
1686 | + * Get the owner for a file or folder |
|
1687 | + * |
|
1688 | + * @param string $path |
|
1689 | + * @return string the user id of the owner |
|
1690 | + * @throws NotFoundException |
|
1691 | + */ |
|
1692 | + public function getOwner($path) { |
|
1693 | + $info = $this->getFileInfo($path); |
|
1694 | + if (!$info) { |
|
1695 | + throw new NotFoundException($path . ' not found while trying to get owner'); |
|
1696 | + } |
|
1697 | + |
|
1698 | + if ($info->getOwner() === null) { |
|
1699 | + throw new NotFoundException($path . ' has no owner'); |
|
1700 | + } |
|
1701 | + |
|
1702 | + return $info->getOwner()->getUID(); |
|
1703 | + } |
|
1704 | + |
|
1705 | + /** |
|
1706 | + * get the ETag for a file or folder |
|
1707 | + * |
|
1708 | + * @param string $path |
|
1709 | + * @return string |
|
1710 | + */ |
|
1711 | + public function getETag($path) { |
|
1712 | + /** |
|
1713 | + * @var Storage\Storage $storage |
|
1714 | + * @var string $internalPath |
|
1715 | + */ |
|
1716 | + [$storage, $internalPath] = $this->resolvePath($path); |
|
1717 | + if ($storage) { |
|
1718 | + return $storage->getETag($internalPath); |
|
1719 | + } else { |
|
1720 | + return null; |
|
1721 | + } |
|
1722 | + } |
|
1723 | + |
|
1724 | + /** |
|
1725 | + * Get the path of a file by id, relative to the view |
|
1726 | + * |
|
1727 | + * Note that the resulting path is not guarantied to be unique for the id, multiple paths can point to the same file |
|
1728 | + * |
|
1729 | + * @param int $id |
|
1730 | + * @param int|null $storageId |
|
1731 | + * @return string |
|
1732 | + * @throws NotFoundException |
|
1733 | + */ |
|
1734 | + public function getPath($id, int $storageId = null) { |
|
1735 | + $id = (int)$id; |
|
1736 | + $manager = Filesystem::getMountManager(); |
|
1737 | + $mounts = $manager->findIn($this->fakeRoot); |
|
1738 | + $mounts[] = $manager->find($this->fakeRoot); |
|
1739 | + $mounts = array_filter($mounts); |
|
1740 | + // reverse the array, so we start with the storage this view is in |
|
1741 | + // which is the most likely to contain the file we're looking for |
|
1742 | + $mounts = array_reverse($mounts); |
|
1743 | + |
|
1744 | + // put non-shared mounts in front of the shared mount |
|
1745 | + // this prevents unneeded recursion into shares |
|
1746 | + usort($mounts, function (IMountPoint $a, IMountPoint $b) { |
|
1747 | + return $a instanceof SharedMount && (!$b instanceof SharedMount) ? 1 : -1; |
|
1748 | + }); |
|
1749 | + |
|
1750 | + if (!is_null($storageId)) { |
|
1751 | + $mounts = array_filter($mounts, function (IMountPoint $mount) use ($storageId) { |
|
1752 | + return $mount->getNumericStorageId() === $storageId; |
|
1753 | + }); |
|
1754 | + } |
|
1755 | + |
|
1756 | + foreach ($mounts as $mount) { |
|
1757 | + /** |
|
1758 | + * @var \OC\Files\Mount\MountPoint $mount |
|
1759 | + */ |
|
1760 | + if ($mount->getStorage()) { |
|
1761 | + $cache = $mount->getStorage()->getCache(); |
|
1762 | + $internalPath = $cache->getPathById($id); |
|
1763 | + if (is_string($internalPath)) { |
|
1764 | + $fullPath = $mount->getMountPoint() . $internalPath; |
|
1765 | + if (!is_null($path = $this->getRelativePath($fullPath))) { |
|
1766 | + return $path; |
|
1767 | + } |
|
1768 | + } |
|
1769 | + } |
|
1770 | + } |
|
1771 | + throw new NotFoundException(sprintf('File with id "%s" has not been found.', $id)); |
|
1772 | + } |
|
1773 | + |
|
1774 | + /** |
|
1775 | + * @param string $path |
|
1776 | + * @throws InvalidPathException |
|
1777 | + */ |
|
1778 | + private function assertPathLength($path) { |
|
1779 | + $maxLen = min(PHP_MAXPATHLEN, 4000); |
|
1780 | + // Check for the string length - performed using isset() instead of strlen() |
|
1781 | + // because isset() is about 5x-40x faster. |
|
1782 | + if (isset($path[$maxLen])) { |
|
1783 | + $pathLen = strlen($path); |
|
1784 | + throw new \OCP\Files\InvalidPathException("Path length($pathLen) exceeds max path length($maxLen): $path"); |
|
1785 | + } |
|
1786 | + } |
|
1787 | + |
|
1788 | + /** |
|
1789 | + * check if it is allowed to move a mount point to a given target. |
|
1790 | + * It is not allowed to move a mount point into a different mount point or |
|
1791 | + * into an already shared folder |
|
1792 | + * |
|
1793 | + * @param IStorage $targetStorage |
|
1794 | + * @param string $targetInternalPath |
|
1795 | + * @return boolean |
|
1796 | + */ |
|
1797 | + private function targetIsNotShared(IStorage $targetStorage, string $targetInternalPath) { |
|
1798 | + |
|
1799 | + // note: cannot use the view because the target is already locked |
|
1800 | + $fileId = (int)$targetStorage->getCache()->getId($targetInternalPath); |
|
1801 | + if ($fileId === -1) { |
|
1802 | + // target might not exist, need to check parent instead |
|
1803 | + $fileId = (int)$targetStorage->getCache()->getId(dirname($targetInternalPath)); |
|
1804 | + } |
|
1805 | + |
|
1806 | + // check if any of the parents were shared by the current owner (include collections) |
|
1807 | + $shares = \OCP\Share::getItemShared( |
|
1808 | + 'folder', |
|
1809 | + $fileId, |
|
1810 | + \OCP\Share::FORMAT_NONE, |
|
1811 | + null, |
|
1812 | + true |
|
1813 | + ); |
|
1814 | + |
|
1815 | + if (count($shares) > 0) { |
|
1816 | + \OCP\Util::writeLog('files', |
|
1817 | + 'It is not allowed to move one mount point into a shared folder', |
|
1818 | + ILogger::DEBUG); |
|
1819 | + return false; |
|
1820 | + } |
|
1821 | + |
|
1822 | + return true; |
|
1823 | + } |
|
1824 | + |
|
1825 | + /** |
|
1826 | + * Get a fileinfo object for files that are ignored in the cache (part files) |
|
1827 | + * |
|
1828 | + * @param string $path |
|
1829 | + * @return \OCP\Files\FileInfo |
|
1830 | + */ |
|
1831 | + private function getPartFileInfo($path) { |
|
1832 | + $mount = $this->getMount($path); |
|
1833 | + $storage = $mount->getStorage(); |
|
1834 | + $internalPath = $mount->getInternalPath($this->getAbsolutePath($path)); |
|
1835 | + $owner = \OC::$server->getUserManager()->get($storage->getOwner($internalPath)); |
|
1836 | + return new FileInfo( |
|
1837 | + $this->getAbsolutePath($path), |
|
1838 | + $storage, |
|
1839 | + $internalPath, |
|
1840 | + [ |
|
1841 | + 'fileid' => null, |
|
1842 | + 'mimetype' => $storage->getMimeType($internalPath), |
|
1843 | + 'name' => basename($path), |
|
1844 | + 'etag' => null, |
|
1845 | + 'size' => $storage->filesize($internalPath), |
|
1846 | + 'mtime' => $storage->filemtime($internalPath), |
|
1847 | + 'encrypted' => false, |
|
1848 | + 'permissions' => \OCP\Constants::PERMISSION_ALL |
|
1849 | + ], |
|
1850 | + $mount, |
|
1851 | + $owner |
|
1852 | + ); |
|
1853 | + } |
|
1854 | + |
|
1855 | + /** |
|
1856 | + * @param string $path |
|
1857 | + * @param string $fileName |
|
1858 | + * @throws InvalidPathException |
|
1859 | + */ |
|
1860 | + public function verifyPath($path, $fileName) { |
|
1861 | + try { |
|
1862 | + /** @type \OCP\Files\Storage $storage */ |
|
1863 | + [$storage, $internalPath] = $this->resolvePath($path); |
|
1864 | + $storage->verifyPath($internalPath, $fileName); |
|
1865 | + } catch (ReservedWordException $ex) { |
|
1866 | + $l = \OC::$server->getL10N('lib'); |
|
1867 | + throw new InvalidPathException($l->t('File name is a reserved word')); |
|
1868 | + } catch (InvalidCharacterInPathException $ex) { |
|
1869 | + $l = \OC::$server->getL10N('lib'); |
|
1870 | + throw new InvalidPathException($l->t('File name contains at least one invalid character')); |
|
1871 | + } catch (FileNameTooLongException $ex) { |
|
1872 | + $l = \OC::$server->getL10N('lib'); |
|
1873 | + throw new InvalidPathException($l->t('File name is too long')); |
|
1874 | + } catch (InvalidDirectoryException $ex) { |
|
1875 | + $l = \OC::$server->getL10N('lib'); |
|
1876 | + throw new InvalidPathException($l->t('Dot files are not allowed')); |
|
1877 | + } catch (EmptyFileNameException $ex) { |
|
1878 | + $l = \OC::$server->getL10N('lib'); |
|
1879 | + throw new InvalidPathException($l->t('Empty filename is not allowed')); |
|
1880 | + } |
|
1881 | + } |
|
1882 | + |
|
1883 | + /** |
|
1884 | + * get all parent folders of $path |
|
1885 | + * |
|
1886 | + * @param string $path |
|
1887 | + * @return string[] |
|
1888 | + */ |
|
1889 | + private function getParents($path) { |
|
1890 | + $path = trim($path, '/'); |
|
1891 | + if (!$path) { |
|
1892 | + return []; |
|
1893 | + } |
|
1894 | + |
|
1895 | + $parts = explode('/', $path); |
|
1896 | + |
|
1897 | + // remove the single file |
|
1898 | + array_pop($parts); |
|
1899 | + $result = ['/']; |
|
1900 | + $resultPath = ''; |
|
1901 | + foreach ($parts as $part) { |
|
1902 | + if ($part) { |
|
1903 | + $resultPath .= '/' . $part; |
|
1904 | + $result[] = $resultPath; |
|
1905 | + } |
|
1906 | + } |
|
1907 | + return $result; |
|
1908 | + } |
|
1909 | + |
|
1910 | + /** |
|
1911 | + * Returns the mount point for which to lock |
|
1912 | + * |
|
1913 | + * @param string $absolutePath absolute path |
|
1914 | + * @param bool $useParentMount true to return parent mount instead of whatever |
|
1915 | + * is mounted directly on the given path, false otherwise |
|
1916 | + * @return IMountPoint mount point for which to apply locks |
|
1917 | + */ |
|
1918 | + private function getMountForLock($absolutePath, $useParentMount = false) { |
|
1919 | + $mount = Filesystem::getMountManager()->find($absolutePath); |
|
1920 | + |
|
1921 | + if ($useParentMount) { |
|
1922 | + // find out if something is mounted directly on the path |
|
1923 | + $internalPath = $mount->getInternalPath($absolutePath); |
|
1924 | + if ($internalPath === '') { |
|
1925 | + // resolve the parent mount instead |
|
1926 | + $mount = Filesystem::getMountManager()->find(dirname($absolutePath)); |
|
1927 | + } |
|
1928 | + } |
|
1929 | + |
|
1930 | + return $mount; |
|
1931 | + } |
|
1932 | + |
|
1933 | + /** |
|
1934 | + * Lock the given path |
|
1935 | + * |
|
1936 | + * @param string $path the path of the file to lock, relative to the view |
|
1937 | + * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
|
1938 | + * @param bool $lockMountPoint true to lock the mount point, false to lock the attached mount/storage |
|
1939 | + * |
|
1940 | + * @return bool False if the path is excluded from locking, true otherwise |
|
1941 | + * @throws LockedException if the path is already locked |
|
1942 | + */ |
|
1943 | + private function lockPath($path, $type, $lockMountPoint = false) { |
|
1944 | + $absolutePath = $this->getAbsolutePath($path); |
|
1945 | + $absolutePath = Filesystem::normalizePath($absolutePath); |
|
1946 | + if (!$this->shouldLockFile($absolutePath)) { |
|
1947 | + return false; |
|
1948 | + } |
|
1949 | + |
|
1950 | + $mount = $this->getMountForLock($absolutePath, $lockMountPoint); |
|
1951 | + if ($mount) { |
|
1952 | + try { |
|
1953 | + $storage = $mount->getStorage(); |
|
1954 | + if ($storage && $storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) { |
|
1955 | + $storage->acquireLock( |
|
1956 | + $mount->getInternalPath($absolutePath), |
|
1957 | + $type, |
|
1958 | + $this->lockingProvider |
|
1959 | + ); |
|
1960 | + } |
|
1961 | + } catch (LockedException $e) { |
|
1962 | + // rethrow with the a human-readable path |
|
1963 | + throw new LockedException( |
|
1964 | + $this->getPathRelativeToFiles($absolutePath), |
|
1965 | + $e, |
|
1966 | + $e->getExistingLock() |
|
1967 | + ); |
|
1968 | + } |
|
1969 | + } |
|
1970 | + |
|
1971 | + return true; |
|
1972 | + } |
|
1973 | + |
|
1974 | + /** |
|
1975 | + * Change the lock type |
|
1976 | + * |
|
1977 | + * @param string $path the path of the file to lock, relative to the view |
|
1978 | + * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
|
1979 | + * @param bool $lockMountPoint true to lock the mount point, false to lock the attached mount/storage |
|
1980 | + * |
|
1981 | + * @return bool False if the path is excluded from locking, true otherwise |
|
1982 | + * @throws LockedException if the path is already locked |
|
1983 | + */ |
|
1984 | + public function changeLock($path, $type, $lockMountPoint = false) { |
|
1985 | + $path = Filesystem::normalizePath($path); |
|
1986 | + $absolutePath = $this->getAbsolutePath($path); |
|
1987 | + $absolutePath = Filesystem::normalizePath($absolutePath); |
|
1988 | + if (!$this->shouldLockFile($absolutePath)) { |
|
1989 | + return false; |
|
1990 | + } |
|
1991 | + |
|
1992 | + $mount = $this->getMountForLock($absolutePath, $lockMountPoint); |
|
1993 | + if ($mount) { |
|
1994 | + try { |
|
1995 | + $storage = $mount->getStorage(); |
|
1996 | + if ($storage && $storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) { |
|
1997 | + $storage->changeLock( |
|
1998 | + $mount->getInternalPath($absolutePath), |
|
1999 | + $type, |
|
2000 | + $this->lockingProvider |
|
2001 | + ); |
|
2002 | + } |
|
2003 | + } catch (LockedException $e) { |
|
2004 | + try { |
|
2005 | + // rethrow with the a human-readable path |
|
2006 | + throw new LockedException( |
|
2007 | + $this->getPathRelativeToFiles($absolutePath), |
|
2008 | + $e, |
|
2009 | + $e->getExistingLock() |
|
2010 | + ); |
|
2011 | + } catch (\InvalidArgumentException $ex) { |
|
2012 | + throw new LockedException( |
|
2013 | + $absolutePath, |
|
2014 | + $ex, |
|
2015 | + $e->getExistingLock() |
|
2016 | + ); |
|
2017 | + } |
|
2018 | + } |
|
2019 | + } |
|
2020 | + |
|
2021 | + return true; |
|
2022 | + } |
|
2023 | + |
|
2024 | + /** |
|
2025 | + * Unlock the given path |
|
2026 | + * |
|
2027 | + * @param string $path the path of the file to unlock, relative to the view |
|
2028 | + * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
|
2029 | + * @param bool $lockMountPoint true to lock the mount point, false to lock the attached mount/storage |
|
2030 | + * |
|
2031 | + * @return bool False if the path is excluded from locking, true otherwise |
|
2032 | + * @throws LockedException |
|
2033 | + */ |
|
2034 | + private function unlockPath($path, $type, $lockMountPoint = false) { |
|
2035 | + $absolutePath = $this->getAbsolutePath($path); |
|
2036 | + $absolutePath = Filesystem::normalizePath($absolutePath); |
|
2037 | + if (!$this->shouldLockFile($absolutePath)) { |
|
2038 | + return false; |
|
2039 | + } |
|
2040 | + |
|
2041 | + $mount = $this->getMountForLock($absolutePath, $lockMountPoint); |
|
2042 | + if ($mount) { |
|
2043 | + $storage = $mount->getStorage(); |
|
2044 | + if ($storage && $storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) { |
|
2045 | + $storage->releaseLock( |
|
2046 | + $mount->getInternalPath($absolutePath), |
|
2047 | + $type, |
|
2048 | + $this->lockingProvider |
|
2049 | + ); |
|
2050 | + } |
|
2051 | + } |
|
2052 | + |
|
2053 | + return true; |
|
2054 | + } |
|
2055 | + |
|
2056 | + /** |
|
2057 | + * Lock a path and all its parents up to the root of the view |
|
2058 | + * |
|
2059 | + * @param string $path the path of the file to lock relative to the view |
|
2060 | + * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
|
2061 | + * @param bool $lockMountPoint true to lock the mount point, false to lock the attached mount/storage |
|
2062 | + * |
|
2063 | + * @return bool False if the path is excluded from locking, true otherwise |
|
2064 | + * @throws LockedException |
|
2065 | + */ |
|
2066 | + public function lockFile($path, $type, $lockMountPoint = false) { |
|
2067 | + $absolutePath = $this->getAbsolutePath($path); |
|
2068 | + $absolutePath = Filesystem::normalizePath($absolutePath); |
|
2069 | + if (!$this->shouldLockFile($absolutePath)) { |
|
2070 | + return false; |
|
2071 | + } |
|
2072 | + |
|
2073 | + $this->lockPath($path, $type, $lockMountPoint); |
|
2074 | + |
|
2075 | + $parents = $this->getParents($path); |
|
2076 | + foreach ($parents as $parent) { |
|
2077 | + $this->lockPath($parent, ILockingProvider::LOCK_SHARED); |
|
2078 | + } |
|
2079 | + |
|
2080 | + return true; |
|
2081 | + } |
|
2082 | + |
|
2083 | + /** |
|
2084 | + * Unlock a path and all its parents up to the root of the view |
|
2085 | + * |
|
2086 | + * @param string $path the path of the file to lock relative to the view |
|
2087 | + * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
|
2088 | + * @param bool $lockMountPoint true to lock the mount point, false to lock the attached mount/storage |
|
2089 | + * |
|
2090 | + * @return bool False if the path is excluded from locking, true otherwise |
|
2091 | + * @throws LockedException |
|
2092 | + */ |
|
2093 | + public function unlockFile($path, $type, $lockMountPoint = false) { |
|
2094 | + $absolutePath = $this->getAbsolutePath($path); |
|
2095 | + $absolutePath = Filesystem::normalizePath($absolutePath); |
|
2096 | + if (!$this->shouldLockFile($absolutePath)) { |
|
2097 | + return false; |
|
2098 | + } |
|
2099 | + |
|
2100 | + $this->unlockPath($path, $type, $lockMountPoint); |
|
2101 | + |
|
2102 | + $parents = $this->getParents($path); |
|
2103 | + foreach ($parents as $parent) { |
|
2104 | + $this->unlockPath($parent, ILockingProvider::LOCK_SHARED); |
|
2105 | + } |
|
2106 | + |
|
2107 | + return true; |
|
2108 | + } |
|
2109 | + |
|
2110 | + /** |
|
2111 | + * Only lock files in data/user/files/ |
|
2112 | + * |
|
2113 | + * @param string $path Absolute path to the file/folder we try to (un)lock |
|
2114 | + * @return bool |
|
2115 | + */ |
|
2116 | + protected function shouldLockFile($path) { |
|
2117 | + $path = Filesystem::normalizePath($path); |
|
2118 | + |
|
2119 | + $pathSegments = explode('/', $path); |
|
2120 | + if (isset($pathSegments[2])) { |
|
2121 | + // E.g.: /username/files/path-to-file |
|
2122 | + return ($pathSegments[2] === 'files') && (count($pathSegments) > 3); |
|
2123 | + } |
|
2124 | + |
|
2125 | + return strpos($path, '/appdata_') !== 0; |
|
2126 | + } |
|
2127 | + |
|
2128 | + /** |
|
2129 | + * Shortens the given absolute path to be relative to |
|
2130 | + * "$user/files". |
|
2131 | + * |
|
2132 | + * @param string $absolutePath absolute path which is under "files" |
|
2133 | + * |
|
2134 | + * @return string path relative to "files" with trimmed slashes or null |
|
2135 | + * if the path was NOT relative to files |
|
2136 | + * |
|
2137 | + * @throws \InvalidArgumentException if the given path was not under "files" |
|
2138 | + * @since 8.1.0 |
|
2139 | + */ |
|
2140 | + public function getPathRelativeToFiles($absolutePath) { |
|
2141 | + $path = Filesystem::normalizePath($absolutePath); |
|
2142 | + $parts = explode('/', trim($path, '/'), 3); |
|
2143 | + // "$user", "files", "path/to/dir" |
|
2144 | + if (!isset($parts[1]) || $parts[1] !== 'files') { |
|
2145 | + $this->logger->error( |
|
2146 | + '$absolutePath must be relative to "files", value is "%s"', |
|
2147 | + [ |
|
2148 | + $absolutePath |
|
2149 | + ] |
|
2150 | + ); |
|
2151 | + throw new \InvalidArgumentException('$absolutePath must be relative to "files"'); |
|
2152 | + } |
|
2153 | + if (isset($parts[2])) { |
|
2154 | + return $parts[2]; |
|
2155 | + } |
|
2156 | + return ''; |
|
2157 | + } |
|
2158 | + |
|
2159 | + /** |
|
2160 | + * @param string $filename |
|
2161 | + * @return array |
|
2162 | + * @throws \OC\User\NoUserException |
|
2163 | + * @throws NotFoundException |
|
2164 | + */ |
|
2165 | + public function getUidAndFilename($filename) { |
|
2166 | + $info = $this->getFileInfo($filename); |
|
2167 | + if (!$info instanceof \OCP\Files\FileInfo) { |
|
2168 | + throw new NotFoundException($this->getAbsolutePath($filename) . ' not found'); |
|
2169 | + } |
|
2170 | + $uid = $info->getOwner()->getUID(); |
|
2171 | + if ($uid != \OC_User::getUser()) { |
|
2172 | + Filesystem::initMountPoints($uid); |
|
2173 | + $ownerView = new View('/' . $uid . '/files'); |
|
2174 | + try { |
|
2175 | + $filename = $ownerView->getPath($info['fileid']); |
|
2176 | + } catch (NotFoundException $e) { |
|
2177 | + throw new NotFoundException('File with id ' . $info['fileid'] . ' not found for user ' . $uid); |
|
2178 | + } |
|
2179 | + } |
|
2180 | + return [$uid, $filename]; |
|
2181 | + } |
|
2182 | + |
|
2183 | + /** |
|
2184 | + * Creates parent non-existing folders |
|
2185 | + * |
|
2186 | + * @param string $filePath |
|
2187 | + * @return bool |
|
2188 | + */ |
|
2189 | + private function createParentDirectories($filePath) { |
|
2190 | + $directoryParts = explode('/', $filePath); |
|
2191 | + $directoryParts = array_filter($directoryParts); |
|
2192 | + foreach ($directoryParts as $key => $part) { |
|
2193 | + $currentPathElements = array_slice($directoryParts, 0, $key); |
|
2194 | + $currentPath = '/' . implode('/', $currentPathElements); |
|
2195 | + if ($this->is_file($currentPath)) { |
|
2196 | + return false; |
|
2197 | + } |
|
2198 | + if (!$this->file_exists($currentPath)) { |
|
2199 | + $this->mkdir($currentPath); |
|
2200 | + } |
|
2201 | + } |
|
2202 | + |
|
2203 | + return true; |
|
2204 | + } |
|
2205 | 2205 | } |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | $path = '/'; |
131 | 131 | } |
132 | 132 | if ($path[0] !== '/') { |
133 | - $path = '/' . $path; |
|
133 | + $path = '/'.$path; |
|
134 | 134 | } |
135 | - return $this->fakeRoot . $path; |
|
135 | + return $this->fakeRoot.$path; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | public function chroot($fakeRoot) { |
145 | 145 | if (!$fakeRoot == '') { |
146 | 146 | if ($fakeRoot[0] !== '/') { |
147 | - $fakeRoot = '/' . $fakeRoot; |
|
147 | + $fakeRoot = '/'.$fakeRoot; |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | $this->fakeRoot = $fakeRoot; |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | } |
177 | 177 | |
178 | 178 | // missing slashes can cause wrong matches! |
179 | - $root = rtrim($this->fakeRoot, '/') . '/'; |
|
179 | + $root = rtrim($this->fakeRoot, '/').'/'; |
|
180 | 180 | |
181 | 181 | if (strpos($path, $root) !== 0) { |
182 | 182 | return null; |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | if ($mount instanceof MoveableMount) { |
283 | 283 | // cut of /user/files to get the relative path to data/user/files |
284 | 284 | $pathParts = explode('/', $path, 4); |
285 | - $relPath = '/' . $pathParts[3]; |
|
285 | + $relPath = '/'.$pathParts[3]; |
|
286 | 286 | $this->lockFile($relPath, ILockingProvider::LOCK_SHARED, true); |
287 | 287 | \OC_Hook::emit( |
288 | 288 | Filesystem::CLASSNAME, "umount", |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | } |
719 | 719 | $postFix = (substr($path, -1) === '/') ? '/' : ''; |
720 | 720 | $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); |
721 | - $mount = Filesystem::getMountManager()->find($absolutePath . $postFix); |
|
721 | + $mount = Filesystem::getMountManager()->find($absolutePath.$postFix); |
|
722 | 722 | if ($mount->getInternalPath($absolutePath) === '') { |
723 | 723 | return $this->removeMount($mount, $absolutePath); |
724 | 724 | } |
@@ -995,7 +995,7 @@ discard block |
||
995 | 995 | $hooks[] = 'write'; |
996 | 996 | break; |
997 | 997 | default: |
998 | - \OCP\Util::writeLog('core', 'invalid mode (' . $mode . ') for ' . $path, ILogger::ERROR); |
|
998 | + \OCP\Util::writeLog('core', 'invalid mode ('.$mode.') for '.$path, ILogger::ERROR); |
|
999 | 999 | } |
1000 | 1000 | |
1001 | 1001 | if ($mode !== 'r' && $mode !== 'w') { |
@@ -1100,7 +1100,7 @@ discard block |
||
1100 | 1100 | ); |
1101 | 1101 | } |
1102 | 1102 | /** @var Storage|null $storage */ |
1103 | - [$storage, $internalPath] = Filesystem::resolvePath($absolutePath . $postFix); |
|
1103 | + [$storage, $internalPath] = Filesystem::resolvePath($absolutePath.$postFix); |
|
1104 | 1104 | if ($storage) { |
1105 | 1105 | return $storage->hash($type, $internalPath, $raw); |
1106 | 1106 | } |
@@ -1154,7 +1154,7 @@ discard block |
||
1154 | 1154 | |
1155 | 1155 | $run = $this->runHooks($hooks, $path); |
1156 | 1156 | /** @var \OC\Files\Storage\Storage $storage */ |
1157 | - [$storage, $internalPath] = Filesystem::resolvePath($absolutePath . $postFix); |
|
1157 | + [$storage, $internalPath] = Filesystem::resolvePath($absolutePath.$postFix); |
|
1158 | 1158 | if ($run and $storage) { |
1159 | 1159 | if (in_array('write', $hooks) || in_array('delete', $hooks)) { |
1160 | 1160 | try { |
@@ -1199,7 +1199,7 @@ discard block |
||
1199 | 1199 | $unlockLater = true; |
1200 | 1200 | // make sure our unlocking callback will still be called if connection is aborted |
1201 | 1201 | ignore_user_abort(true); |
1202 | - $result = CallbackWrapper::wrap($result, null, null, function () use ($hooks, $path) { |
|
1202 | + $result = CallbackWrapper::wrap($result, null, null, function() use ($hooks, $path) { |
|
1203 | 1203 | if (in_array('write', $hooks)) { |
1204 | 1204 | $this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE); |
1205 | 1205 | } elseif (in_array('read', $hooks)) { |
@@ -1260,7 +1260,7 @@ discard block |
||
1260 | 1260 | return true; |
1261 | 1261 | } |
1262 | 1262 | |
1263 | - return (strlen($fullPath) > strlen($defaultRoot)) && (substr($fullPath, 0, strlen($defaultRoot) + 1) === $defaultRoot . '/'); |
|
1263 | + return (strlen($fullPath) > strlen($defaultRoot)) && (substr($fullPath, 0, strlen($defaultRoot) + 1) === $defaultRoot.'/'); |
|
1264 | 1264 | } |
1265 | 1265 | |
1266 | 1266 | /** |
@@ -1279,7 +1279,7 @@ discard block |
||
1279 | 1279 | if ($hook != 'read') { |
1280 | 1280 | \OC_Hook::emit( |
1281 | 1281 | Filesystem::CLASSNAME, |
1282 | - $prefix . $hook, |
|
1282 | + $prefix.$hook, |
|
1283 | 1283 | [ |
1284 | 1284 | Filesystem::signal_param_run => &$run, |
1285 | 1285 | Filesystem::signal_param_path => $path |
@@ -1288,7 +1288,7 @@ discard block |
||
1288 | 1288 | } elseif (!$post) { |
1289 | 1289 | \OC_Hook::emit( |
1290 | 1290 | Filesystem::CLASSNAME, |
1291 | - $prefix . $hook, |
|
1291 | + $prefix.$hook, |
|
1292 | 1292 | [ |
1293 | 1293 | Filesystem::signal_param_path => $path |
1294 | 1294 | ] |
@@ -1381,7 +1381,7 @@ discard block |
||
1381 | 1381 | return $this->getPartFileInfo($path); |
1382 | 1382 | } |
1383 | 1383 | $relativePath = $path; |
1384 | - $path = Filesystem::normalizePath($this->fakeRoot . '/' . $path); |
|
1384 | + $path = Filesystem::normalizePath($this->fakeRoot.'/'.$path); |
|
1385 | 1385 | |
1386 | 1386 | $mount = Filesystem::getMountManager()->find($path); |
1387 | 1387 | $storage = $mount->getStorage(); |
@@ -1409,7 +1409,7 @@ discard block |
||
1409 | 1409 | //add the sizes of other mount points to the folder |
1410 | 1410 | $extOnly = ($includeMountPoints === 'ext'); |
1411 | 1411 | $mounts = Filesystem::getMountManager()->findIn($path); |
1412 | - $info->setSubMounts(array_filter($mounts, function (IMountPoint $mount) use ($extOnly) { |
|
1412 | + $info->setSubMounts(array_filter($mounts, function(IMountPoint $mount) use ($extOnly) { |
|
1413 | 1413 | $subStorage = $mount->getStorage(); |
1414 | 1414 | return !($extOnly && $subStorage instanceof \OCA\Files_Sharing\SharedStorage); |
1415 | 1415 | })); |
@@ -1418,7 +1418,7 @@ discard block |
||
1418 | 1418 | |
1419 | 1419 | return $info; |
1420 | 1420 | } else { |
1421 | - \OC::$server->getLogger()->warning('Storage not valid for mountpoint: ' . $mount->getMountPoint()); |
|
1421 | + \OC::$server->getLogger()->warning('Storage not valid for mountpoint: '.$mount->getMountPoint()); |
|
1422 | 1422 | } |
1423 | 1423 | |
1424 | 1424 | return false; |
@@ -1459,18 +1459,18 @@ discard block |
||
1459 | 1459 | |
1460 | 1460 | $sharingDisabled = \OCP\Util::isSharingDisabledForUser(); |
1461 | 1461 | |
1462 | - $fileNames = array_map(function (ICacheEntry $content) { |
|
1462 | + $fileNames = array_map(function(ICacheEntry $content) { |
|
1463 | 1463 | return $content->getName(); |
1464 | 1464 | }, $contents); |
1465 | 1465 | /** |
1466 | 1466 | * @var \OC\Files\FileInfo[] $fileInfos |
1467 | 1467 | */ |
1468 | - $fileInfos = array_map(function (ICacheEntry $content) use ($path, $storage, $mount, $sharingDisabled) { |
|
1468 | + $fileInfos = array_map(function(ICacheEntry $content) use ($path, $storage, $mount, $sharingDisabled) { |
|
1469 | 1469 | if ($sharingDisabled) { |
1470 | 1470 | $content['permissions'] = $content['permissions'] & ~\OCP\Constants::PERMISSION_SHARE; |
1471 | 1471 | } |
1472 | 1472 | $owner = $this->getUserObjectForOwner($storage->getOwner($content['path'])); |
1473 | - return new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content, $mount, $owner); |
|
1473 | + return new FileInfo($path.'/'.$content['name'], $storage, $content['path'], $content, $mount, $owner); |
|
1474 | 1474 | }, $contents); |
1475 | 1475 | $files = array_combine($fileNames, $fileInfos); |
1476 | 1476 | |
@@ -1495,7 +1495,7 @@ discard block |
||
1495 | 1495 | } catch (\Exception $e) { |
1496 | 1496 | // sometimes when the storage is not available it can be any exception |
1497 | 1497 | \OC::$server->getLogger()->logException($e, [ |
1498 | - 'message' => 'Exception while scanning storage "' . $subStorage->getId() . '"', |
|
1498 | + 'message' => 'Exception while scanning storage "'.$subStorage->getId().'"', |
|
1499 | 1499 | 'level' => ILogger::ERROR, |
1500 | 1500 | 'app' => 'lib', |
1501 | 1501 | ]); |
@@ -1526,7 +1526,7 @@ discard block |
||
1526 | 1526 | $rootEntry['permissions'] = $permissions & (\OCP\Constants::PERMISSION_ALL - (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE)); |
1527 | 1527 | } |
1528 | 1528 | |
1529 | - $rootEntry['path'] = substr(Filesystem::normalizePath($path . '/' . $rootEntry['name']), strlen($user) + 2); // full path without /$user/ |
|
1529 | + $rootEntry['path'] = substr(Filesystem::normalizePath($path.'/'.$rootEntry['name']), strlen($user) + 2); // full path without /$user/ |
|
1530 | 1530 | |
1531 | 1531 | // if sharing was disabled for the user we remove the share permissions |
1532 | 1532 | if (\OCP\Util::isSharingDisabledForUser()) { |
@@ -1534,14 +1534,14 @@ discard block |
||
1534 | 1534 | } |
1535 | 1535 | |
1536 | 1536 | $owner = $this->getUserObjectForOwner($subStorage->getOwner('')); |
1537 | - $files[$rootEntry->getName()] = new FileInfo($path . '/' . $rootEntry['name'], $subStorage, '', $rootEntry, $mount, $owner); |
|
1537 | + $files[$rootEntry->getName()] = new FileInfo($path.'/'.$rootEntry['name'], $subStorage, '', $rootEntry, $mount, $owner); |
|
1538 | 1538 | } |
1539 | 1539 | } |
1540 | 1540 | } |
1541 | 1541 | } |
1542 | 1542 | |
1543 | 1543 | if ($mimetype_filter) { |
1544 | - $files = array_filter($files, function (FileInfo $file) use ($mimetype_filter) { |
|
1544 | + $files = array_filter($files, function(FileInfo $file) use ($mimetype_filter) { |
|
1545 | 1545 | if (strpos($mimetype_filter, '/')) { |
1546 | 1546 | return $file->getMimetype() === $mimetype_filter; |
1547 | 1547 | } else { |
@@ -1570,7 +1570,7 @@ discard block |
||
1570 | 1570 | if ($data instanceof FileInfo) { |
1571 | 1571 | $data = $data->getData(); |
1572 | 1572 | } |
1573 | - $path = Filesystem::normalizePath($this->fakeRoot . '/' . $path); |
|
1573 | + $path = Filesystem::normalizePath($this->fakeRoot.'/'.$path); |
|
1574 | 1574 | /** |
1575 | 1575 | * @var \OC\Files\Storage\Storage $storage |
1576 | 1576 | * @var string $internalPath |
@@ -1597,7 +1597,7 @@ discard block |
||
1597 | 1597 | * @return FileInfo[] |
1598 | 1598 | */ |
1599 | 1599 | public function search($query) { |
1600 | - return $this->searchCommon('search', ['%' . $query . '%']); |
|
1600 | + return $this->searchCommon('search', ['%'.$query.'%']); |
|
1601 | 1601 | } |
1602 | 1602 | |
1603 | 1603 | /** |
@@ -1649,10 +1649,10 @@ discard block |
||
1649 | 1649 | |
1650 | 1650 | $results = call_user_func_array([$cache, $method], $args); |
1651 | 1651 | foreach ($results as $result) { |
1652 | - if (substr($mountPoint . $result['path'], 0, $rootLength + 1) === $this->fakeRoot . '/') { |
|
1652 | + if (substr($mountPoint.$result['path'], 0, $rootLength + 1) === $this->fakeRoot.'/') { |
|
1653 | 1653 | $internalPath = $result['path']; |
1654 | - $path = $mountPoint . $result['path']; |
|
1655 | - $result['path'] = substr($mountPoint . $result['path'], $rootLength); |
|
1654 | + $path = $mountPoint.$result['path']; |
|
1655 | + $result['path'] = substr($mountPoint.$result['path'], $rootLength); |
|
1656 | 1656 | $owner = $userManager->get($storage->getOwner($internalPath)); |
1657 | 1657 | $files[] = new FileInfo($path, $storage, $internalPath, $result, $mount, $owner); |
1658 | 1658 | } |
@@ -1670,8 +1670,8 @@ discard block |
||
1670 | 1670 | if ($results) { |
1671 | 1671 | foreach ($results as $result) { |
1672 | 1672 | $internalPath = $result['path']; |
1673 | - $result['path'] = rtrim($relativeMountPoint . $result['path'], '/'); |
|
1674 | - $path = rtrim($mountPoint . $internalPath, '/'); |
|
1673 | + $result['path'] = rtrim($relativeMountPoint.$result['path'], '/'); |
|
1674 | + $path = rtrim($mountPoint.$internalPath, '/'); |
|
1675 | 1675 | $owner = $userManager->get($storage->getOwner($internalPath)); |
1676 | 1676 | $files[] = new FileInfo($path, $storage, $internalPath, $result, $mount, $owner); |
1677 | 1677 | } |
@@ -1692,11 +1692,11 @@ discard block |
||
1692 | 1692 | public function getOwner($path) { |
1693 | 1693 | $info = $this->getFileInfo($path); |
1694 | 1694 | if (!$info) { |
1695 | - throw new NotFoundException($path . ' not found while trying to get owner'); |
|
1695 | + throw new NotFoundException($path.' not found while trying to get owner'); |
|
1696 | 1696 | } |
1697 | 1697 | |
1698 | 1698 | if ($info->getOwner() === null) { |
1699 | - throw new NotFoundException($path . ' has no owner'); |
|
1699 | + throw new NotFoundException($path.' has no owner'); |
|
1700 | 1700 | } |
1701 | 1701 | |
1702 | 1702 | return $info->getOwner()->getUID(); |
@@ -1732,7 +1732,7 @@ discard block |
||
1732 | 1732 | * @throws NotFoundException |
1733 | 1733 | */ |
1734 | 1734 | public function getPath($id, int $storageId = null) { |
1735 | - $id = (int)$id; |
|
1735 | + $id = (int) $id; |
|
1736 | 1736 | $manager = Filesystem::getMountManager(); |
1737 | 1737 | $mounts = $manager->findIn($this->fakeRoot); |
1738 | 1738 | $mounts[] = $manager->find($this->fakeRoot); |
@@ -1743,12 +1743,12 @@ discard block |
||
1743 | 1743 | |
1744 | 1744 | // put non-shared mounts in front of the shared mount |
1745 | 1745 | // this prevents unneeded recursion into shares |
1746 | - usort($mounts, function (IMountPoint $a, IMountPoint $b) { |
|
1746 | + usort($mounts, function(IMountPoint $a, IMountPoint $b) { |
|
1747 | 1747 | return $a instanceof SharedMount && (!$b instanceof SharedMount) ? 1 : -1; |
1748 | 1748 | }); |
1749 | 1749 | |
1750 | 1750 | if (!is_null($storageId)) { |
1751 | - $mounts = array_filter($mounts, function (IMountPoint $mount) use ($storageId) { |
|
1751 | + $mounts = array_filter($mounts, function(IMountPoint $mount) use ($storageId) { |
|
1752 | 1752 | return $mount->getNumericStorageId() === $storageId; |
1753 | 1753 | }); |
1754 | 1754 | } |
@@ -1761,7 +1761,7 @@ discard block |
||
1761 | 1761 | $cache = $mount->getStorage()->getCache(); |
1762 | 1762 | $internalPath = $cache->getPathById($id); |
1763 | 1763 | if (is_string($internalPath)) { |
1764 | - $fullPath = $mount->getMountPoint() . $internalPath; |
|
1764 | + $fullPath = $mount->getMountPoint().$internalPath; |
|
1765 | 1765 | if (!is_null($path = $this->getRelativePath($fullPath))) { |
1766 | 1766 | return $path; |
1767 | 1767 | } |
@@ -1797,10 +1797,10 @@ discard block |
||
1797 | 1797 | private function targetIsNotShared(IStorage $targetStorage, string $targetInternalPath) { |
1798 | 1798 | |
1799 | 1799 | // note: cannot use the view because the target is already locked |
1800 | - $fileId = (int)$targetStorage->getCache()->getId($targetInternalPath); |
|
1800 | + $fileId = (int) $targetStorage->getCache()->getId($targetInternalPath); |
|
1801 | 1801 | if ($fileId === -1) { |
1802 | 1802 | // target might not exist, need to check parent instead |
1803 | - $fileId = (int)$targetStorage->getCache()->getId(dirname($targetInternalPath)); |
|
1803 | + $fileId = (int) $targetStorage->getCache()->getId(dirname($targetInternalPath)); |
|
1804 | 1804 | } |
1805 | 1805 | |
1806 | 1806 | // check if any of the parents were shared by the current owner (include collections) |
@@ -1900,7 +1900,7 @@ discard block |
||
1900 | 1900 | $resultPath = ''; |
1901 | 1901 | foreach ($parts as $part) { |
1902 | 1902 | if ($part) { |
1903 | - $resultPath .= '/' . $part; |
|
1903 | + $resultPath .= '/'.$part; |
|
1904 | 1904 | $result[] = $resultPath; |
1905 | 1905 | } |
1906 | 1906 | } |
@@ -2165,16 +2165,16 @@ discard block |
||
2165 | 2165 | public function getUidAndFilename($filename) { |
2166 | 2166 | $info = $this->getFileInfo($filename); |
2167 | 2167 | if (!$info instanceof \OCP\Files\FileInfo) { |
2168 | - throw new NotFoundException($this->getAbsolutePath($filename) . ' not found'); |
|
2168 | + throw new NotFoundException($this->getAbsolutePath($filename).' not found'); |
|
2169 | 2169 | } |
2170 | 2170 | $uid = $info->getOwner()->getUID(); |
2171 | 2171 | if ($uid != \OC_User::getUser()) { |
2172 | 2172 | Filesystem::initMountPoints($uid); |
2173 | - $ownerView = new View('/' . $uid . '/files'); |
|
2173 | + $ownerView = new View('/'.$uid.'/files'); |
|
2174 | 2174 | try { |
2175 | 2175 | $filename = $ownerView->getPath($info['fileid']); |
2176 | 2176 | } catch (NotFoundException $e) { |
2177 | - throw new NotFoundException('File with id ' . $info['fileid'] . ' not found for user ' . $uid); |
|
2177 | + throw new NotFoundException('File with id '.$info['fileid'].' not found for user '.$uid); |
|
2178 | 2178 | } |
2179 | 2179 | } |
2180 | 2180 | return [$uid, $filename]; |
@@ -2191,7 +2191,7 @@ discard block |
||
2191 | 2191 | $directoryParts = array_filter($directoryParts); |
2192 | 2192 | foreach ($directoryParts as $key => $part) { |
2193 | 2193 | $currentPathElements = array_slice($directoryParts, 0, $key); |
2194 | - $currentPath = '/' . implode('/', $currentPathElements); |
|
2194 | + $currentPath = '/'.implode('/', $currentPathElements); |
|
2195 | 2195 | if ($this->is_file($currentPath)) { |
2196 | 2196 | return false; |
2197 | 2197 | } |