1
0

direct.php 936 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. use OCA\DAV\Db\DirectMapper;
  8. use OCA\DAV\Direct\ServerFactory;
  9. use OCP\AppFramework\Utility\ITimeFactory;
  10. // no php execution timeout for webdav
  11. if (!str_contains(@ini_get('disable_functions'), 'set_time_limit')) {
  12. @set_time_limit(0);
  13. }
  14. ignore_user_abort(true);
  15. // Turn off output buffering to prevent memory problems
  16. \OC_Util::obEnd();
  17. $requestUri = \OC::$server->getRequest()->getRequestUri();
  18. /** @var ServerFactory $serverFactory */
  19. $serverFactory = \OC::$server->query(ServerFactory::class);
  20. $server = $serverFactory->createServer(
  21. $baseuri,
  22. $requestUri,
  23. \OC::$server->getRootFolder(),
  24. \OC::$server->query(DirectMapper::class),
  25. \OC::$server->query(ITimeFactory::class),
  26. \OC::$server->getBruteForceThrottler(),
  27. \OC::$server->getRequest()
  28. );
  29. $server->exec();