|
@@ -64,6 +64,7 @@ use OCA\DAV\Connector\Sabre\TagsPlugin;
|
|
|
use OCA\DAV\DAV\CustomPropertiesBackend;
|
|
|
use OCA\DAV\DAV\PublicAuth;
|
|
|
use OCA\DAV\DAV\ViewOnlyPlugin;
|
|
|
+use OCA\DAV\Events\SabrePluginAddEvent;
|
|
|
use OCA\DAV\Events\SabrePluginAuthInitEvent;
|
|
|
use OCA\DAV\Files\BrowserErrorPagePlugin;
|
|
|
use OCA\DAV\Files\LazySearchBackend;
|
|
@@ -102,9 +103,8 @@ class Server {
|
|
|
$this->request = $request;
|
|
|
$this->baseUri = $baseUri;
|
|
|
$logger = \OC::$server->get(LoggerInterface::class);
|
|
|
- $dispatcher = \OC::$server->getEventDispatcher();
|
|
|
- /** @var IEventDispatcher $newDispatcher */
|
|
|
- $newDispatcher = \OC::$server->query(IEventDispatcher::class);
|
|
|
+ /** @var IEventDispatcher $dispatcher */
|
|
|
+ $dispatcher = \OC::$server->get(IEventDispatcher::class);
|
|
|
|
|
|
$root = new RootCollection();
|
|
|
$this->server = new \OCA\DAV\Connector\Sabre\Server(new CachingTree($root));
|
|
@@ -139,7 +139,7 @@ class Server {
|
|
|
$dispatcher->dispatch('OCA\DAV\Connector\Sabre::authInit', $event);
|
|
|
|
|
|
$newAuthEvent = new SabrePluginAuthInitEvent($this->server);
|
|
|
- $newDispatcher->dispatchTyped($newAuthEvent);
|
|
|
+ $dispatcher->dispatchTyped($newAuthEvent);
|
|
|
|
|
|
$bearerAuthBackend = new BearerAuth(
|
|
|
\OC::$server->getUserSession(),
|
|
@@ -223,6 +223,8 @@ class Server {
|
|
|
|
|
|
// allow setup of additional plugins
|
|
|
$dispatcher->dispatch('OCA\DAV\Connector\Sabre::addPlugin', $event);
|
|
|
+ $typedEvent = new SabrePluginAddEvent($this->server);
|
|
|
+ $dispatcher->dispatchTyped($typedEvent);
|
|
|
|
|
|
// Some WebDAV clients do require Class 2 WebDAV support (locking), since
|
|
|
// we do not provide locking we emulate it using a fake locking plugin.
|