diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-07-20 16:28:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-20 16:28:54 +0200 |
commit | f88a4b56041784b7b79ff4b23c515e9d9c73cb76 (patch) | |
tree | b05adf341bdfd3abc8921dfc27a48e9f4850e13a /apps | |
parent | 5563a952ce203cbee7b900fef732028651301fa7 (diff) | |
parent | 35e966c38d6c439e88c06496ee2af893dd665475 (diff) | |
download | nextcloud-server-f88a4b56041784b7b79ff4b23c515e9d9c73cb76.tar.gz nextcloud-server-f88a4b56041784b7b79ff4b23c515e9d9c73cb76.zip |
Merge pull request #21866 from nextcloud/techdebt/ldap-psr-container
Migrate LDAP to the PSR container
Diffstat (limited to 'apps')
-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); }); } ); |