Capabilities.php 620 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016 ownCloud GmbH
  4. * SPDX-License-Identifier: AGPL-3.0-only
  5. */
  6. namespace OCA\DAV;
  7. use OCP\Capabilities\ICapability;
  8. use OCP\IConfig;
  9. class Capabilities implements ICapability {
  10. public function __construct(
  11. private IConfig $config,
  12. ) {
  13. }
  14. /**
  15. * @return array{dav: array{chunking: string, bulkupload?: string}}
  16. */
  17. public function getCapabilities() {
  18. $capabilities = [
  19. 'dav' => [
  20. 'chunking' => '1.0',
  21. ]
  22. ];
  23. if ($this->config->getSystemValueBool('bulkupload.enabled', true)) {
  24. $capabilities['dav']['bulkupload'] = '1.0';
  25. }
  26. return $capabilities;
  27. }
  28. }