diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-06-29 16:04:17 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-07-03 14:37:53 +0200 |
commit | 8150bcb60c8f4486d284ff1b37c543b50a6833ef (patch) | |
tree | b27efa3279a724fd24831e0d1bc136617272cb29 /apps/dav | |
parent | 4a3ea04baaa67f2cbf23c3d9f776373adad375a9 (diff) | |
download | nextcloud-server-8150bcb60c8f4486d284ff1b37c543b50a6833ef.tar.gz nextcloud-server-8150bcb60c8f4486d284ff1b37c543b50a6833ef.zip |
Use \OCP\IContainer::injectFn to boot the DAV app
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/lib/AppInfo/Application.php | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/apps/dav/lib/AppInfo/Application.php b/apps/dav/lib/AppInfo/Application.php index a0d75f5fe25..083bd8a474f 100644 --- a/apps/dav/lib/AppInfo/Application.php +++ b/apps/dav/lib/AppInfo/Application.php @@ -105,30 +105,14 @@ class Application extends App implements IBootstrap { // Load all dav apps \OC_App::loadApps(['dav']); - $this->registerHooks( - $context->getAppContainer()->query(HookManager::class), - $context->getServerContainer()->getEventDispatcher(), - $context->getAppContainer(), - $context->getServerContainer() - ); - $this->registerContactsManager( - $context->getAppContainer()->query(IContactsManager::class), - $context->getAppContainer() - ); - $this->registerCalendarManager( - $context->getAppContainer()->query(ICalendarManager::class), - $context->getAppContainer() - ); - $this->registerNotifier( - $context->getServerContainer()->getNotificationManager() - ); - $this->registerCalendarReminders( - $context->getAppContainer()->query(NotificationProviderManager::class), - $context->getAppContainer()->query(ILogger::class) - ); + $context->injectFn([$this, 'registerHooks']); + $context->injectFn([$this, 'registerContactsManager']); + $context->injectFn([$this, 'registerCalendarManager']); + $context->injectFn([$this, 'registerNotifier']); + $context->injectFn([$this, 'registerCalendarReminders']); } - private function registerHooks(HookManager $hm, + public function registerHooks(HookManager $hm, EventDispatcherInterface $dispatcher, IAppContainer $container, IServerContainer $serverContainer) { @@ -349,7 +333,7 @@ class Application extends App implements IBootstrap { $dispatcher->addListener('\OCP\Calendar\Room\ForceRefreshEvent', $eventHandler); } - private function registerContactsManager(IContactsManager $cm, IAppContainer $container): void { + public function registerContactsManager(IContactsManager $cm, IAppContainer $container): void { $cm->register(function () use ($container, $cm): void { $user = \OC::$server->getUserSession()->getUser(); if (!is_null($user)) { @@ -377,7 +361,7 @@ class Application extends App implements IBootstrap { $cm->setupSystemContactsProvider($contactsManager, $urlGenerator); } - private function registerCalendarManager(ICalendarManager $calendarManager, + public function registerCalendarManager(ICalendarManager $calendarManager, IAppContainer $container): void { $calendarManager->register(function () use ($container, $calendarManager) { $user = \OC::$server->getUserSession()->getUser(); @@ -394,11 +378,11 @@ class Application extends App implements IBootstrap { $cm->setupCalendarProvider($calendarManager, $userId); } - private function registerNotifier(INotificationManager $manager): void { + public function registerNotifier(INotificationManager $manager): void { $manager->registerNotifierService(Notifier::class); } - private function registerCalendarReminders(NotificationProviderManager $manager, + public function registerCalendarReminders(NotificationProviderManager $manager, ILogger $logger): void { try { $manager->registerProvider(AudioProvider::class); |