1<?php
2
3declare(strict_types=1);
4
5/**
6 * @copyright 2018, Roeland Jago Douma <roeland@famdouma.nl>
7 *
8 * @author Robin Appelman <robin@icewind.nl>
9 * @author Roeland Jago Douma <roeland@famdouma.nl>
10 *
11 * @license GNU AGPL version 3 or any later version
12 *
13 * This program is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU Affero General Public License as
15 * published by the Free Software Foundation, either version 3 of the
16 * License, or (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Affero General Public License for more details.
22 *
23 * You should have received a copy of the GNU Affero General Public License
24 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 *
26 */
27use \OCA\DAV\Direct\ServerFactory;
28
29// no php execution timeout for webdav
30if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
31	@set_time_limit(0);
32}
33ignore_user_abort(true);
34
35// Turn off output buffering to prevent memory problems
36\OC_Util::obEnd();
37
38$requestUri = \OC::$server->getRequest()->getRequestUri();
39
40/** @var ServerFactory $serverFactory */
41$serverFactory = \OC::$server->query(ServerFactory::class);
42$server = $serverFactory->createServer(
43	$baseuri,
44	$requestUri,
45	\OC::$server->getRootFolder(),
46	\OC::$server->query(\OCA\DAV\Db\DirectMapper::class),
47	\OC::$server->query(\OCP\AppFramework\Utility\ITimeFactory::class),
48	\OC::$server->getBruteForceThrottler(),
49	\OC::$server->getRequest()
50);
51
52$server->exec();
53