diff options
Diffstat (limited to 'apps/dav/lib/Direct/ServerFactory.php')
-rw-r--r-- | apps/dav/lib/Direct/ServerFactory.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/dav/lib/Direct/ServerFactory.php b/apps/dav/lib/Direct/ServerFactory.php index 74496b8cc56..d84bb208d3f 100644 --- a/apps/dav/lib/Direct/ServerFactory.php +++ b/apps/dav/lib/Direct/ServerFactory.php @@ -28,22 +28,27 @@ declare(strict_types=1); namespace OCA\DAV\Direct; use OC\Security\Bruteforce\Throttler; +use OCA\DAV\Connector\Sabre\MaintenancePlugin; use OCA\DAV\Db\DirectMapper; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\IRootFolder; use OCP\IConfig; use OCP\IL10N; use OCP\IRequest; +use OCP\L10N\IFactory; class ServerFactory { /** @var IConfig */ private $config; /** @var IL10N */ private $l10n; + private $eventDispatcher; - public function __construct(IConfig $config, IL10N $l10n) { + public function __construct(IConfig $config, IFactory $l10nFactory, IEventDispatcher $eventDispatcher) { $this->config = $config; - $this->l10n = $l10n; + $this->l10n = $l10nFactory->get('dav'); + $this->eventDispatcher = $eventDispatcher; } public function createServer(string $baseURI, @@ -53,13 +58,13 @@ class ServerFactory { ITimeFactory $timeFactory, Throttler $throttler, IRequest $request): Server { - $home = new DirectHome($rootFolder, $mapper, $timeFactory, $throttler, $request); + $home = new DirectHome($rootFolder, $mapper, $timeFactory, $throttler, $request, $this->eventDispatcher); $server = new Server($home); $server->httpRequest->setUrl($requestURI); $server->setBaseUri($baseURI); - $server->addPlugin(new \OCA\DAV\Connector\Sabre\MaintenancePlugin($this->config, $this->l10n)); + $server->addPlugin(new MaintenancePlugin($this->config, $this->l10n)); return $server; } |