direct.php 902 B

12345678910111213141516171819202122232425262728293031323334
  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\Direct\ServerFactory;
  8. // no php execution timeout for webdav
  9. if (!str_contains(@ini_get('disable_functions'), 'set_time_limit')) {
  10. @set_time_limit(0);
  11. }
  12. ignore_user_abort(true);
  13. // Turn off output buffering to prevent memory problems
  14. \OC_Util::obEnd();
  15. $requestUri = \OC::$server->getRequest()->getRequestUri();
  16. /** @var ServerFactory $serverFactory */
  17. $serverFactory = \OC::$server->query(ServerFactory::class);
  18. $server = $serverFactory->createServer(
  19. $baseuri,
  20. $requestUri,
  21. \OC::$server->getRootFolder(),
  22. \OC::$server->query(\OCA\DAV\Db\DirectMapper::class),
  23. \OC::$server->query(\OCP\AppFramework\Utility\ITimeFactory::class),
  24. \OC::$server->getBruteForceThrottler(),
  25. \OC::$server->getRequest()
  26. );
  27. $server->exec();