diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-07-16 11:37:45 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-07-16 16:57:17 +0300 |
commit | 35e966c38d6c439e88c06496ee2af893dd665475 (patch) | |
tree | 69e0116f1d365c64091eee8b6c50a87e77c4f206 /apps/user_ldap | |
parent | 33aeef2d101029dd4538994d462a51062a5975d7 (diff) |
Migrate LDAP to the PSR container
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/lib/AppInfo/Application.php | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/apps/user_ldap/lib/AppInfo/Application.php b/apps/user_ldap/lib/AppInfo/Application.php index ddf40a13d35..a97b9c3fef9 100644 --- a/apps/user_ldap/lib/AppInfo/Application.php +++ b/apps/user_ldap/lib/AppInfo/Application.php @@ -41,8 +41,9 @@ use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; -use OCP\AppFramework\IAppContainer; use OCP\IL10N; +use OCP\IServerContainer; +use Psr\Container\ContainerInterface; class Application extends App implements IBootstrap { public function __construct() { @@ -52,17 +53,17 @@ class Application extends App implements IBootstrap { /** * Controller */ - $container->registerService('RenewPasswordController', function (IAppContainer $c) { - /** @var \OC\Server $server */ - $server = $c->query('ServerContainer'); + $container->registerService('RenewPasswordController', function (ContainerInterface $c) { + /** @var IServerContainer $server */ + $server = $c->get(IServerContainer::class); return new RenewPasswordController( - $c->getAppName(), + $c->get('AppName'), $server->getRequest(), - $c->query('UserManager'), + $c->get('UserManager'), $server->getConfig(), - $c->query(IL10N::class), - $c->query('Session'), + $c->get(IL10N::class), + $c->get('Session'), $server->getURLGenerator() ); }); @@ -114,13 +115,15 @@ class Application extends App implements IBootstrap { ); } - public function registerBackendDependents(IAppContainer $appContainer) { - $appContainer->getServer()->getEventDispatcher()->addListener( + public function registerBackendDependents(ContainerInterface $appContainer) { + /** @var IServerContainer $serverContainer */ + $serverContainer = $appContainer->get(IServerContainer::class); + $serverContainer->getEventDispatcher()->addListener( 'OCA\\Files_External::loadAdditionalBackends', function () use ($appContainer) { - $storagesBackendService = $appContainer->query(BackendService::class); + $storagesBackendService = $appContainer->get(BackendService::class); $storagesBackendService->registerConfigHandler('home', function () use ($appContainer) { - return $appContainer->query(ExtStorageConfigHandler::class); + return $appContainer->get(ExtStorageConfigHandler::class); }); } ); |