From fbd0d0bdcf0222ed92756a3b0a68f9899168bb5e Mon Sep 17 00:00:00 2001
From: Roeland Jago Douma <roeland@famdouma.nl>
Date: Thu, 1 Nov 2018 10:48:27 +0100
Subject: [PATCH] The Encryption manager belongs in Server.php

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
---
 lib/private/AppFramework/DependencyInjection/DIContainer.php | 4 ----
 lib/private/Server.php                                       | 3 ++-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index ee9234c1993..c0c2b246e29 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -148,10 +148,6 @@ class DIContainer extends SimpleContainer implements IAppContainer {
 			return $c->getServer()->getThemingDefaults();
 		});
 
-		$this->registerService(IManager::class, function ($c) {
-			return $this->getServer()->getEncryptionManager();
-		});
-
 		$this->registerService(IConfig::class, function ($c) {
 			return $c->query(OC\GlobalScale\Config::class);
 		});
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 1c8ad012ef5..c1f6261419d 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -217,7 +217,7 @@ class Server extends ServerContainer implements IServerContainer {
 			);
 		});
 
-		$this->registerService('EncryptionManager', function (Server $c) {
+		$this->registerService(\OCP\Encryption\IManager::class, function (Server $c) {
 			$view = new View();
 			$util = new Encryption\Util(
 				$view,
@@ -234,6 +234,7 @@ class Server extends ServerContainer implements IServerContainer {
 				new ArrayCache()
 			);
 		});
+		$this->registerAlias('EncryptionManager', \OCP\Encryption\IManager::class);
 
 		$this->registerService('EncryptionFileHelper', function (Server $c) {
 			$util = new Encryption\Util(
-- 
GitLab