diff options
author | Joas Schilling <coding@schilljs.com> | 2023-07-11 11:50:07 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-07-17 16:06:15 +0200 |
commit | 72667a667db9eadc0c2b3d2b793192a8dce7983d (patch) | |
tree | f15a032155732b01e41e38bd6a3ffce87d095b37 /apps/dav/appinfo | |
parent | 99aefbd75a0fea6fb722290966452f3647aa5a63 (diff) | |
download | nextcloud-server-72667a667db9eadc0c2b3d2b793192a8dce7983d.tar.gz nextcloud-server-72667a667db9eadc0c2b3d2b793192a8dce7983d.zip |
feat(dav): Emit a typed event to deprecate OCA\DAV\Connector\Sabre::addPlugin
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/dav/appinfo')
-rw-r--r-- | apps/dav/appinfo/v1/publicwebdav.php | 7 | ||||
-rw-r--r-- | apps/dav/appinfo/v1/webdav.php | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/apps/dav/appinfo/v1/publicwebdav.php b/apps/dav/appinfo/v1/publicwebdav.php index 5530fc2cc7d..8ca9c6c577c 100644 --- a/apps/dav/appinfo/v1/publicwebdav.php +++ b/apps/dav/appinfo/v1/publicwebdav.php @@ -51,6 +51,9 @@ $authBackend = new OCA\DAV\Connector\PublicAuth( ); $authPlugin = new \Sabre\DAV\Auth\Plugin($authBackend); +/** @var IEventDispatcher $eventDispatcher */ +$eventDispatcher = \OC::$server->get(IEventDispatcher::class); + $serverFactory = new OCA\DAV\Connector\Sabre\ServerFactory( \OC::$server->getConfig(), \OC::$server->get(LoggerInterface::class), @@ -60,7 +63,7 @@ $serverFactory = new OCA\DAV\Connector\Sabre\ServerFactory( \OC::$server->getTagManager(), \OC::$server->getRequest(), \OC::$server->getPreviewManager(), - \OC::$server->getEventDispatcher(), + $eventDispatcher, \OC::$server->getL10N('dav') ); @@ -115,8 +118,6 @@ $server->addPlugin($linkCheckPlugin); $server->addPlugin($filesDropPlugin); // allow setup of additional plugins $event = new BeforeSabrePubliclyLoadedEvent($server); -/** @var IEventDispatcher $eventDispatcher */ -$eventDispatcher = \OC::$server->get(IEventDispatcher::class); $eventDispatcher->dispatchTyped($event); // And off we go! diff --git a/apps/dav/appinfo/v1/webdav.php b/apps/dav/appinfo/v1/webdav.php index 8dbe846f3ff..7c6a3fc77a6 100644 --- a/apps/dav/appinfo/v1/webdav.php +++ b/apps/dav/appinfo/v1/webdav.php @@ -39,6 +39,8 @@ ignore_user_abort(true); // Turn off output buffering to prevent memory problems \OC_Util::obEnd(); +$dispatcher = \OC::$server->get(\OCP\EventDispatcher\IEventDispatcher::class); + $serverFactory = new \OCA\DAV\Connector\Sabre\ServerFactory( \OC::$server->getConfig(), \OC::$server->get(LoggerInterface::class), @@ -48,7 +50,7 @@ $serverFactory = new \OCA\DAV\Connector\Sabre\ServerFactory( \OC::$server->getTagManager(), \OC::$server->getRequest(), \OC::$server->getPreviewManager(), - \OC::$server->getEventDispatcher(), + $dispatcher, \OC::$server->getL10N('dav') ); @@ -76,10 +78,11 @@ $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); +$event = new \OCA\DAV\Events\SabrePluginAddEvent($server); +$dispatcher->dispatchTyped($event); // And off we go! $server->exec(); |