Capabilities.php 660 B

1234567891011121314151617181920212223242526272829303132
  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. private IConfig $config;
  11. public function __construct(IConfig $config) {
  12. $this->config = $config;
  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. }