diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-11-11 22:04:12 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-11-20 23:13:22 +0100 |
commit | 5be18215fb52f2ee907c73d6f3ee1bad5222c86d (patch) | |
tree | 8aafe6d819e60632e9fc7be52928d3925a61eb40 /apps/encryption/lib | |
parent | c31e4266c71fa34707455fc41b728a50db2c606e (diff) | |
download | nextcloud-server-5be18215fb52f2ee907c73d6f3ee1bad5222c86d.tar.gz nextcloud-server-5be18215fb52f2ee907c73d6f3ee1bad5222c86d.zip |
Auto-wire as much as possible in the encryption app
Also cleans up only non-classname services in the server container
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/encryption/lib')
-rw-r--r-- | apps/encryption/lib/AppInfo/Application.php | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/apps/encryption/lib/AppInfo/Application.php b/apps/encryption/lib/AppInfo/Application.php index a5ba3a567f0..44a5a5af353 100644 --- a/apps/encryption/lib/AppInfo/Application.php +++ b/apps/encryption/lib/AppInfo/Application.php @@ -30,9 +30,6 @@ namespace OCA\Encryption\AppInfo; use OC\Files\View; -use OCA\Encryption\Controller\RecoveryController; -use OCA\Encryption\Controller\SettingsController; -use OCA\Encryption\Controller\StatusController; use OCA\Encryption\Crypto\Crypt; use OCA\Encryption\Crypto\DecryptAll; use OCA\Encryption\Crypto\EncryptAll; @@ -128,36 +125,6 @@ class Application extends \OCP\AppFramework\App { public function registerServices() { $container = $this->getContainer(); - $container->registerService(Crypt::class, function (ContainerInterface $c) { - /** @var IServerContainer $server */ - $server = $c->get(IServerContainer::class); - return new Crypt($server->getLogger(), - $server->getUserSession(), - $server->getConfig(), - $server->getL10N($c->get('AppName'))); - }); - - $container->registerService(Session::class, function (ContainerInterface $c) { - /** @var IServerContainer $server */ - $server = $c->get(IServerContainer::class); - return new Session($server->getSession()); - } - ); - - $container->registerService(KeyManager::class, function (ContainerInterface $c) { - /** @var IServerContainer $server */ - $server = $c->get(IServerContainer::class); - - return new KeyManager($server->getEncryptionKeyStorage(), - $c->get(Crypt::class), - $server->getConfig(), - $server->getUserSession(), - new Session($server->getSession()), - $server->getLogger(), - $c->get(Util::class), - $server->getLockingProvider() - ); - }); $container->registerService(Recovery::class, function (ContainerInterface $c) { /** @var IServerContainer $server */ @@ -172,55 +139,6 @@ class Application extends \OCP\AppFramework\App { new View()); }); - $container->registerService(RecoveryController::class, function (ContainerInterface $c) { - /** @var IServerContainer $server */ - $server = $c->get(IServerContainer::class); - return new RecoveryController( - $c->get('AppName'), - $server->getRequest(), - $server->getConfig(), - $server->getL10N($c->get('AppName')), - $c->get(Recovery::class)); - }); - - $container->registerService(StatusController::class, function (ContainerInterface $c) { - /** @var IServerContainer $server */ - $server = $c->get(IServerContainer::class); - return new StatusController( - $c->get('AppName'), - $server->getRequest(), - $server->getL10N($c->get('AppName')), - $c->get(Session::class), - $server->getEncryptionManager() - ); - }); - - $container->registerService(SettingsController::class, function (ContainerInterface $c) { - /** @var IServerContainer $server */ - $server = $c->get(IServerContainer::class); - return new SettingsController( - $c->get('AppName'), - $server->getRequest(), - $server->getL10N($c->get('AppName')), - $server->getUserManager(), - $server->getUserSession(), - $c->get(KeyManager::class), - $c->get(Crypt::class), - $c->get(Session::class), - $server->getSession(), - $c->get(Util::class) - ); - }); - - $container->registerService(Setup::class, function (ContainerInterface $c) { - /** @var IServerContainer $server */ - $server = $c->get(IServerContainer::class); - return new Setup($server->getLogger(), - $server->getUserSession(), - $c->get(Crypt::class), - $c->get(KeyManager::class)); - }); - $container->registerService(Util::class, function (ContainerInterface $c) { /** @var IServerContainer $server */ $server = $c->get(IServerContainer::class); @@ -251,16 +169,5 @@ class Application extends \OCP\AppFramework\App { ); } ); - - $container->registerService(DecryptAll::class,function (ContainerInterface $c) { - return new DecryptAll( - $c->get(Util::class), - $c->get(KeyManager::class), - $c->get(Crypt::class), - $c->get(Session::class), - new QuestionHelper() - ); - } - ); } } |