2010-03-10 15:03:40 +03:00
|
|
|
<?php
|
|
|
|
/**
|
2015-03-26 13:44:34 +03:00
|
|
|
* @author Frank Karlitschek <frank@owncloud.org>
|
|
|
|
* @author Jakob Sack <mail@jakobsack.de>
|
2015-10-05 21:54:56 +03:00
|
|
|
* @author Joas Schilling <nickvergessen@owncloud.com>
|
2015-03-26 13:44:34 +03:00
|
|
|
* @author Lukas Reschke <lukas@owncloud.com>
|
|
|
|
* @author Morris Jobke <hey@morrisjobke.de>
|
|
|
|
* @author Robin Appelman <icewind@owncloud.com>
|
|
|
|
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
|
|
|
* @author Vincent Petry <pvince81@owncloud.com>
|
2011-07-20 17:53:34 +04:00
|
|
|
*
|
2015-03-26 13:44:34 +03:00
|
|
|
* @copyright Copyright (c) 2015, ownCloud, Inc.
|
|
|
|
* @license AGPL-3.0
|
2011-07-20 17:53:34 +04:00
|
|
|
*
|
2015-03-26 13:44:34 +03:00
|
|
|
* This code is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License, version 3,
|
|
|
|
* as published by the Free Software Foundation.
|
2011-07-20 17:53:34 +04:00
|
|
|
*
|
2015-03-26 13:44:34 +03:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
2011-07-20 17:53:34 +04:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2015-03-26 13:44:34 +03:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
2011-07-20 17:53:34 +04:00
|
|
|
*
|
2015-03-26 13:44:34 +03:00
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3,
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
2011-07-20 17:53:34 +04:00
|
|
|
*
|
|
|
|
*/
|
2015-02-26 13:37:37 +03:00
|
|
|
|
2015-03-26 13:55:26 +03:00
|
|
|
// no php execution timeout for webdav
|
|
|
|
set_time_limit(0);
|
|
|
|
|
2015-05-04 15:15:15 +03:00
|
|
|
// Turn off output buffering to prevent memory problems
|
|
|
|
\OC_Util::obEnd();
|
2015-03-26 13:55:26 +03:00
|
|
|
|
2015-08-30 20:13:01 +03:00
|
|
|
$serverFactory = new \OCA\DAV\Connector\Sabre\ServerFactory(
|
2015-08-07 18:36:14 +03:00
|
|
|
\OC::$server->getConfig(),
|
|
|
|
\OC::$server->getLogger(),
|
|
|
|
\OC::$server->getDatabaseConnection(),
|
|
|
|
\OC::$server->getUserSession(),
|
|
|
|
\OC::$server->getMountManager(),
|
2015-09-17 14:47:58 +03:00
|
|
|
\OC::$server->getTagManager(),
|
|
|
|
\OC::$server->getEventDispatcher()
|
2015-08-07 18:36:14 +03:00
|
|
|
);
|
|
|
|
|
2011-08-06 13:36:56 +04:00
|
|
|
// Backends
|
2015-08-30 20:13:01 +03:00
|
|
|
$authBackend = new \OCA\DAV\Connector\Sabre\Auth();
|
2015-08-07 18:36:14 +03:00
|
|
|
$requestUri = \OC::$server->getRequest()->getRequestUri();
|
2010-03-10 15:03:40 +03:00
|
|
|
|
2015-08-07 18:36:14 +03:00
|
|
|
$server = $serverFactory->createServer($baseuri, $requestUri, $authBackend, function() {
|
|
|
|
// use the view for the logged in user
|
|
|
|
return \OC\Files\Filesystem::getView();
|
|
|
|
});
|
2014-02-25 19:23:09 +04:00
|
|
|
|
2011-07-20 18:36:36 +04:00
|
|
|
// And off we go!
|
|
|
|
$server->exec();
|