Merge pull request #6309 from nextcloud/new-dav-event

add a new dav event to allow apps to register their own sabredav plugins
This commit is contained in:
Roeland Jago Douma 2017-09-04 12:12:46 +02:00 committed by GitHub
commit f0158e42e9
2 changed files with 8 additions and 0 deletions

View File

@ -67,5 +67,10 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, funct
return \OC\Files\Filesystem::getView();
});
$dispatcher = \OC::$server->getEventDispatcher();
// allow setup of additional plugins
$event = new \OCP\SabrePluginEvent($server);
$dispatcher->dispatch('OCA\DAV\Connector\Sabre::addPlugin', $event);
// And off we go!
$server->exec();

View File

@ -163,6 +163,9 @@ class Server {
$this->server->addPlugin(new CopyEtagHeaderPlugin());
// allow setup of additional plugins
$dispatcher->dispatch('OCA\DAV\Connector\Sabre::addPlugin', $event);
// Some WebDAV clients do require Class 2 WebDAV support (locking), since
// we do not provide locking we emulate it using a fake locking plugin.
if($request->isUserAgent([