]> source.dussan.org Git - nextcloud-server.git/commitdiff
simplify encryption manager fetching in DIContainer
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Fri, 12 Aug 2016 23:26:11 +0000 (01:26 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Tue, 16 Aug 2016 19:10:27 +0000 (21:10 +0200)
lib/private/AppFramework/DependencyInjection/DIContainer.php

index 56e21f0de52ece18d212dfcda8db8a9f2680defe..a1aadf78f24638f34bf5440294f31d5d74eb8ed8 100644 (file)
@@ -310,22 +310,8 @@ class DIContainer extends SimpleContainer implements IAppContainer {
                        return $c->query('ServerContainer')->getWebRoot();
                });
 
-               $this->registerService('\OCP\Encryption\IManager', function ($c) {
-                       $view = new \OC\Files\View();
-                       $util = new \OC\Encryption\Util(
-                               $view,
-                               $c->query('\OCP\IUserManager'),
-                               $c->query('\OCP\IGroupManager'),
-                               $c->query('\OCP\IConfig')
-                       );
-                       return new \OC\Encryption\Manager(
-                               $c->query('\OCP\IConfig'),
-                               $c->query('\OCP\ILogger'),
-                               $c->query('ServerContainer')->getL10N('core'),
-                               new \OC\Files\View(),
-                               $util,
-                               new \OC\Memcache\ArrayCache()
-                       );
+               $this->registerService('OCP\Encryption\IManager', function ($c) {
+                       return $this->getServer()->getEncryptionManager();
                });