Passed
Push — master ( 8e529d...671d27 )
by Julius
18:04 queued 16s
created
apps/theming/composer/composer/autoload_psr4.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'OCA\\Theming\\' => array($baseDir . '/../lib'),
9
+    'OCA\\Theming\\' => array($baseDir.'/../lib'),
10 10
 );
Please login to merge, or discard this patch.
lib/private/Server.php 2 patches
Indentation   +2092 added lines, -2092 removed lines patch added patch discarded remove patch
@@ -281,2096 +281,2096 @@
 block discarded – undo
281 281
  * TODO: hookup all manager classes
282 282
  */
283 283
 class Server extends ServerContainer implements IServerContainer {
284
-	/** @var string */
285
-	private $webRoot;
286
-
287
-	/**
288
-	 * @param string $webRoot
289
-	 * @param \OC\Config $config
290
-	 */
291
-	public function __construct($webRoot, \OC\Config $config) {
292
-		parent::__construct();
293
-		$this->webRoot = $webRoot;
294
-
295
-		// To find out if we are running from CLI or not
296
-		$this->registerParameter('isCLI', \OC::$CLI);
297
-		$this->registerParameter('serverRoot', \OC::$SERVERROOT);
298
-
299
-		$this->registerService(ContainerInterface::class, function (ContainerInterface $c) {
300
-			return $c;
301
-		});
302
-		$this->registerService(\OCP\IServerContainer::class, function (ContainerInterface $c) {
303
-			return $c;
304
-		});
305
-
306
-		$this->registerAlias(\OCP\Calendar\IManager::class, \OC\Calendar\Manager::class);
307
-		/** @deprecated 19.0.0 */
308
-		$this->registerDeprecatedAlias('CalendarManager', \OC\Calendar\Manager::class);
309
-
310
-		$this->registerAlias(\OCP\Calendar\Resource\IManager::class, \OC\Calendar\Resource\Manager::class);
311
-		/** @deprecated 19.0.0 */
312
-		$this->registerDeprecatedAlias('CalendarResourceBackendManager', \OC\Calendar\Resource\Manager::class);
313
-
314
-		$this->registerAlias(\OCP\Calendar\Room\IManager::class, \OC\Calendar\Room\Manager::class);
315
-		/** @deprecated 19.0.0 */
316
-		$this->registerDeprecatedAlias('CalendarRoomBackendManager', \OC\Calendar\Room\Manager::class);
317
-
318
-		$this->registerAlias(\OCP\Contacts\IManager::class, \OC\ContactsManager::class);
319
-		/** @deprecated 19.0.0 */
320
-		$this->registerDeprecatedAlias('ContactsManager', \OCP\Contacts\IManager::class);
321
-
322
-		$this->registerAlias(\OCP\DirectEditing\IManager::class, \OC\DirectEditing\Manager::class);
323
-		$this->registerAlias(ITemplateManager::class, TemplateManager::class);
324
-
325
-		$this->registerAlias(IActionFactory::class, ActionFactory::class);
326
-
327
-		$this->registerService(View::class, function (Server $c) {
328
-			return new View();
329
-		}, false);
330
-
331
-		$this->registerService(IPreview::class, function (ContainerInterface $c) {
332
-			return new PreviewManager(
333
-				$c->get(\OCP\IConfig::class),
334
-				$c->get(IRootFolder::class),
335
-				new \OC\Preview\Storage\Root(
336
-					$c->get(IRootFolder::class),
337
-					$c->get(SystemConfig::class)
338
-				),
339
-				$c->get(IEventDispatcher::class),
340
-				$c->get(SymfonyAdapter::class),
341
-				$c->get(GeneratorHelper::class),
342
-				$c->get(ISession::class)->get('user_id'),
343
-				$c->get(Coordinator::class),
344
-				$c->get(IServerContainer::class),
345
-				$c->get(IBinaryFinder::class),
346
-				$c->get(IMagickSupport::class)
347
-			);
348
-		});
349
-		/** @deprecated 19.0.0 */
350
-		$this->registerDeprecatedAlias('PreviewManager', IPreview::class);
351
-
352
-		$this->registerService(\OC\Preview\Watcher::class, function (ContainerInterface $c) {
353
-			return new \OC\Preview\Watcher(
354
-				new \OC\Preview\Storage\Root(
355
-					$c->get(IRootFolder::class),
356
-					$c->get(SystemConfig::class)
357
-				)
358
-			);
359
-		});
360
-
361
-		$this->registerService(IProfiler::class, function (Server $c) {
362
-			return new Profiler($c->get(SystemConfig::class));
363
-		});
364
-
365
-		$this->registerService(\OCP\Encryption\IManager::class, function (Server $c): Encryption\Manager {
366
-			$view = new View();
367
-			$util = new Encryption\Util(
368
-				$view,
369
-				$c->get(IUserManager::class),
370
-				$c->get(IGroupManager::class),
371
-				$c->get(\OCP\IConfig::class)
372
-			);
373
-			return new Encryption\Manager(
374
-				$c->get(\OCP\IConfig::class),
375
-				$c->get(LoggerInterface::class),
376
-				$c->getL10N('core'),
377
-				new View(),
378
-				$util,
379
-				new ArrayCache()
380
-			);
381
-		});
382
-		/** @deprecated 19.0.0 */
383
-		$this->registerDeprecatedAlias('EncryptionManager', \OCP\Encryption\IManager::class);
384
-
385
-		/** @deprecated 21.0.0 */
386
-		$this->registerDeprecatedAlias('EncryptionFileHelper', IFile::class);
387
-		$this->registerService(IFile::class, function (ContainerInterface $c) {
388
-			$util = new Encryption\Util(
389
-				new View(),
390
-				$c->get(IUserManager::class),
391
-				$c->get(IGroupManager::class),
392
-				$c->get(\OCP\IConfig::class)
393
-			);
394
-			return new Encryption\File(
395
-				$util,
396
-				$c->get(IRootFolder::class),
397
-				$c->get(\OCP\Share\IManager::class)
398
-			);
399
-		});
400
-
401
-		/** @deprecated 21.0.0 */
402
-		$this->registerDeprecatedAlias('EncryptionKeyStorage', IStorage::class);
403
-		$this->registerService(IStorage::class, function (ContainerInterface $c) {
404
-			$view = new View();
405
-			$util = new Encryption\Util(
406
-				$view,
407
-				$c->get(IUserManager::class),
408
-				$c->get(IGroupManager::class),
409
-				$c->get(\OCP\IConfig::class)
410
-			);
411
-
412
-			return new Encryption\Keys\Storage(
413
-				$view,
414
-				$util,
415
-				$c->get(ICrypto::class),
416
-				$c->get(\OCP\IConfig::class)
417
-			);
418
-		});
419
-		/** @deprecated 20.0.0 */
420
-		$this->registerDeprecatedAlias('TagMapper', TagMapper::class);
421
-
422
-		$this->registerAlias(\OCP\ITagManager::class, TagManager::class);
423
-		/** @deprecated 19.0.0 */
424
-		$this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class);
425
-
426
-		$this->registerService('SystemTagManagerFactory', function (ContainerInterface $c) {
427
-			/** @var \OCP\IConfig $config */
428
-			$config = $c->get(\OCP\IConfig::class);
429
-			$factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class);
430
-			return new $factoryClass($this);
431
-		});
432
-		$this->registerService(ISystemTagManager::class, function (ContainerInterface $c) {
433
-			return $c->get('SystemTagManagerFactory')->getManager();
434
-		});
435
-		/** @deprecated 19.0.0 */
436
-		$this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class);
437
-
438
-		$this->registerService(ISystemTagObjectMapper::class, function (ContainerInterface $c) {
439
-			return $c->get('SystemTagManagerFactory')->getObjectMapper();
440
-		});
441
-		$this->registerService('RootFolder', function (ContainerInterface $c) {
442
-			$manager = \OC\Files\Filesystem::getMountManager(null);
443
-			$view = new View();
444
-			$root = new Root(
445
-				$manager,
446
-				$view,
447
-				null,
448
-				$c->get(IUserMountCache::class),
449
-				$this->get(LoggerInterface::class),
450
-				$this->get(IUserManager::class),
451
-				$this->get(IEventDispatcher::class),
452
-			);
453
-
454
-			$previewConnector = new \OC\Preview\WatcherConnector(
455
-				$root,
456
-				$c->get(SystemConfig::class)
457
-			);
458
-			$previewConnector->connectWatcher();
459
-
460
-			return $root;
461
-		});
462
-		$this->registerService(HookConnector::class, function (ContainerInterface $c) {
463
-			return new HookConnector(
464
-				$c->get(IRootFolder::class),
465
-				new View(),
466
-				$c->get(\OC\EventDispatcher\SymfonyAdapter::class),
467
-				$c->get(IEventDispatcher::class)
468
-			);
469
-		});
470
-
471
-		/** @deprecated 19.0.0 */
472
-		$this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class);
473
-
474
-		$this->registerService(IRootFolder::class, function (ContainerInterface $c) {
475
-			return new LazyRoot(function () use ($c) {
476
-				return $c->get('RootFolder');
477
-			});
478
-		});
479
-		/** @deprecated 19.0.0 */
480
-		$this->registerDeprecatedAlias('LazyRootFolder', IRootFolder::class);
481
-
482
-		/** @deprecated 19.0.0 */
483
-		$this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class);
484
-		$this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class);
485
-
486
-		$this->registerService(DisplayNameCache::class, function (ContainerInterface $c) {
487
-			return $c->get(\OC\User\Manager::class)->getDisplayNameCache();
488
-		});
489
-
490
-		$this->registerService(\OCP\IGroupManager::class, function (ContainerInterface $c) {
491
-			$groupManager = new \OC\Group\Manager(
492
-				$this->get(IUserManager::class),
493
-				$c->get(SymfonyAdapter::class),
494
-				$this->get(LoggerInterface::class),
495
-				$this->get(ICacheFactory::class)
496
-			);
497
-			$groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
498
-				/** @var IEventDispatcher $dispatcher */
499
-				$dispatcher = $this->get(IEventDispatcher::class);
500
-				$dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid));
501
-			});
502
-			$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) {
503
-				/** @var IEventDispatcher $dispatcher */
504
-				$dispatcher = $this->get(IEventDispatcher::class);
505
-				$dispatcher->dispatchTyped(new GroupCreatedEvent($group));
506
-			});
507
-			$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
508
-				/** @var IEventDispatcher $dispatcher */
509
-				$dispatcher = $this->get(IEventDispatcher::class);
510
-				$dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group));
511
-			});
512
-			$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
513
-				/** @var IEventDispatcher $dispatcher */
514
-				$dispatcher = $this->get(IEventDispatcher::class);
515
-				$dispatcher->dispatchTyped(new GroupDeletedEvent($group));
516
-			});
517
-			$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
518
-				/** @var IEventDispatcher $dispatcher */
519
-				$dispatcher = $this->get(IEventDispatcher::class);
520
-				$dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user));
521
-			});
522
-			$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
523
-				/** @var IEventDispatcher $dispatcher */
524
-				$dispatcher = $this->get(IEventDispatcher::class);
525
-				$dispatcher->dispatchTyped(new UserAddedEvent($group, $user));
526
-			});
527
-			$groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
528
-				/** @var IEventDispatcher $dispatcher */
529
-				$dispatcher = $this->get(IEventDispatcher::class);
530
-				$dispatcher->dispatchTyped(new BeforeUserRemovedEvent($group, $user));
531
-			});
532
-			$groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
533
-				/** @var IEventDispatcher $dispatcher */
534
-				$dispatcher = $this->get(IEventDispatcher::class);
535
-				$dispatcher->dispatchTyped(new UserRemovedEvent($group, $user));
536
-			});
537
-			return $groupManager;
538
-		});
539
-		/** @deprecated 19.0.0 */
540
-		$this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class);
541
-
542
-		$this->registerService(Store::class, function (ContainerInterface $c) {
543
-			$session = $c->get(ISession::class);
544
-			if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) {
545
-				$tokenProvider = $c->get(IProvider::class);
546
-			} else {
547
-				$tokenProvider = null;
548
-			}
549
-			$logger = $c->get(LoggerInterface::class);
550
-			return new Store($session, $logger, $tokenProvider);
551
-		});
552
-		$this->registerAlias(IStore::class, Store::class);
553
-		$this->registerAlias(IProvider::class, Authentication\Token\Manager::class);
554
-		$this->registerAlias(OCPIProvider::class, Authentication\Token\Manager::class);
555
-
556
-		$this->registerService(\OC\User\Session::class, function (Server $c) {
557
-			$manager = $c->get(IUserManager::class);
558
-			$session = new \OC\Session\Memory('');
559
-			$timeFactory = new TimeFactory();
560
-			// Token providers might require a working database. This code
561
-			// might however be called when Nextcloud is not yet setup.
562
-			if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) {
563
-				$provider = $c->get(IProvider::class);
564
-			} else {
565
-				$provider = null;
566
-			}
567
-
568
-			$legacyDispatcher = $c->get(SymfonyAdapter::class);
569
-
570
-			$userSession = new \OC\User\Session(
571
-				$manager,
572
-				$session,
573
-				$timeFactory,
574
-				$provider,
575
-				$c->get(\OCP\IConfig::class),
576
-				$c->get(ISecureRandom::class),
577
-				$c->getLockdownManager(),
578
-				$c->get(LoggerInterface::class),
579
-				$c->get(IEventDispatcher::class)
580
-			);
581
-			/** @deprecated 21.0.0 use BeforeUserCreatedEvent event with the IEventDispatcher instead */
582
-			$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
583
-				\OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]);
584
-			});
585
-			/** @deprecated 21.0.0 use UserCreatedEvent event with the IEventDispatcher instead */
586
-			$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
587
-				/** @var \OC\User\User $user */
588
-				\OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]);
589
-			});
590
-			/** @deprecated 21.0.0 use BeforeUserDeletedEvent event with the IEventDispatcher instead */
591
-			$userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) {
592
-				/** @var \OC\User\User $user */
593
-				\OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]);
594
-				$legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user));
595
-			});
596
-			/** @deprecated 21.0.0 use UserDeletedEvent event with the IEventDispatcher instead */
597
-			$userSession->listen('\OC\User', 'postDelete', function ($user) {
598
-				/** @var \OC\User\User $user */
599
-				\OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]);
600
-			});
601
-			$userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
602
-				/** @var \OC\User\User $user */
603
-				\OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
604
-
605
-				/** @var IEventDispatcher $dispatcher */
606
-				$dispatcher = $this->get(IEventDispatcher::class);
607
-				$dispatcher->dispatchTyped(new BeforePasswordUpdatedEvent($user, $password, $recoveryPassword));
608
-			});
609
-			$userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
610
-				/** @var \OC\User\User $user */
611
-				\OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
612
-
613
-				/** @var IEventDispatcher $dispatcher */
614
-				$dispatcher = $this->get(IEventDispatcher::class);
615
-				$dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword));
616
-			});
617
-			$userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
618
-				\OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]);
619
-
620
-				/** @var IEventDispatcher $dispatcher */
621
-				$dispatcher = $this->get(IEventDispatcher::class);
622
-				$dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password));
623
-			});
624
-			$userSession->listen('\OC\User', 'postLogin', function ($user, $loginName, $password, $isTokenLogin) {
625
-				/** @var \OC\User\User $user */
626
-				\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'loginName' => $loginName, 'password' => $password, 'isTokenLogin' => $isTokenLogin]);
627
-
628
-				/** @var IEventDispatcher $dispatcher */
629
-				$dispatcher = $this->get(IEventDispatcher::class);
630
-				$dispatcher->dispatchTyped(new UserLoggedInEvent($user, $loginName, $password, $isTokenLogin));
631
-			});
632
-			$userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) {
633
-				/** @var IEventDispatcher $dispatcher */
634
-				$dispatcher = $this->get(IEventDispatcher::class);
635
-				$dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid));
636
-			});
637
-			$userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
638
-				/** @var \OC\User\User $user */
639
-				\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]);
640
-
641
-				/** @var IEventDispatcher $dispatcher */
642
-				$dispatcher = $this->get(IEventDispatcher::class);
643
-				$dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password));
644
-			});
645
-			$userSession->listen('\OC\User', 'logout', function ($user) {
646
-				\OC_Hook::emit('OC_User', 'logout', []);
647
-
648
-				/** @var IEventDispatcher $dispatcher */
649
-				$dispatcher = $this->get(IEventDispatcher::class);
650
-				$dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user));
651
-			});
652
-			$userSession->listen('\OC\User', 'postLogout', function ($user) {
653
-				/** @var IEventDispatcher $dispatcher */
654
-				$dispatcher = $this->get(IEventDispatcher::class);
655
-				$dispatcher->dispatchTyped(new UserLoggedOutEvent($user));
656
-			});
657
-			$userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) {
658
-				/** @var \OC\User\User $user */
659
-				\OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]);
660
-
661
-				/** @var IEventDispatcher $dispatcher */
662
-				$dispatcher = $this->get(IEventDispatcher::class);
663
-				$dispatcher->dispatchTyped(new UserChangedEvent($user, $feature, $value, $oldValue));
664
-			});
665
-			return $userSession;
666
-		});
667
-		$this->registerAlias(\OCP\IUserSession::class, \OC\User\Session::class);
668
-		/** @deprecated 19.0.0 */
669
-		$this->registerDeprecatedAlias('UserSession', \OC\User\Session::class);
670
-
671
-		$this->registerAlias(\OCP\Authentication\TwoFactorAuth\IRegistry::class, \OC\Authentication\TwoFactorAuth\Registry::class);
672
-
673
-		$this->registerAlias(INavigationManager::class, \OC\NavigationManager::class);
674
-		/** @deprecated 19.0.0 */
675
-		$this->registerDeprecatedAlias('NavigationManager', INavigationManager::class);
676
-
677
-		/** @deprecated 19.0.0 */
678
-		$this->registerDeprecatedAlias('AllConfig', \OC\AllConfig::class);
679
-		$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class);
680
-
681
-		$this->registerService(\OC\SystemConfig::class, function ($c) use ($config) {
682
-			return new \OC\SystemConfig($config);
683
-		});
684
-		/** @deprecated 19.0.0 */
685
-		$this->registerDeprecatedAlias('SystemConfig', \OC\SystemConfig::class);
686
-
687
-		/** @deprecated 19.0.0 */
688
-		$this->registerDeprecatedAlias('AppConfig', \OC\AppConfig::class);
689
-		$this->registerAlias(IAppConfig::class, \OC\AppConfig::class);
690
-
691
-		$this->registerService(IFactory::class, function (Server $c) {
692
-			return new \OC\L10N\Factory(
693
-				$c->get(\OCP\IConfig::class),
694
-				$c->getRequest(),
695
-				$c->get(IUserSession::class),
696
-				$c->get(ICacheFactory::class),
697
-				\OC::$SERVERROOT
698
-			);
699
-		});
700
-		/** @deprecated 19.0.0 */
701
-		$this->registerDeprecatedAlias('L10NFactory', IFactory::class);
702
-
703
-		$this->registerAlias(IURLGenerator::class, URLGenerator::class);
704
-		/** @deprecated 19.0.0 */
705
-		$this->registerDeprecatedAlias('URLGenerator', IURLGenerator::class);
706
-
707
-		/** @deprecated 19.0.0 */
708
-		$this->registerDeprecatedAlias('AppFetcher', AppFetcher::class);
709
-		/** @deprecated 19.0.0 */
710
-		$this->registerDeprecatedAlias('CategoryFetcher', CategoryFetcher::class);
711
-
712
-		$this->registerService(ICache::class, function ($c) {
713
-			return new Cache\File();
714
-		});
715
-		/** @deprecated 19.0.0 */
716
-		$this->registerDeprecatedAlias('UserCache', ICache::class);
717
-
718
-		$this->registerService(Factory::class, function (Server $c) {
719
-			$profiler = $c->get(IProfiler::class);
720
-			$arrayCacheFactory = new \OC\Memcache\Factory('', $c->get(LoggerInterface::class),
721
-				$profiler,
722
-				ArrayCache::class,
723
-				ArrayCache::class,
724
-				ArrayCache::class
725
-			);
726
-			/** @var \OCP\IConfig $config */
727
-			$config = $c->get(\OCP\IConfig::class);
728
-
729
-			if ($config->getSystemValue('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
730
-				if (!$config->getSystemValueBool('log_query')) {
731
-					$v = \OC_App::getAppVersions();
732
-				} else {
733
-					// If the log_query is enabled, we can not get the app versions
734
-					// as that does a query, which will be logged and the logging
735
-					// depends on redis and here we are back again in the same function.
736
-					$v = [
737
-						'log_query' => 'enabled',
738
-					];
739
-				}
740
-				$v['core'] = implode(',', \OC_Util::getVersion());
741
-				$version = implode(',', $v);
742
-				$instanceId = \OC_Util::getInstanceId();
743
-				$path = \OC::$SERVERROOT;
744
-				$prefix = md5($instanceId . '-' . $version . '-' . $path);
745
-				return new \OC\Memcache\Factory($prefix,
746
-					$c->get(LoggerInterface::class),
747
-					$profiler,
748
-					$config->getSystemValue('memcache.local', null),
749
-					$config->getSystemValue('memcache.distributed', null),
750
-					$config->getSystemValue('memcache.locking', null),
751
-					$config->getSystemValueString('redis_log_file')
752
-				);
753
-			}
754
-			return $arrayCacheFactory;
755
-		});
756
-		/** @deprecated 19.0.0 */
757
-		$this->registerDeprecatedAlias('MemCacheFactory', Factory::class);
758
-		$this->registerAlias(ICacheFactory::class, Factory::class);
759
-
760
-		$this->registerService('RedisFactory', function (Server $c) {
761
-			$systemConfig = $c->get(SystemConfig::class);
762
-			return new RedisFactory($systemConfig, $c->getEventLogger());
763
-		});
764
-
765
-		$this->registerService(\OCP\Activity\IManager::class, function (Server $c) {
766
-			$l10n = $this->get(IFactory::class)->get('lib');
767
-			return new \OC\Activity\Manager(
768
-				$c->getRequest(),
769
-				$c->get(IUserSession::class),
770
-				$c->get(\OCP\IConfig::class),
771
-				$c->get(IValidator::class),
772
-				$l10n
773
-			);
774
-		});
775
-		/** @deprecated 19.0.0 */
776
-		$this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class);
777
-
778
-		$this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
779
-			return new \OC\Activity\EventMerger(
780
-				$c->getL10N('lib')
781
-			);
782
-		});
783
-		$this->registerAlias(IValidator::class, Validator::class);
784
-
785
-		$this->registerService(AvatarManager::class, function (Server $c) {
786
-			return new AvatarManager(
787
-				$c->get(IUserSession::class),
788
-				$c->get(\OC\User\Manager::class),
789
-				$c->getAppDataDir('avatar'),
790
-				$c->getL10N('lib'),
791
-				$c->get(LoggerInterface::class),
792
-				$c->get(\OCP\IConfig::class),
793
-				$c->get(IAccountManager::class),
794
-				$c->get(KnownUserService::class)
795
-			);
796
-		});
797
-
798
-		$this->registerAlias(IAvatarManager::class, AvatarManager::class);
799
-		/** @deprecated 19.0.0 */
800
-		$this->registerDeprecatedAlias('AvatarManager', AvatarManager::class);
801
-
802
-		$this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class);
803
-		$this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class);
804
-		$this->registerAlias(\OCP\Support\Subscription\IAssertion::class, \OC\Support\Subscription\Assertion::class);
805
-
806
-		$this->registerService(\OC\Log::class, function (Server $c) {
807
-			$logType = $c->get(AllConfig::class)->getSystemValue('log_type', 'file');
808
-			$factory = new LogFactory($c, $this->get(SystemConfig::class));
809
-			$logger = $factory->get($logType);
810
-			$registry = $c->get(\OCP\Support\CrashReport\IRegistry::class);
811
-
812
-			return new Log($logger, $this->get(SystemConfig::class), null, $registry);
813
-		});
814
-		$this->registerAlias(ILogger::class, \OC\Log::class);
815
-		/** @deprecated 19.0.0 */
816
-		$this->registerDeprecatedAlias('Logger', \OC\Log::class);
817
-		// PSR-3 logger
818
-		$this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class);
819
-
820
-		$this->registerService(ILogFactory::class, function (Server $c) {
821
-			return new LogFactory($c, $this->get(SystemConfig::class));
822
-		});
823
-
824
-		$this->registerAlias(IJobList::class, \OC\BackgroundJob\JobList::class);
825
-		/** @deprecated 19.0.0 */
826
-		$this->registerDeprecatedAlias('JobList', IJobList::class);
827
-
828
-		$this->registerService(Router::class, function (Server $c) {
829
-			$cacheFactory = $c->get(ICacheFactory::class);
830
-			if ($cacheFactory->isLocalCacheAvailable()) {
831
-				$router = $c->resolve(CachingRouter::class);
832
-			} else {
833
-				$router = $c->resolve(Router::class);
834
-			}
835
-			return $router;
836
-		});
837
-		$this->registerAlias(IRouter::class, Router::class);
838
-		/** @deprecated 19.0.0 */
839
-		$this->registerDeprecatedAlias('Router', IRouter::class);
840
-
841
-		$this->registerAlias(ISearch::class, Search::class);
842
-		/** @deprecated 19.0.0 */
843
-		$this->registerDeprecatedAlias('Search', ISearch::class);
844
-
845
-		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) {
846
-			$cacheFactory = $c->get(ICacheFactory::class);
847
-			if ($cacheFactory->isAvailable()) {
848
-				$backend = new \OC\Security\RateLimiting\Backend\MemoryCacheBackend(
849
-					$this->get(ICacheFactory::class),
850
-					new \OC\AppFramework\Utility\TimeFactory()
851
-				);
852
-			} else {
853
-				$backend = new \OC\Security\RateLimiting\Backend\DatabaseBackend(
854
-					$c->get(IDBConnection::class),
855
-					new \OC\AppFramework\Utility\TimeFactory()
856
-				);
857
-			}
858
-
859
-			return $backend;
860
-		});
861
-
862
-		$this->registerAlias(\OCP\Security\ISecureRandom::class, SecureRandom::class);
863
-		/** @deprecated 19.0.0 */
864
-		$this->registerDeprecatedAlias('SecureRandom', \OCP\Security\ISecureRandom::class);
865
-		$this->registerAlias(\OCP\Security\IRemoteHostValidator::class, \OC\Security\RemoteHostValidator::class);
866
-		$this->registerAlias(IVerificationToken::class, VerificationToken::class);
867
-
868
-		$this->registerAlias(ICrypto::class, Crypto::class);
869
-		/** @deprecated 19.0.0 */
870
-		$this->registerDeprecatedAlias('Crypto', ICrypto::class);
871
-
872
-		$this->registerAlias(IHasher::class, Hasher::class);
873
-		/** @deprecated 19.0.0 */
874
-		$this->registerDeprecatedAlias('Hasher', IHasher::class);
875
-
876
-		$this->registerAlias(ICredentialsManager::class, CredentialsManager::class);
877
-		/** @deprecated 19.0.0 */
878
-		$this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class);
879
-
880
-		$this->registerAlias(IDBConnection::class, ConnectionAdapter::class);
881
-		$this->registerService(Connection::class, function (Server $c) {
882
-			$systemConfig = $c->get(SystemConfig::class);
883
-			$factory = new \OC\DB\ConnectionFactory($systemConfig);
884
-			$type = $systemConfig->getValue('dbtype', 'sqlite');
885
-			if (!$factory->isValidType($type)) {
886
-				throw new \OC\DatabaseException('Invalid database type');
887
-			}
888
-			$connectionParams = $factory->createConnectionParams();
889
-			$connection = $factory->getConnection($type, $connectionParams);
890
-			return $connection;
891
-		});
892
-		/** @deprecated 19.0.0 */
893
-		$this->registerDeprecatedAlias('DatabaseConnection', IDBConnection::class);
894
-
895
-		$this->registerAlias(ICertificateManager::class, CertificateManager::class);
896
-		$this->registerAlias(IClientService::class, ClientService::class);
897
-		$this->registerService(NegativeDnsCache::class, function (ContainerInterface $c) {
898
-			return new NegativeDnsCache(
899
-				$c->get(ICacheFactory::class),
900
-			);
901
-		});
902
-		$this->registerDeprecatedAlias('HttpClientService', IClientService::class);
903
-		$this->registerService(IEventLogger::class, function (ContainerInterface $c) {
904
-			return new EventLogger($c->get(SystemConfig::class), $c->get(LoggerInterface::class), $c->get(Log::class));
905
-		});
906
-		/** @deprecated 19.0.0 */
907
-		$this->registerDeprecatedAlias('EventLogger', IEventLogger::class);
908
-
909
-		$this->registerService(IQueryLogger::class, function (ContainerInterface $c) {
910
-			$queryLogger = new QueryLogger();
911
-			if ($c->get(SystemConfig::class)->getValue('debug', false)) {
912
-				// In debug mode, module is being activated by default
913
-				$queryLogger->activate();
914
-			}
915
-			return $queryLogger;
916
-		});
917
-		/** @deprecated 19.0.0 */
918
-		$this->registerDeprecatedAlias('QueryLogger', IQueryLogger::class);
919
-
920
-		/** @deprecated 19.0.0 */
921
-		$this->registerDeprecatedAlias('TempManager', TempManager::class);
922
-		$this->registerAlias(ITempManager::class, TempManager::class);
923
-
924
-		$this->registerService(AppManager::class, function (ContainerInterface $c) {
925
-			// TODO: use auto-wiring
926
-			return new \OC\App\AppManager(
927
-				$c->get(IUserSession::class),
928
-				$c->get(\OCP\IConfig::class),
929
-				$c->get(\OC\AppConfig::class),
930
-				$c->get(IGroupManager::class),
931
-				$c->get(ICacheFactory::class),
932
-				$c->get(SymfonyAdapter::class),
933
-				$c->get(IEventDispatcher::class),
934
-				$c->get(LoggerInterface::class)
935
-			);
936
-		});
937
-		/** @deprecated 19.0.0 */
938
-		$this->registerDeprecatedAlias('AppManager', AppManager::class);
939
-		$this->registerAlias(IAppManager::class, AppManager::class);
940
-
941
-		$this->registerAlias(IDateTimeZone::class, DateTimeZone::class);
942
-		/** @deprecated 19.0.0 */
943
-		$this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class);
944
-
945
-		$this->registerService(IDateTimeFormatter::class, function (Server $c) {
946
-			$language = $c->get(\OCP\IConfig::class)->getUserValue($c->get(ISession::class)->get('user_id'), 'core', 'lang', null);
947
-
948
-			return new DateTimeFormatter(
949
-				$c->get(IDateTimeZone::class)->getTimeZone(),
950
-				$c->getL10N('lib', $language)
951
-			);
952
-		});
953
-		/** @deprecated 19.0.0 */
954
-		$this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class);
955
-
956
-		$this->registerService(IUserMountCache::class, function (ContainerInterface $c) {
957
-			$mountCache = $c->get(UserMountCache::class);
958
-			$listener = new UserMountCacheListener($mountCache);
959
-			$listener->listen($c->get(IUserManager::class));
960
-			return $mountCache;
961
-		});
962
-		/** @deprecated 19.0.0 */
963
-		$this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class);
964
-
965
-		$this->registerService(IMountProviderCollection::class, function (ContainerInterface $c) {
966
-			$loader = $c->get(IStorageFactory::class);
967
-			$mountCache = $c->get(IUserMountCache::class);
968
-			$eventLogger = $c->get(IEventLogger::class);
969
-			$manager = new MountProviderCollection($loader, $mountCache, $eventLogger);
970
-
971
-			// builtin providers
972
-
973
-			$config = $c->get(\OCP\IConfig::class);
974
-			$logger = $c->get(LoggerInterface::class);
975
-			$manager->registerProvider(new CacheMountProvider($config));
976
-			$manager->registerHomeProvider(new LocalHomeMountProvider());
977
-			$manager->registerHomeProvider(new ObjectHomeMountProvider($config));
978
-			$manager->registerRootProvider(new RootMountProvider($config, $c->get(LoggerInterface::class)));
979
-			$manager->registerRootProvider(new ObjectStorePreviewCacheMountProvider($logger, $config));
980
-
981
-			return $manager;
982
-		});
983
-		/** @deprecated 19.0.0 */
984
-		$this->registerDeprecatedAlias('MountConfigManager', IMountProviderCollection::class);
985
-
986
-		/** @deprecated 20.0.0 */
987
-		$this->registerDeprecatedAlias('IniWrapper', IniGetWrapper::class);
988
-		$this->registerService(IBus::class, function (ContainerInterface $c) {
989
-			$busClass = $c->get(\OCP\IConfig::class)->getSystemValue('commandbus');
990
-			if ($busClass) {
991
-				[$app, $class] = explode('::', $busClass, 2);
992
-				if ($c->get(IAppManager::class)->isInstalled($app)) {
993
-					\OC_App::loadApp($app);
994
-					return $c->get($class);
995
-				} else {
996
-					throw new ServiceUnavailableException("The app providing the command bus ($app) is not enabled");
997
-				}
998
-			} else {
999
-				$jobList = $c->get(IJobList::class);
1000
-				return new CronBus($jobList);
1001
-			}
1002
-		});
1003
-		$this->registerDeprecatedAlias('AsyncCommandBus', IBus::class);
1004
-		/** @deprecated 20.0.0 */
1005
-		$this->registerDeprecatedAlias('TrustedDomainHelper', TrustedDomainHelper::class);
1006
-		$this->registerAlias(ITrustedDomainHelper::class, TrustedDomainHelper::class);
1007
-		/** @deprecated 19.0.0 */
1008
-		$this->registerDeprecatedAlias('Throttler', Throttler::class);
1009
-		$this->registerAlias(IThrottler::class, Throttler::class);
1010
-		$this->registerService('IntegrityCodeChecker', function (ContainerInterface $c) {
1011
-			// IConfig and IAppManager requires a working database. This code
1012
-			// might however be called when ownCloud is not yet setup.
1013
-			if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) {
1014
-				$config = $c->get(\OCP\IConfig::class);
1015
-				$appManager = $c->get(IAppManager::class);
1016
-			} else {
1017
-				$config = null;
1018
-				$appManager = null;
1019
-			}
1020
-
1021
-			return new Checker(
1022
-				new EnvironmentHelper(),
1023
-				new FileAccessHelper(),
1024
-				new AppLocator(),
1025
-				$config,
1026
-				$c->get(ICacheFactory::class),
1027
-				$appManager,
1028
-				$c->get(IMimeTypeDetector::class)
1029
-			);
1030
-		});
1031
-		$this->registerService(\OCP\IRequest::class, function (ContainerInterface $c) {
1032
-			if (isset($this['urlParams'])) {
1033
-				$urlParams = $this['urlParams'];
1034
-			} else {
1035
-				$urlParams = [];
1036
-			}
1037
-
1038
-			if (defined('PHPUNIT_RUN') && PHPUNIT_RUN
1039
-				&& in_array('fakeinput', stream_get_wrappers())
1040
-			) {
1041
-				$stream = 'fakeinput://data';
1042
-			} else {
1043
-				$stream = 'php://input';
1044
-			}
1045
-
1046
-			return new Request(
1047
-				[
1048
-					'get' => $_GET,
1049
-					'post' => $_POST,
1050
-					'files' => $_FILES,
1051
-					'server' => $_SERVER,
1052
-					'env' => $_ENV,
1053
-					'cookies' => $_COOKIE,
1054
-					'method' => (isset($_SERVER) && isset($_SERVER['REQUEST_METHOD']))
1055
-						? $_SERVER['REQUEST_METHOD']
1056
-						: '',
1057
-					'urlParams' => $urlParams,
1058
-				],
1059
-				$this->get(IRequestId::class),
1060
-				$this->get(\OCP\IConfig::class),
1061
-				$this->get(CsrfTokenManager::class),
1062
-				$stream
1063
-			);
1064
-		});
1065
-		/** @deprecated 19.0.0 */
1066
-		$this->registerDeprecatedAlias('Request', \OCP\IRequest::class);
1067
-
1068
-		$this->registerService(IRequestId::class, function (ContainerInterface $c): IRequestId {
1069
-			return new RequestId(
1070
-				$_SERVER['UNIQUE_ID'] ?? '',
1071
-				$this->get(ISecureRandom::class)
1072
-			);
1073
-		});
1074
-
1075
-		$this->registerService(IMailer::class, function (Server $c) {
1076
-			return new Mailer(
1077
-				$c->get(\OCP\IConfig::class),
1078
-				$c->get(LoggerInterface::class),
1079
-				$c->get(Defaults::class),
1080
-				$c->get(IURLGenerator::class),
1081
-				$c->getL10N('lib'),
1082
-				$c->get(IEventDispatcher::class),
1083
-				$c->get(IFactory::class)
1084
-			);
1085
-		});
1086
-		/** @deprecated 19.0.0 */
1087
-		$this->registerDeprecatedAlias('Mailer', IMailer::class);
1088
-
1089
-		/** @deprecated 21.0.0 */
1090
-		$this->registerDeprecatedAlias('LDAPProvider', ILDAPProvider::class);
1091
-
1092
-		$this->registerService(ILDAPProviderFactory::class, function (ContainerInterface $c) {
1093
-			$config = $c->get(\OCP\IConfig::class);
1094
-			$factoryClass = $config->getSystemValue('ldapProviderFactory', null);
1095
-			if (is_null($factoryClass) || !class_exists($factoryClass)) {
1096
-				return new NullLDAPProviderFactory($this);
1097
-			}
1098
-			/** @var \OCP\LDAP\ILDAPProviderFactory $factory */
1099
-			return new $factoryClass($this);
1100
-		});
1101
-		$this->registerService(ILDAPProvider::class, function (ContainerInterface $c) {
1102
-			$factory = $c->get(ILDAPProviderFactory::class);
1103
-			return $factory->getLDAPProvider();
1104
-		});
1105
-		$this->registerService(ILockingProvider::class, function (ContainerInterface $c) {
1106
-			$ini = $c->get(IniGetWrapper::class);
1107
-			$config = $c->get(\OCP\IConfig::class);
1108
-			$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
1109
-			if ($config->getSystemValue('filelocking.enabled', true) or (defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
1110
-				/** @var \OC\Memcache\Factory $memcacheFactory */
1111
-				$memcacheFactory = $c->get(ICacheFactory::class);
1112
-				$memcache = $memcacheFactory->createLocking('lock');
1113
-				if (!($memcache instanceof \OC\Memcache\NullCache)) {
1114
-					return new MemcacheLockingProvider($memcache, $ttl);
1115
-				}
1116
-				return new DBLockingProvider(
1117
-					$c->get(IDBConnection::class),
1118
-					new TimeFactory(),
1119
-					$ttl,
1120
-					!\OC::$CLI
1121
-				);
1122
-			}
1123
-			return new NoopLockingProvider();
1124
-		});
1125
-		/** @deprecated 19.0.0 */
1126
-		$this->registerDeprecatedAlias('LockingProvider', ILockingProvider::class);
1127
-
1128
-		$this->registerService(ILockManager::class, function (Server $c): LockManager {
1129
-			return new LockManager();
1130
-		});
1131
-
1132
-		$this->registerAlias(ILockdownManager::class, 'LockdownManager');
1133
-		$this->registerService(SetupManager::class, function ($c) {
1134
-			// create the setupmanager through the mount manager to resolve the cyclic dependency
1135
-			return $c->get(\OC\Files\Mount\Manager::class)->getSetupManager();
1136
-		});
1137
-		$this->registerAlias(IMountManager::class, \OC\Files\Mount\Manager::class);
1138
-		/** @deprecated 19.0.0 */
1139
-		$this->registerDeprecatedAlias('MountManager', IMountManager::class);
1140
-
1141
-		$this->registerService(IMimeTypeDetector::class, function (ContainerInterface $c) {
1142
-			return new \OC\Files\Type\Detection(
1143
-				$c->get(IURLGenerator::class),
1144
-				$c->get(LoggerInterface::class),
1145
-				\OC::$configDir,
1146
-				\OC::$SERVERROOT . '/resources/config/'
1147
-			);
1148
-		});
1149
-		/** @deprecated 19.0.0 */
1150
-		$this->registerDeprecatedAlias('MimeTypeDetector', IMimeTypeDetector::class);
1151
-
1152
-		$this->registerAlias(IMimeTypeLoader::class, Loader::class);
1153
-		/** @deprecated 19.0.0 */
1154
-		$this->registerDeprecatedAlias('MimeTypeLoader', IMimeTypeLoader::class);
1155
-		$this->registerService(BundleFetcher::class, function () {
1156
-			return new BundleFetcher($this->getL10N('lib'));
1157
-		});
1158
-		$this->registerAlias(\OCP\Notification\IManager::class, Manager::class);
1159
-		/** @deprecated 19.0.0 */
1160
-		$this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class);
1161
-
1162
-		$this->registerService(CapabilitiesManager::class, function (ContainerInterface $c) {
1163
-			$manager = new CapabilitiesManager($c->get(LoggerInterface::class));
1164
-			$manager->registerCapability(function () use ($c) {
1165
-				return new \OC\OCS\CoreCapabilities($c->get(\OCP\IConfig::class));
1166
-			});
1167
-			$manager->registerCapability(function () use ($c) {
1168
-				return $c->get(\OC\Security\Bruteforce\Capabilities::class);
1169
-			});
1170
-			$manager->registerCapability(function () use ($c) {
1171
-				return $c->get(MetadataCapabilities::class);
1172
-			});
1173
-			return $manager;
1174
-		});
1175
-		/** @deprecated 19.0.0 */
1176
-		$this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class);
1177
-
1178
-		$this->registerService(ICommentsManager::class, function (Server $c) {
1179
-			$config = $c->get(\OCP\IConfig::class);
1180
-			$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class);
1181
-			/** @var \OCP\Comments\ICommentsManagerFactory $factory */
1182
-			$factory = new $factoryClass($this);
1183
-			$manager = $factory->getManager();
1184
-
1185
-			$manager->registerDisplayNameResolver('user', function ($id) use ($c) {
1186
-				$manager = $c->get(IUserManager::class);
1187
-				$userDisplayName = $manager->getDisplayName($id);
1188
-				if ($userDisplayName === null) {
1189
-					$l = $c->get(IFactory::class)->get('core');
1190
-					return $l->t('Unknown user');
1191
-				}
1192
-				return $userDisplayName;
1193
-			});
1194
-
1195
-			return $manager;
1196
-		});
1197
-		/** @deprecated 19.0.0 */
1198
-		$this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class);
1199
-
1200
-		$this->registerAlias(\OC_Defaults::class, 'ThemingDefaults');
1201
-		$this->registerService('ThemingDefaults', function (Server $c) {
1202
-			try {
1203
-				$classExists = class_exists('OCA\Theming\ThemingDefaults');
1204
-			} catch (\OCP\AutoloadNotAllowedException $e) {
1205
-				// App disabled or in maintenance mode
1206
-				$classExists = false;
1207
-			}
1208
-
1209
-			if ($classExists && $c->get(\OCP\IConfig::class)->getSystemValue('installed', false) && $c->get(IAppManager::class)->isInstalled('theming') && $c->getTrustedDomainHelper()->isTrustedDomain($c->getRequest()->getInsecureServerHost())) {
1210
-				$imageManager = new ImageManager(
1211
-					$c->get(\OCP\IConfig::class),
1212
-					$c->getAppDataDir('theming'),
1213
-					$c->get(IURLGenerator::class),
1214
-					$this->get(ICacheFactory::class),
1215
-					$this->get(ILogger::class),
1216
-					$this->get(ITempManager::class)
1217
-				);
1218
-				return new ThemingDefaults(
1219
-					$c->get(\OCP\IConfig::class),
1220
-					$c->getL10N('theming'),
1221
-					$c->get(IUserSession::class),
1222
-					$c->get(IURLGenerator::class),
1223
-					$c->get(ICacheFactory::class),
1224
-					new Util($c->get(\OCP\IConfig::class), $this->get(IAppManager::class), $c->getAppDataDir('theming'), $imageManager),
1225
-					$imageManager,
1226
-					$c->get(IAppManager::class),
1227
-					$c->get(INavigationManager::class)
1228
-				);
1229
-			}
1230
-			return new \OC_Defaults();
1231
-		});
1232
-		$this->registerService(JSCombiner::class, function (Server $c) {
1233
-			return new JSCombiner(
1234
-				$c->getAppDataDir('js'),
1235
-				$c->get(IURLGenerator::class),
1236
-				$this->get(ICacheFactory::class),
1237
-				$c->get(SystemConfig::class),
1238
-				$c->get(LoggerInterface::class)
1239
-			);
1240
-		});
1241
-		$this->registerAlias(\OCP\EventDispatcher\IEventDispatcher::class, \OC\EventDispatcher\EventDispatcher::class);
1242
-		/** @deprecated 19.0.0 */
1243
-		$this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class);
1244
-		$this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class);
1245
-
1246
-		$this->registerService('CryptoWrapper', function (ContainerInterface $c) {
1247
-			// FIXME: Instantiated here due to cyclic dependency
1248
-			$request = new Request(
1249
-				[
1250
-					'get' => $_GET,
1251
-					'post' => $_POST,
1252
-					'files' => $_FILES,
1253
-					'server' => $_SERVER,
1254
-					'env' => $_ENV,
1255
-					'cookies' => $_COOKIE,
1256
-					'method' => (isset($_SERVER) && isset($_SERVER['REQUEST_METHOD']))
1257
-						? $_SERVER['REQUEST_METHOD']
1258
-						: null,
1259
-				],
1260
-				$c->get(IRequestId::class),
1261
-				$c->get(\OCP\IConfig::class)
1262
-			);
1263
-
1264
-			return new CryptoWrapper(
1265
-				$c->get(\OCP\IConfig::class),
1266
-				$c->get(ICrypto::class),
1267
-				$c->get(ISecureRandom::class),
1268
-				$request
1269
-			);
1270
-		});
1271
-		/** @deprecated 19.0.0 */
1272
-		$this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class);
1273
-		$this->registerService(SessionStorage::class, function (ContainerInterface $c) {
1274
-			return new SessionStorage($c->get(ISession::class));
1275
-		});
1276
-		$this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class);
1277
-		/** @deprecated 19.0.0 */
1278
-		$this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class);
1279
-
1280
-		$this->registerService(\OCP\Share\IManager::class, function (IServerContainer $c) {
1281
-			$config = $c->get(\OCP\IConfig::class);
1282
-			$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class);
1283
-			/** @var \OCP\Share\IProviderFactory $factory */
1284
-			$factory = new $factoryClass($this);
1285
-
1286
-			$manager = new \OC\Share20\Manager(
1287
-				$c->get(LoggerInterface::class),
1288
-				$c->get(\OCP\IConfig::class),
1289
-				$c->get(ISecureRandom::class),
1290
-				$c->get(IHasher::class),
1291
-				$c->get(IMountManager::class),
1292
-				$c->get(IGroupManager::class),
1293
-				$c->getL10N('lib'),
1294
-				$c->get(IFactory::class),
1295
-				$factory,
1296
-				$c->get(IUserManager::class),
1297
-				$c->get(IRootFolder::class),
1298
-				$c->get(SymfonyAdapter::class),
1299
-				$c->get(IMailer::class),
1300
-				$c->get(IURLGenerator::class),
1301
-				$c->get('ThemingDefaults'),
1302
-				$c->get(IEventDispatcher::class),
1303
-				$c->get(IUserSession::class),
1304
-				$c->get(KnownUserService::class)
1305
-			);
1306
-
1307
-			return $manager;
1308
-		});
1309
-		/** @deprecated 19.0.0 */
1310
-		$this->registerDeprecatedAlias('ShareManager', \OCP\Share\IManager::class);
1311
-
1312
-		$this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) {
1313
-			$instance = new Collaboration\Collaborators\Search($c);
1314
-
1315
-			// register default plugins
1316
-			$instance->registerPlugin(['shareType' => 'SHARE_TYPE_USER', 'class' => UserPlugin::class]);
1317
-			$instance->registerPlugin(['shareType' => 'SHARE_TYPE_GROUP', 'class' => GroupPlugin::class]);
1318
-			$instance->registerPlugin(['shareType' => 'SHARE_TYPE_EMAIL', 'class' => MailPlugin::class]);
1319
-			$instance->registerPlugin(['shareType' => 'SHARE_TYPE_REMOTE', 'class' => RemotePlugin::class]);
1320
-			$instance->registerPlugin(['shareType' => 'SHARE_TYPE_REMOTE_GROUP', 'class' => RemoteGroupPlugin::class]);
1321
-
1322
-			return $instance;
1323
-		});
1324
-		/** @deprecated 19.0.0 */
1325
-		$this->registerDeprecatedAlias('CollaboratorSearch', \OCP\Collaboration\Collaborators\ISearch::class);
1326
-		$this->registerAlias(\OCP\Collaboration\Collaborators\ISearchResult::class, \OC\Collaboration\Collaborators\SearchResult::class);
1327
-
1328
-		$this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class);
1329
-
1330
-		$this->registerAlias(\OCP\Collaboration\Resources\IProviderManager::class, \OC\Collaboration\Resources\ProviderManager::class);
1331
-		$this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\Manager::class);
1332
-
1333
-		$this->registerAlias(IReferenceManager::class, ReferenceManager::class);
1334
-
1335
-		$this->registerDeprecatedAlias('SettingsManager', \OC\Settings\Manager::class);
1336
-		$this->registerAlias(\OCP\Settings\IManager::class, \OC\Settings\Manager::class);
1337
-		$this->registerService(\OC\Files\AppData\Factory::class, function (ContainerInterface $c) {
1338
-			return new \OC\Files\AppData\Factory(
1339
-				$c->get(IRootFolder::class),
1340
-				$c->get(SystemConfig::class)
1341
-			);
1342
-		});
1343
-
1344
-		$this->registerService('LockdownManager', function (ContainerInterface $c) {
1345
-			return new LockdownManager(function () use ($c) {
1346
-				return $c->get(ISession::class);
1347
-			});
1348
-		});
1349
-
1350
-		$this->registerService(\OCP\OCS\IDiscoveryService::class, function (ContainerInterface $c) {
1351
-			return new DiscoveryService(
1352
-				$c->get(ICacheFactory::class),
1353
-				$c->get(IClientService::class)
1354
-			);
1355
-		});
1356
-
1357
-		$this->registerService(ICloudIdManager::class, function (ContainerInterface $c) {
1358
-			return new CloudIdManager(
1359
-				$c->get(\OCP\Contacts\IManager::class),
1360
-				$c->get(IURLGenerator::class),
1361
-				$c->get(IUserManager::class),
1362
-				$c->get(ICacheFactory::class),
1363
-				$c->get(IEventDispatcher::class),
1364
-			);
1365
-		});
1366
-
1367
-		$this->registerAlias(\OCP\GlobalScale\IConfig::class, \OC\GlobalScale\Config::class);
1368
-
1369
-		$this->registerService(ICloudFederationProviderManager::class, function (ContainerInterface $c) {
1370
-			return new CloudFederationProviderManager(
1371
-				$c->get(IAppManager::class),
1372
-				$c->get(IClientService::class),
1373
-				$c->get(ICloudIdManager::class),
1374
-				$c->get(LoggerInterface::class)
1375
-			);
1376
-		});
1377
-
1378
-		$this->registerService(ICloudFederationFactory::class, function (Server $c) {
1379
-			return new CloudFederationFactory();
1380
-		});
1381
-
1382
-		$this->registerAlias(\OCP\AppFramework\Utility\IControllerMethodReflector::class, \OC\AppFramework\Utility\ControllerMethodReflector::class);
1383
-		/** @deprecated 19.0.0 */
1384
-		$this->registerDeprecatedAlias('ControllerMethodReflector', \OCP\AppFramework\Utility\IControllerMethodReflector::class);
1385
-
1386
-		$this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class);
1387
-		$this->registerAlias(\Psr\Clock\ClockInterface::class, \OCP\AppFramework\Utility\ITimeFactory::class);
1388
-		/** @deprecated 19.0.0 */
1389
-		$this->registerDeprecatedAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class);
1390
-
1391
-		$this->registerService(Defaults::class, function (Server $c) {
1392
-			return new Defaults(
1393
-				$c->getThemingDefaults()
1394
-			);
1395
-		});
1396
-		/** @deprecated 19.0.0 */
1397
-		$this->registerDeprecatedAlias('Defaults', \OCP\Defaults::class);
1398
-
1399
-		$this->registerService(\OCP\ISession::class, function (ContainerInterface $c) {
1400
-			return $c->get(\OCP\IUserSession::class)->getSession();
1401
-		}, false);
1402
-
1403
-		$this->registerService(IShareHelper::class, function (ContainerInterface $c) {
1404
-			return new ShareHelper(
1405
-				$c->get(\OCP\Share\IManager::class)
1406
-			);
1407
-		});
1408
-
1409
-		$this->registerService(Installer::class, function (ContainerInterface $c) {
1410
-			return new Installer(
1411
-				$c->get(AppFetcher::class),
1412
-				$c->get(IClientService::class),
1413
-				$c->get(ITempManager::class),
1414
-				$c->get(LoggerInterface::class),
1415
-				$c->get(\OCP\IConfig::class),
1416
-				\OC::$CLI
1417
-			);
1418
-		});
1419
-
1420
-		$this->registerService(IApiFactory::class, function (ContainerInterface $c) {
1421
-			return new ApiFactory($c->get(IClientService::class));
1422
-		});
1423
-
1424
-		$this->registerService(IInstanceFactory::class, function (ContainerInterface $c) {
1425
-			$memcacheFactory = $c->get(ICacheFactory::class);
1426
-			return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->get(IClientService::class));
1427
-		});
1428
-
1429
-		$this->registerAlias(IContactsStore::class, ContactsStore::class);
1430
-		$this->registerAlias(IAccountManager::class, AccountManager::class);
1431
-
1432
-		$this->registerAlias(IStorageFactory::class, StorageFactory::class);
1433
-
1434
-		$this->registerAlias(\OCP\Dashboard\IManager::class, \OC\Dashboard\Manager::class);
1435
-
1436
-		$this->registerAlias(IFullTextSearchManager::class, FullTextSearchManager::class);
1437
-
1438
-		$this->registerAlias(ISubAdmin::class, SubAdmin::class);
1439
-
1440
-		$this->registerAlias(IInitialStateService::class, InitialStateService::class);
1441
-
1442
-		$this->registerAlias(\OCP\IEmojiHelper::class, \OC\EmojiHelper::class);
1443
-
1444
-		$this->registerAlias(\OCP\UserStatus\IManager::class, \OC\UserStatus\Manager::class);
1445
-
1446
-		$this->registerAlias(IBroker::class, Broker::class);
1447
-
1448
-		$this->registerAlias(IMetadataManager::class, MetadataManager::class);
1449
-
1450
-		$this->registerAlias(\OCP\Files\AppData\IAppDataFactory::class, \OC\Files\AppData\Factory::class);
1451
-
1452
-		$this->registerAlias(IBinaryFinder::class, BinaryFinder::class);
1453
-
1454
-		$this->registerAlias(\OCP\Share\IPublicShareTemplateFactory::class, \OC\Share20\PublicShareTemplateFactory::class);
1455
-
1456
-		$this->registerAlias(ITranslationManager::class, TranslationManager::class);
1457
-
1458
-		$this->connectDispatcher();
1459
-	}
1460
-
1461
-	public function boot() {
1462
-		/** @var HookConnector $hookConnector */
1463
-		$hookConnector = $this->get(HookConnector::class);
1464
-		$hookConnector->viewToNode();
1465
-	}
1466
-
1467
-	/**
1468
-	 * @return \OCP\Calendar\IManager
1469
-	 * @deprecated 20.0.0
1470
-	 */
1471
-	public function getCalendarManager() {
1472
-		return $this->get(\OC\Calendar\Manager::class);
1473
-	}
1474
-
1475
-	/**
1476
-	 * @return \OCP\Calendar\Resource\IManager
1477
-	 * @deprecated 20.0.0
1478
-	 */
1479
-	public function getCalendarResourceBackendManager() {
1480
-		return $this->get(\OC\Calendar\Resource\Manager::class);
1481
-	}
1482
-
1483
-	/**
1484
-	 * @return \OCP\Calendar\Room\IManager
1485
-	 * @deprecated 20.0.0
1486
-	 */
1487
-	public function getCalendarRoomBackendManager() {
1488
-		return $this->get(\OC\Calendar\Room\Manager::class);
1489
-	}
1490
-
1491
-	private function connectDispatcher(): void {
1492
-		/** @var IEventDispatcher $eventDispatcher */
1493
-		$eventDispatcher = $this->get(IEventDispatcher::class);
1494
-		$eventDispatcher->addServiceListener(LoginFailed::class, LoginFailedListener::class);
1495
-		$eventDispatcher->addServiceListener(PostLoginEvent::class, UserLoggedInListener::class);
1496
-		$eventDispatcher->addServiceListener(UserChangedEvent::class, UserChangedListener::class);
1497
-		$eventDispatcher->addServiceListener(BeforeUserDeletedEvent::class, BeforeUserDeletedListener::class);
1498
-	}
1499
-
1500
-	/**
1501
-	 * @return \OCP\Contacts\IManager
1502
-	 * @deprecated 20.0.0
1503
-	 */
1504
-	public function getContactsManager() {
1505
-		return $this->get(\OCP\Contacts\IManager::class);
1506
-	}
1507
-
1508
-	/**
1509
-	 * @return \OC\Encryption\Manager
1510
-	 * @deprecated 20.0.0
1511
-	 */
1512
-	public function getEncryptionManager() {
1513
-		return $this->get(\OCP\Encryption\IManager::class);
1514
-	}
1515
-
1516
-	/**
1517
-	 * @return \OC\Encryption\File
1518
-	 * @deprecated 20.0.0
1519
-	 */
1520
-	public function getEncryptionFilesHelper() {
1521
-		return $this->get(IFile::class);
1522
-	}
1523
-
1524
-	/**
1525
-	 * @return \OCP\Encryption\Keys\IStorage
1526
-	 * @deprecated 20.0.0
1527
-	 */
1528
-	public function getEncryptionKeyStorage() {
1529
-		return $this->get(IStorage::class);
1530
-	}
1531
-
1532
-	/**
1533
-	 * The current request object holding all information about the request
1534
-	 * currently being processed is returned from this method.
1535
-	 * In case the current execution was not initiated by a web request null is returned
1536
-	 *
1537
-	 * @return \OCP\IRequest
1538
-	 * @deprecated 20.0.0
1539
-	 */
1540
-	public function getRequest() {
1541
-		return $this->get(IRequest::class);
1542
-	}
1543
-
1544
-	/**
1545
-	 * Returns the preview manager which can create preview images for a given file
1546
-	 *
1547
-	 * @return IPreview
1548
-	 * @deprecated 20.0.0
1549
-	 */
1550
-	public function getPreviewManager() {
1551
-		return $this->get(IPreview::class);
1552
-	}
1553
-
1554
-	/**
1555
-	 * Returns the tag manager which can get and set tags for different object types
1556
-	 *
1557
-	 * @see \OCP\ITagManager::load()
1558
-	 * @return ITagManager
1559
-	 * @deprecated 20.0.0
1560
-	 */
1561
-	public function getTagManager() {
1562
-		return $this->get(ITagManager::class);
1563
-	}
1564
-
1565
-	/**
1566
-	 * Returns the system-tag manager
1567
-	 *
1568
-	 * @return ISystemTagManager
1569
-	 *
1570
-	 * @since 9.0.0
1571
-	 * @deprecated 20.0.0
1572
-	 */
1573
-	public function getSystemTagManager() {
1574
-		return $this->get(ISystemTagManager::class);
1575
-	}
1576
-
1577
-	/**
1578
-	 * Returns the system-tag object mapper
1579
-	 *
1580
-	 * @return ISystemTagObjectMapper
1581
-	 *
1582
-	 * @since 9.0.0
1583
-	 * @deprecated 20.0.0
1584
-	 */
1585
-	public function getSystemTagObjectMapper() {
1586
-		return $this->get(ISystemTagObjectMapper::class);
1587
-	}
1588
-
1589
-	/**
1590
-	 * Returns the avatar manager, used for avatar functionality
1591
-	 *
1592
-	 * @return IAvatarManager
1593
-	 * @deprecated 20.0.0
1594
-	 */
1595
-	public function getAvatarManager() {
1596
-		return $this->get(IAvatarManager::class);
1597
-	}
1598
-
1599
-	/**
1600
-	 * Returns the root folder of ownCloud's data directory
1601
-	 *
1602
-	 * @return IRootFolder
1603
-	 * @deprecated 20.0.0
1604
-	 */
1605
-	public function getRootFolder() {
1606
-		return $this->get(IRootFolder::class);
1607
-	}
1608
-
1609
-	/**
1610
-	 * Returns the root folder of ownCloud's data directory
1611
-	 * This is the lazy variant so this gets only initialized once it
1612
-	 * is actually used.
1613
-	 *
1614
-	 * @return IRootFolder
1615
-	 * @deprecated 20.0.0
1616
-	 */
1617
-	public function getLazyRootFolder() {
1618
-		return $this->get(IRootFolder::class);
1619
-	}
1620
-
1621
-	/**
1622
-	 * Returns a view to ownCloud's files folder
1623
-	 *
1624
-	 * @param string $userId user ID
1625
-	 * @return \OCP\Files\Folder|null
1626
-	 * @deprecated 20.0.0
1627
-	 */
1628
-	public function getUserFolder($userId = null) {
1629
-		if ($userId === null) {
1630
-			$user = $this->get(IUserSession::class)->getUser();
1631
-			if (!$user) {
1632
-				return null;
1633
-			}
1634
-			$userId = $user->getUID();
1635
-		}
1636
-		$root = $this->get(IRootFolder::class);
1637
-		return $root->getUserFolder($userId);
1638
-	}
1639
-
1640
-	/**
1641
-	 * @return \OC\User\Manager
1642
-	 * @deprecated 20.0.0
1643
-	 */
1644
-	public function getUserManager() {
1645
-		return $this->get(IUserManager::class);
1646
-	}
1647
-
1648
-	/**
1649
-	 * @return \OC\Group\Manager
1650
-	 * @deprecated 20.0.0
1651
-	 */
1652
-	public function getGroupManager() {
1653
-		return $this->get(IGroupManager::class);
1654
-	}
1655
-
1656
-	/**
1657
-	 * @return \OC\User\Session
1658
-	 * @deprecated 20.0.0
1659
-	 */
1660
-	public function getUserSession() {
1661
-		return $this->get(IUserSession::class);
1662
-	}
1663
-
1664
-	/**
1665
-	 * @return \OCP\ISession
1666
-	 * @deprecated 20.0.0
1667
-	 */
1668
-	public function getSession() {
1669
-		return $this->get(Session::class)->getSession();
1670
-	}
1671
-
1672
-	/**
1673
-	 * @param \OCP\ISession $session
1674
-	 */
1675
-	public function setSession(\OCP\ISession $session) {
1676
-		$this->get(SessionStorage::class)->setSession($session);
1677
-		$this->get(Session::class)->setSession($session);
1678
-		$this->get(Store::class)->setSession($session);
1679
-	}
1680
-
1681
-	/**
1682
-	 * @return \OC\Authentication\TwoFactorAuth\Manager
1683
-	 * @deprecated 20.0.0
1684
-	 */
1685
-	public function getTwoFactorAuthManager() {
1686
-		return $this->get(\OC\Authentication\TwoFactorAuth\Manager::class);
1687
-	}
1688
-
1689
-	/**
1690
-	 * @return \OC\NavigationManager
1691
-	 * @deprecated 20.0.0
1692
-	 */
1693
-	public function getNavigationManager() {
1694
-		return $this->get(INavigationManager::class);
1695
-	}
1696
-
1697
-	/**
1698
-	 * @return \OCP\IConfig
1699
-	 * @deprecated 20.0.0
1700
-	 */
1701
-	public function getConfig() {
1702
-		return $this->get(AllConfig::class);
1703
-	}
1704
-
1705
-	/**
1706
-	 * @return \OC\SystemConfig
1707
-	 * @deprecated 20.0.0
1708
-	 */
1709
-	public function getSystemConfig() {
1710
-		return $this->get(SystemConfig::class);
1711
-	}
1712
-
1713
-	/**
1714
-	 * Returns the app config manager
1715
-	 *
1716
-	 * @return IAppConfig
1717
-	 * @deprecated 20.0.0
1718
-	 */
1719
-	public function getAppConfig() {
1720
-		return $this->get(IAppConfig::class);
1721
-	}
1722
-
1723
-	/**
1724
-	 * @return IFactory
1725
-	 * @deprecated 20.0.0
1726
-	 */
1727
-	public function getL10NFactory() {
1728
-		return $this->get(IFactory::class);
1729
-	}
1730
-
1731
-	/**
1732
-	 * get an L10N instance
1733
-	 *
1734
-	 * @param string $app appid
1735
-	 * @param string $lang
1736
-	 * @return IL10N
1737
-	 * @deprecated 20.0.0
1738
-	 */
1739
-	public function getL10N($app, $lang = null) {
1740
-		return $this->get(IFactory::class)->get($app, $lang);
1741
-	}
1742
-
1743
-	/**
1744
-	 * @return IURLGenerator
1745
-	 * @deprecated 20.0.0
1746
-	 */
1747
-	public function getURLGenerator() {
1748
-		return $this->get(IURLGenerator::class);
1749
-	}
1750
-
1751
-	/**
1752
-	 * @return AppFetcher
1753
-	 * @deprecated 20.0.0
1754
-	 */
1755
-	public function getAppFetcher() {
1756
-		return $this->get(AppFetcher::class);
1757
-	}
1758
-
1759
-	/**
1760
-	 * Returns an ICache instance. Since 8.1.0 it returns a fake cache. Use
1761
-	 * getMemCacheFactory() instead.
1762
-	 *
1763
-	 * @return ICache
1764
-	 * @deprecated 8.1.0 use getMemCacheFactory to obtain a proper cache
1765
-	 */
1766
-	public function getCache() {
1767
-		return $this->get(ICache::class);
1768
-	}
1769
-
1770
-	/**
1771
-	 * Returns an \OCP\CacheFactory instance
1772
-	 *
1773
-	 * @return \OCP\ICacheFactory
1774
-	 * @deprecated 20.0.0
1775
-	 */
1776
-	public function getMemCacheFactory() {
1777
-		return $this->get(ICacheFactory::class);
1778
-	}
1779
-
1780
-	/**
1781
-	 * Returns an \OC\RedisFactory instance
1782
-	 *
1783
-	 * @return \OC\RedisFactory
1784
-	 * @deprecated 20.0.0
1785
-	 */
1786
-	public function getGetRedisFactory() {
1787
-		return $this->get('RedisFactory');
1788
-	}
1789
-
1790
-
1791
-	/**
1792
-	 * Returns the current session
1793
-	 *
1794
-	 * @return \OCP\IDBConnection
1795
-	 * @deprecated 20.0.0
1796
-	 */
1797
-	public function getDatabaseConnection() {
1798
-		return $this->get(IDBConnection::class);
1799
-	}
1800
-
1801
-	/**
1802
-	 * Returns the activity manager
1803
-	 *
1804
-	 * @return \OCP\Activity\IManager
1805
-	 * @deprecated 20.0.0
1806
-	 */
1807
-	public function getActivityManager() {
1808
-		return $this->get(\OCP\Activity\IManager::class);
1809
-	}
1810
-
1811
-	/**
1812
-	 * Returns an job list for controlling background jobs
1813
-	 *
1814
-	 * @return IJobList
1815
-	 * @deprecated 20.0.0
1816
-	 */
1817
-	public function getJobList() {
1818
-		return $this->get(IJobList::class);
1819
-	}
1820
-
1821
-	/**
1822
-	 * Returns a logger instance
1823
-	 *
1824
-	 * @return ILogger
1825
-	 * @deprecated 20.0.0
1826
-	 */
1827
-	public function getLogger() {
1828
-		return $this->get(ILogger::class);
1829
-	}
1830
-
1831
-	/**
1832
-	 * @return ILogFactory
1833
-	 * @throws \OCP\AppFramework\QueryException
1834
-	 * @deprecated 20.0.0
1835
-	 */
1836
-	public function getLogFactory() {
1837
-		return $this->get(ILogFactory::class);
1838
-	}
1839
-
1840
-	/**
1841
-	 * Returns a router for generating and matching urls
1842
-	 *
1843
-	 * @return IRouter
1844
-	 * @deprecated 20.0.0
1845
-	 */
1846
-	public function getRouter() {
1847
-		return $this->get(IRouter::class);
1848
-	}
1849
-
1850
-	/**
1851
-	 * Returns a search instance
1852
-	 *
1853
-	 * @return ISearch
1854
-	 * @deprecated 20.0.0
1855
-	 */
1856
-	public function getSearch() {
1857
-		return $this->get(ISearch::class);
1858
-	}
1859
-
1860
-	/**
1861
-	 * Returns a SecureRandom instance
1862
-	 *
1863
-	 * @return \OCP\Security\ISecureRandom
1864
-	 * @deprecated 20.0.0
1865
-	 */
1866
-	public function getSecureRandom() {
1867
-		return $this->get(ISecureRandom::class);
1868
-	}
1869
-
1870
-	/**
1871
-	 * Returns a Crypto instance
1872
-	 *
1873
-	 * @return ICrypto
1874
-	 * @deprecated 20.0.0
1875
-	 */
1876
-	public function getCrypto() {
1877
-		return $this->get(ICrypto::class);
1878
-	}
1879
-
1880
-	/**
1881
-	 * Returns a Hasher instance
1882
-	 *
1883
-	 * @return IHasher
1884
-	 * @deprecated 20.0.0
1885
-	 */
1886
-	public function getHasher() {
1887
-		return $this->get(IHasher::class);
1888
-	}
1889
-
1890
-	/**
1891
-	 * Returns a CredentialsManager instance
1892
-	 *
1893
-	 * @return ICredentialsManager
1894
-	 * @deprecated 20.0.0
1895
-	 */
1896
-	public function getCredentialsManager() {
1897
-		return $this->get(ICredentialsManager::class);
1898
-	}
1899
-
1900
-	/**
1901
-	 * Get the certificate manager
1902
-	 *
1903
-	 * @return \OCP\ICertificateManager
1904
-	 */
1905
-	public function getCertificateManager() {
1906
-		return $this->get(ICertificateManager::class);
1907
-	}
1908
-
1909
-	/**
1910
-	 * Returns an instance of the HTTP client service
1911
-	 *
1912
-	 * @return IClientService
1913
-	 * @deprecated 20.0.0
1914
-	 */
1915
-	public function getHTTPClientService() {
1916
-		return $this->get(IClientService::class);
1917
-	}
1918
-
1919
-	/**
1920
-	 * Create a new event source
1921
-	 *
1922
-	 * @return \OCP\IEventSource
1923
-	 * @deprecated 20.0.0
1924
-	 */
1925
-	public function createEventSource() {
1926
-		return new \OC_EventSource();
1927
-	}
1928
-
1929
-	/**
1930
-	 * Get the active event logger
1931
-	 *
1932
-	 * The returned logger only logs data when debug mode is enabled
1933
-	 *
1934
-	 * @return IEventLogger
1935
-	 * @deprecated 20.0.0
1936
-	 */
1937
-	public function getEventLogger() {
1938
-		return $this->get(IEventLogger::class);
1939
-	}
1940
-
1941
-	/**
1942
-	 * Get the active query logger
1943
-	 *
1944
-	 * The returned logger only logs data when debug mode is enabled
1945
-	 *
1946
-	 * @return IQueryLogger
1947
-	 * @deprecated 20.0.0
1948
-	 */
1949
-	public function getQueryLogger() {
1950
-		return $this->get(IQueryLogger::class);
1951
-	}
1952
-
1953
-	/**
1954
-	 * Get the manager for temporary files and folders
1955
-	 *
1956
-	 * @return \OCP\ITempManager
1957
-	 * @deprecated 20.0.0
1958
-	 */
1959
-	public function getTempManager() {
1960
-		return $this->get(ITempManager::class);
1961
-	}
1962
-
1963
-	/**
1964
-	 * Get the app manager
1965
-	 *
1966
-	 * @return \OCP\App\IAppManager
1967
-	 * @deprecated 20.0.0
1968
-	 */
1969
-	public function getAppManager() {
1970
-		return $this->get(IAppManager::class);
1971
-	}
1972
-
1973
-	/**
1974
-	 * Creates a new mailer
1975
-	 *
1976
-	 * @return IMailer
1977
-	 * @deprecated 20.0.0
1978
-	 */
1979
-	public function getMailer() {
1980
-		return $this->get(IMailer::class);
1981
-	}
1982
-
1983
-	/**
1984
-	 * Get the webroot
1985
-	 *
1986
-	 * @return string
1987
-	 * @deprecated 20.0.0
1988
-	 */
1989
-	public function getWebRoot() {
1990
-		return $this->webRoot;
1991
-	}
1992
-
1993
-	/**
1994
-	 * @return \OC\OCSClient
1995
-	 * @deprecated 20.0.0
1996
-	 */
1997
-	public function getOcsClient() {
1998
-		return $this->get('OcsClient');
1999
-	}
2000
-
2001
-	/**
2002
-	 * @return IDateTimeZone
2003
-	 * @deprecated 20.0.0
2004
-	 */
2005
-	public function getDateTimeZone() {
2006
-		return $this->get(IDateTimeZone::class);
2007
-	}
2008
-
2009
-	/**
2010
-	 * @return IDateTimeFormatter
2011
-	 * @deprecated 20.0.0
2012
-	 */
2013
-	public function getDateTimeFormatter() {
2014
-		return $this->get(IDateTimeFormatter::class);
2015
-	}
2016
-
2017
-	/**
2018
-	 * @return IMountProviderCollection
2019
-	 * @deprecated 20.0.0
2020
-	 */
2021
-	public function getMountProviderCollection() {
2022
-		return $this->get(IMountProviderCollection::class);
2023
-	}
2024
-
2025
-	/**
2026
-	 * Get the IniWrapper
2027
-	 *
2028
-	 * @return IniGetWrapper
2029
-	 * @deprecated 20.0.0
2030
-	 */
2031
-	public function getIniWrapper() {
2032
-		return $this->get(IniGetWrapper::class);
2033
-	}
2034
-
2035
-	/**
2036
-	 * @return \OCP\Command\IBus
2037
-	 * @deprecated 20.0.0
2038
-	 */
2039
-	public function getCommandBus() {
2040
-		return $this->get(IBus::class);
2041
-	}
2042
-
2043
-	/**
2044
-	 * Get the trusted domain helper
2045
-	 *
2046
-	 * @return TrustedDomainHelper
2047
-	 * @deprecated 20.0.0
2048
-	 */
2049
-	public function getTrustedDomainHelper() {
2050
-		return $this->get(TrustedDomainHelper::class);
2051
-	}
2052
-
2053
-	/**
2054
-	 * Get the locking provider
2055
-	 *
2056
-	 * @return ILockingProvider
2057
-	 * @since 8.1.0
2058
-	 * @deprecated 20.0.0
2059
-	 */
2060
-	public function getLockingProvider() {
2061
-		return $this->get(ILockingProvider::class);
2062
-	}
2063
-
2064
-	/**
2065
-	 * @return IMountManager
2066
-	 * @deprecated 20.0.0
2067
-	 **/
2068
-	public function getMountManager() {
2069
-		return $this->get(IMountManager::class);
2070
-	}
2071
-
2072
-	/**
2073
-	 * @return IUserMountCache
2074
-	 * @deprecated 20.0.0
2075
-	 */
2076
-	public function getUserMountCache() {
2077
-		return $this->get(IUserMountCache::class);
2078
-	}
2079
-
2080
-	/**
2081
-	 * Get the MimeTypeDetector
2082
-	 *
2083
-	 * @return IMimeTypeDetector
2084
-	 * @deprecated 20.0.0
2085
-	 */
2086
-	public function getMimeTypeDetector() {
2087
-		return $this->get(IMimeTypeDetector::class);
2088
-	}
2089
-
2090
-	/**
2091
-	 * Get the MimeTypeLoader
2092
-	 *
2093
-	 * @return IMimeTypeLoader
2094
-	 * @deprecated 20.0.0
2095
-	 */
2096
-	public function getMimeTypeLoader() {
2097
-		return $this->get(IMimeTypeLoader::class);
2098
-	}
2099
-
2100
-	/**
2101
-	 * Get the manager of all the capabilities
2102
-	 *
2103
-	 * @return CapabilitiesManager
2104
-	 * @deprecated 20.0.0
2105
-	 */
2106
-	public function getCapabilitiesManager() {
2107
-		return $this->get(CapabilitiesManager::class);
2108
-	}
2109
-
2110
-	/**
2111
-	 * Get the EventDispatcher
2112
-	 *
2113
-	 * @return EventDispatcherInterface
2114
-	 * @since 8.2.0
2115
-	 * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher
2116
-	 */
2117
-	public function getEventDispatcher() {
2118
-		return $this->get(\OC\EventDispatcher\SymfonyAdapter::class);
2119
-	}
2120
-
2121
-	/**
2122
-	 * Get the Notification Manager
2123
-	 *
2124
-	 * @return \OCP\Notification\IManager
2125
-	 * @since 8.2.0
2126
-	 * @deprecated 20.0.0
2127
-	 */
2128
-	public function getNotificationManager() {
2129
-		return $this->get(\OCP\Notification\IManager::class);
2130
-	}
2131
-
2132
-	/**
2133
-	 * @return ICommentsManager
2134
-	 * @deprecated 20.0.0
2135
-	 */
2136
-	public function getCommentsManager() {
2137
-		return $this->get(ICommentsManager::class);
2138
-	}
2139
-
2140
-	/**
2141
-	 * @return \OCA\Theming\ThemingDefaults
2142
-	 * @deprecated 20.0.0
2143
-	 */
2144
-	public function getThemingDefaults() {
2145
-		return $this->get('ThemingDefaults');
2146
-	}
2147
-
2148
-	/**
2149
-	 * @return \OC\IntegrityCheck\Checker
2150
-	 * @deprecated 20.0.0
2151
-	 */
2152
-	public function getIntegrityCodeChecker() {
2153
-		return $this->get('IntegrityCodeChecker');
2154
-	}
2155
-
2156
-	/**
2157
-	 * @return \OC\Session\CryptoWrapper
2158
-	 * @deprecated 20.0.0
2159
-	 */
2160
-	public function getSessionCryptoWrapper() {
2161
-		return $this->get('CryptoWrapper');
2162
-	}
2163
-
2164
-	/**
2165
-	 * @return CsrfTokenManager
2166
-	 * @deprecated 20.0.0
2167
-	 */
2168
-	public function getCsrfTokenManager() {
2169
-		return $this->get(CsrfTokenManager::class);
2170
-	}
2171
-
2172
-	/**
2173
-	 * @return Throttler
2174
-	 * @deprecated 20.0.0
2175
-	 */
2176
-	public function getBruteForceThrottler() {
2177
-		return $this->get(Throttler::class);
2178
-	}
2179
-
2180
-	/**
2181
-	 * @return IContentSecurityPolicyManager
2182
-	 * @deprecated 20.0.0
2183
-	 */
2184
-	public function getContentSecurityPolicyManager() {
2185
-		return $this->get(ContentSecurityPolicyManager::class);
2186
-	}
2187
-
2188
-	/**
2189
-	 * @return ContentSecurityPolicyNonceManager
2190
-	 * @deprecated 20.0.0
2191
-	 */
2192
-	public function getContentSecurityPolicyNonceManager() {
2193
-		return $this->get(ContentSecurityPolicyNonceManager::class);
2194
-	}
2195
-
2196
-	/**
2197
-	 * Not a public API as of 8.2, wait for 9.0
2198
-	 *
2199
-	 * @return \OCA\Files_External\Service\BackendService
2200
-	 * @deprecated 20.0.0
2201
-	 */
2202
-	public function getStoragesBackendService() {
2203
-		return $this->get(BackendService::class);
2204
-	}
2205
-
2206
-	/**
2207
-	 * Not a public API as of 8.2, wait for 9.0
2208
-	 *
2209
-	 * @return \OCA\Files_External\Service\GlobalStoragesService
2210
-	 * @deprecated 20.0.0
2211
-	 */
2212
-	public function getGlobalStoragesService() {
2213
-		return $this->get(GlobalStoragesService::class);
2214
-	}
2215
-
2216
-	/**
2217
-	 * Not a public API as of 8.2, wait for 9.0
2218
-	 *
2219
-	 * @return \OCA\Files_External\Service\UserGlobalStoragesService
2220
-	 * @deprecated 20.0.0
2221
-	 */
2222
-	public function getUserGlobalStoragesService() {
2223
-		return $this->get(UserGlobalStoragesService::class);
2224
-	}
2225
-
2226
-	/**
2227
-	 * Not a public API as of 8.2, wait for 9.0
2228
-	 *
2229
-	 * @return \OCA\Files_External\Service\UserStoragesService
2230
-	 * @deprecated 20.0.0
2231
-	 */
2232
-	public function getUserStoragesService() {
2233
-		return $this->get(UserStoragesService::class);
2234
-	}
2235
-
2236
-	/**
2237
-	 * @return \OCP\Share\IManager
2238
-	 * @deprecated 20.0.0
2239
-	 */
2240
-	public function getShareManager() {
2241
-		return $this->get(\OCP\Share\IManager::class);
2242
-	}
2243
-
2244
-	/**
2245
-	 * @return \OCP\Collaboration\Collaborators\ISearch
2246
-	 * @deprecated 20.0.0
2247
-	 */
2248
-	public function getCollaboratorSearch() {
2249
-		return $this->get(\OCP\Collaboration\Collaborators\ISearch::class);
2250
-	}
2251
-
2252
-	/**
2253
-	 * @return \OCP\Collaboration\AutoComplete\IManager
2254
-	 * @deprecated 20.0.0
2255
-	 */
2256
-	public function getAutoCompleteManager() {
2257
-		return $this->get(IManager::class);
2258
-	}
2259
-
2260
-	/**
2261
-	 * Returns the LDAP Provider
2262
-	 *
2263
-	 * @return \OCP\LDAP\ILDAPProvider
2264
-	 * @deprecated 20.0.0
2265
-	 */
2266
-	public function getLDAPProvider() {
2267
-		return $this->get('LDAPProvider');
2268
-	}
2269
-
2270
-	/**
2271
-	 * @return \OCP\Settings\IManager
2272
-	 * @deprecated 20.0.0
2273
-	 */
2274
-	public function getSettingsManager() {
2275
-		return $this->get(\OC\Settings\Manager::class);
2276
-	}
2277
-
2278
-	/**
2279
-	 * @return \OCP\Files\IAppData
2280
-	 * @deprecated 20.0.0 Use get(\OCP\Files\AppData\IAppDataFactory::class)->get($app) instead
2281
-	 */
2282
-	public function getAppDataDir($app) {
2283
-		/** @var \OC\Files\AppData\Factory $factory */
2284
-		$factory = $this->get(\OC\Files\AppData\Factory::class);
2285
-		return $factory->get($app);
2286
-	}
2287
-
2288
-	/**
2289
-	 * @return \OCP\Lockdown\ILockdownManager
2290
-	 * @deprecated 20.0.0
2291
-	 */
2292
-	public function getLockdownManager() {
2293
-		return $this->get('LockdownManager');
2294
-	}
2295
-
2296
-	/**
2297
-	 * @return \OCP\Federation\ICloudIdManager
2298
-	 * @deprecated 20.0.0
2299
-	 */
2300
-	public function getCloudIdManager() {
2301
-		return $this->get(ICloudIdManager::class);
2302
-	}
2303
-
2304
-	/**
2305
-	 * @return \OCP\GlobalScale\IConfig
2306
-	 * @deprecated 20.0.0
2307
-	 */
2308
-	public function getGlobalScaleConfig() {
2309
-		return $this->get(IConfig::class);
2310
-	}
2311
-
2312
-	/**
2313
-	 * @return \OCP\Federation\ICloudFederationProviderManager
2314
-	 * @deprecated 20.0.0
2315
-	 */
2316
-	public function getCloudFederationProviderManager() {
2317
-		return $this->get(ICloudFederationProviderManager::class);
2318
-	}
2319
-
2320
-	/**
2321
-	 * @return \OCP\Remote\Api\IApiFactory
2322
-	 * @deprecated 20.0.0
2323
-	 */
2324
-	public function getRemoteApiFactory() {
2325
-		return $this->get(IApiFactory::class);
2326
-	}
2327
-
2328
-	/**
2329
-	 * @return \OCP\Federation\ICloudFederationFactory
2330
-	 * @deprecated 20.0.0
2331
-	 */
2332
-	public function getCloudFederationFactory() {
2333
-		return $this->get(ICloudFederationFactory::class);
2334
-	}
2335
-
2336
-	/**
2337
-	 * @return \OCP\Remote\IInstanceFactory
2338
-	 * @deprecated 20.0.0
2339
-	 */
2340
-	public function getRemoteInstanceFactory() {
2341
-		return $this->get(IInstanceFactory::class);
2342
-	}
2343
-
2344
-	/**
2345
-	 * @return IStorageFactory
2346
-	 * @deprecated 20.0.0
2347
-	 */
2348
-	public function getStorageFactory() {
2349
-		return $this->get(IStorageFactory::class);
2350
-	}
2351
-
2352
-	/**
2353
-	 * Get the Preview GeneratorHelper
2354
-	 *
2355
-	 * @return GeneratorHelper
2356
-	 * @since 17.0.0
2357
-	 * @deprecated 20.0.0
2358
-	 */
2359
-	public function getGeneratorHelper() {
2360
-		return $this->get(\OC\Preview\GeneratorHelper::class);
2361
-	}
2362
-
2363
-	private function registerDeprecatedAlias(string $alias, string $target) {
2364
-		$this->registerService($alias, function (ContainerInterface $container) use ($target, $alias) {
2365
-			try {
2366
-				/** @var LoggerInterface $logger */
2367
-				$logger = $container->get(LoggerInterface::class);
2368
-				$logger->debug('The requested alias "' . $alias . '" is deprecated. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']);
2369
-			} catch (ContainerExceptionInterface $e) {
2370
-				// Could not get logger. Continue
2371
-			}
2372
-
2373
-			return $container->get($target);
2374
-		}, false);
2375
-	}
284
+    /** @var string */
285
+    private $webRoot;
286
+
287
+    /**
288
+     * @param string $webRoot
289
+     * @param \OC\Config $config
290
+     */
291
+    public function __construct($webRoot, \OC\Config $config) {
292
+        parent::__construct();
293
+        $this->webRoot = $webRoot;
294
+
295
+        // To find out if we are running from CLI or not
296
+        $this->registerParameter('isCLI', \OC::$CLI);
297
+        $this->registerParameter('serverRoot', \OC::$SERVERROOT);
298
+
299
+        $this->registerService(ContainerInterface::class, function (ContainerInterface $c) {
300
+            return $c;
301
+        });
302
+        $this->registerService(\OCP\IServerContainer::class, function (ContainerInterface $c) {
303
+            return $c;
304
+        });
305
+
306
+        $this->registerAlias(\OCP\Calendar\IManager::class, \OC\Calendar\Manager::class);
307
+        /** @deprecated 19.0.0 */
308
+        $this->registerDeprecatedAlias('CalendarManager', \OC\Calendar\Manager::class);
309
+
310
+        $this->registerAlias(\OCP\Calendar\Resource\IManager::class, \OC\Calendar\Resource\Manager::class);
311
+        /** @deprecated 19.0.0 */
312
+        $this->registerDeprecatedAlias('CalendarResourceBackendManager', \OC\Calendar\Resource\Manager::class);
313
+
314
+        $this->registerAlias(\OCP\Calendar\Room\IManager::class, \OC\Calendar\Room\Manager::class);
315
+        /** @deprecated 19.0.0 */
316
+        $this->registerDeprecatedAlias('CalendarRoomBackendManager', \OC\Calendar\Room\Manager::class);
317
+
318
+        $this->registerAlias(\OCP\Contacts\IManager::class, \OC\ContactsManager::class);
319
+        /** @deprecated 19.0.0 */
320
+        $this->registerDeprecatedAlias('ContactsManager', \OCP\Contacts\IManager::class);
321
+
322
+        $this->registerAlias(\OCP\DirectEditing\IManager::class, \OC\DirectEditing\Manager::class);
323
+        $this->registerAlias(ITemplateManager::class, TemplateManager::class);
324
+
325
+        $this->registerAlias(IActionFactory::class, ActionFactory::class);
326
+
327
+        $this->registerService(View::class, function (Server $c) {
328
+            return new View();
329
+        }, false);
330
+
331
+        $this->registerService(IPreview::class, function (ContainerInterface $c) {
332
+            return new PreviewManager(
333
+                $c->get(\OCP\IConfig::class),
334
+                $c->get(IRootFolder::class),
335
+                new \OC\Preview\Storage\Root(
336
+                    $c->get(IRootFolder::class),
337
+                    $c->get(SystemConfig::class)
338
+                ),
339
+                $c->get(IEventDispatcher::class),
340
+                $c->get(SymfonyAdapter::class),
341
+                $c->get(GeneratorHelper::class),
342
+                $c->get(ISession::class)->get('user_id'),
343
+                $c->get(Coordinator::class),
344
+                $c->get(IServerContainer::class),
345
+                $c->get(IBinaryFinder::class),
346
+                $c->get(IMagickSupport::class)
347
+            );
348
+        });
349
+        /** @deprecated 19.0.0 */
350
+        $this->registerDeprecatedAlias('PreviewManager', IPreview::class);
351
+
352
+        $this->registerService(\OC\Preview\Watcher::class, function (ContainerInterface $c) {
353
+            return new \OC\Preview\Watcher(
354
+                new \OC\Preview\Storage\Root(
355
+                    $c->get(IRootFolder::class),
356
+                    $c->get(SystemConfig::class)
357
+                )
358
+            );
359
+        });
360
+
361
+        $this->registerService(IProfiler::class, function (Server $c) {
362
+            return new Profiler($c->get(SystemConfig::class));
363
+        });
364
+
365
+        $this->registerService(\OCP\Encryption\IManager::class, function (Server $c): Encryption\Manager {
366
+            $view = new View();
367
+            $util = new Encryption\Util(
368
+                $view,
369
+                $c->get(IUserManager::class),
370
+                $c->get(IGroupManager::class),
371
+                $c->get(\OCP\IConfig::class)
372
+            );
373
+            return new Encryption\Manager(
374
+                $c->get(\OCP\IConfig::class),
375
+                $c->get(LoggerInterface::class),
376
+                $c->getL10N('core'),
377
+                new View(),
378
+                $util,
379
+                new ArrayCache()
380
+            );
381
+        });
382
+        /** @deprecated 19.0.0 */
383
+        $this->registerDeprecatedAlias('EncryptionManager', \OCP\Encryption\IManager::class);
384
+
385
+        /** @deprecated 21.0.0 */
386
+        $this->registerDeprecatedAlias('EncryptionFileHelper', IFile::class);
387
+        $this->registerService(IFile::class, function (ContainerInterface $c) {
388
+            $util = new Encryption\Util(
389
+                new View(),
390
+                $c->get(IUserManager::class),
391
+                $c->get(IGroupManager::class),
392
+                $c->get(\OCP\IConfig::class)
393
+            );
394
+            return new Encryption\File(
395
+                $util,
396
+                $c->get(IRootFolder::class),
397
+                $c->get(\OCP\Share\IManager::class)
398
+            );
399
+        });
400
+
401
+        /** @deprecated 21.0.0 */
402
+        $this->registerDeprecatedAlias('EncryptionKeyStorage', IStorage::class);
403
+        $this->registerService(IStorage::class, function (ContainerInterface $c) {
404
+            $view = new View();
405
+            $util = new Encryption\Util(
406
+                $view,
407
+                $c->get(IUserManager::class),
408
+                $c->get(IGroupManager::class),
409
+                $c->get(\OCP\IConfig::class)
410
+            );
411
+
412
+            return new Encryption\Keys\Storage(
413
+                $view,
414
+                $util,
415
+                $c->get(ICrypto::class),
416
+                $c->get(\OCP\IConfig::class)
417
+            );
418
+        });
419
+        /** @deprecated 20.0.0 */
420
+        $this->registerDeprecatedAlias('TagMapper', TagMapper::class);
421
+
422
+        $this->registerAlias(\OCP\ITagManager::class, TagManager::class);
423
+        /** @deprecated 19.0.0 */
424
+        $this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class);
425
+
426
+        $this->registerService('SystemTagManagerFactory', function (ContainerInterface $c) {
427
+            /** @var \OCP\IConfig $config */
428
+            $config = $c->get(\OCP\IConfig::class);
429
+            $factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class);
430
+            return new $factoryClass($this);
431
+        });
432
+        $this->registerService(ISystemTagManager::class, function (ContainerInterface $c) {
433
+            return $c->get('SystemTagManagerFactory')->getManager();
434
+        });
435
+        /** @deprecated 19.0.0 */
436
+        $this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class);
437
+
438
+        $this->registerService(ISystemTagObjectMapper::class, function (ContainerInterface $c) {
439
+            return $c->get('SystemTagManagerFactory')->getObjectMapper();
440
+        });
441
+        $this->registerService('RootFolder', function (ContainerInterface $c) {
442
+            $manager = \OC\Files\Filesystem::getMountManager(null);
443
+            $view = new View();
444
+            $root = new Root(
445
+                $manager,
446
+                $view,
447
+                null,
448
+                $c->get(IUserMountCache::class),
449
+                $this->get(LoggerInterface::class),
450
+                $this->get(IUserManager::class),
451
+                $this->get(IEventDispatcher::class),
452
+            );
453
+
454
+            $previewConnector = new \OC\Preview\WatcherConnector(
455
+                $root,
456
+                $c->get(SystemConfig::class)
457
+            );
458
+            $previewConnector->connectWatcher();
459
+
460
+            return $root;
461
+        });
462
+        $this->registerService(HookConnector::class, function (ContainerInterface $c) {
463
+            return new HookConnector(
464
+                $c->get(IRootFolder::class),
465
+                new View(),
466
+                $c->get(\OC\EventDispatcher\SymfonyAdapter::class),
467
+                $c->get(IEventDispatcher::class)
468
+            );
469
+        });
470
+
471
+        /** @deprecated 19.0.0 */
472
+        $this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class);
473
+
474
+        $this->registerService(IRootFolder::class, function (ContainerInterface $c) {
475
+            return new LazyRoot(function () use ($c) {
476
+                return $c->get('RootFolder');
477
+            });
478
+        });
479
+        /** @deprecated 19.0.0 */
480
+        $this->registerDeprecatedAlias('LazyRootFolder', IRootFolder::class);
481
+
482
+        /** @deprecated 19.0.0 */
483
+        $this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class);
484
+        $this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class);
485
+
486
+        $this->registerService(DisplayNameCache::class, function (ContainerInterface $c) {
487
+            return $c->get(\OC\User\Manager::class)->getDisplayNameCache();
488
+        });
489
+
490
+        $this->registerService(\OCP\IGroupManager::class, function (ContainerInterface $c) {
491
+            $groupManager = new \OC\Group\Manager(
492
+                $this->get(IUserManager::class),
493
+                $c->get(SymfonyAdapter::class),
494
+                $this->get(LoggerInterface::class),
495
+                $this->get(ICacheFactory::class)
496
+            );
497
+            $groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
498
+                /** @var IEventDispatcher $dispatcher */
499
+                $dispatcher = $this->get(IEventDispatcher::class);
500
+                $dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid));
501
+            });
502
+            $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) {
503
+                /** @var IEventDispatcher $dispatcher */
504
+                $dispatcher = $this->get(IEventDispatcher::class);
505
+                $dispatcher->dispatchTyped(new GroupCreatedEvent($group));
506
+            });
507
+            $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
508
+                /** @var IEventDispatcher $dispatcher */
509
+                $dispatcher = $this->get(IEventDispatcher::class);
510
+                $dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group));
511
+            });
512
+            $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
513
+                /** @var IEventDispatcher $dispatcher */
514
+                $dispatcher = $this->get(IEventDispatcher::class);
515
+                $dispatcher->dispatchTyped(new GroupDeletedEvent($group));
516
+            });
517
+            $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
518
+                /** @var IEventDispatcher $dispatcher */
519
+                $dispatcher = $this->get(IEventDispatcher::class);
520
+                $dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user));
521
+            });
522
+            $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
523
+                /** @var IEventDispatcher $dispatcher */
524
+                $dispatcher = $this->get(IEventDispatcher::class);
525
+                $dispatcher->dispatchTyped(new UserAddedEvent($group, $user));
526
+            });
527
+            $groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
528
+                /** @var IEventDispatcher $dispatcher */
529
+                $dispatcher = $this->get(IEventDispatcher::class);
530
+                $dispatcher->dispatchTyped(new BeforeUserRemovedEvent($group, $user));
531
+            });
532
+            $groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
533
+                /** @var IEventDispatcher $dispatcher */
534
+                $dispatcher = $this->get(IEventDispatcher::class);
535
+                $dispatcher->dispatchTyped(new UserRemovedEvent($group, $user));
536
+            });
537
+            return $groupManager;
538
+        });
539
+        /** @deprecated 19.0.0 */
540
+        $this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class);
541
+
542
+        $this->registerService(Store::class, function (ContainerInterface $c) {
543
+            $session = $c->get(ISession::class);
544
+            if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) {
545
+                $tokenProvider = $c->get(IProvider::class);
546
+            } else {
547
+                $tokenProvider = null;
548
+            }
549
+            $logger = $c->get(LoggerInterface::class);
550
+            return new Store($session, $logger, $tokenProvider);
551
+        });
552
+        $this->registerAlias(IStore::class, Store::class);
553
+        $this->registerAlias(IProvider::class, Authentication\Token\Manager::class);
554
+        $this->registerAlias(OCPIProvider::class, Authentication\Token\Manager::class);
555
+
556
+        $this->registerService(\OC\User\Session::class, function (Server $c) {
557
+            $manager = $c->get(IUserManager::class);
558
+            $session = new \OC\Session\Memory('');
559
+            $timeFactory = new TimeFactory();
560
+            // Token providers might require a working database. This code
561
+            // might however be called when Nextcloud is not yet setup.
562
+            if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) {
563
+                $provider = $c->get(IProvider::class);
564
+            } else {
565
+                $provider = null;
566
+            }
567
+
568
+            $legacyDispatcher = $c->get(SymfonyAdapter::class);
569
+
570
+            $userSession = new \OC\User\Session(
571
+                $manager,
572
+                $session,
573
+                $timeFactory,
574
+                $provider,
575
+                $c->get(\OCP\IConfig::class),
576
+                $c->get(ISecureRandom::class),
577
+                $c->getLockdownManager(),
578
+                $c->get(LoggerInterface::class),
579
+                $c->get(IEventDispatcher::class)
580
+            );
581
+            /** @deprecated 21.0.0 use BeforeUserCreatedEvent event with the IEventDispatcher instead */
582
+            $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
583
+                \OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]);
584
+            });
585
+            /** @deprecated 21.0.0 use UserCreatedEvent event with the IEventDispatcher instead */
586
+            $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
587
+                /** @var \OC\User\User $user */
588
+                \OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]);
589
+            });
590
+            /** @deprecated 21.0.0 use BeforeUserDeletedEvent event with the IEventDispatcher instead */
591
+            $userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) {
592
+                /** @var \OC\User\User $user */
593
+                \OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]);
594
+                $legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user));
595
+            });
596
+            /** @deprecated 21.0.0 use UserDeletedEvent event with the IEventDispatcher instead */
597
+            $userSession->listen('\OC\User', 'postDelete', function ($user) {
598
+                /** @var \OC\User\User $user */
599
+                \OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]);
600
+            });
601
+            $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
602
+                /** @var \OC\User\User $user */
603
+                \OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
604
+
605
+                /** @var IEventDispatcher $dispatcher */
606
+                $dispatcher = $this->get(IEventDispatcher::class);
607
+                $dispatcher->dispatchTyped(new BeforePasswordUpdatedEvent($user, $password, $recoveryPassword));
608
+            });
609
+            $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
610
+                /** @var \OC\User\User $user */
611
+                \OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
612
+
613
+                /** @var IEventDispatcher $dispatcher */
614
+                $dispatcher = $this->get(IEventDispatcher::class);
615
+                $dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword));
616
+            });
617
+            $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
618
+                \OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]);
619
+
620
+                /** @var IEventDispatcher $dispatcher */
621
+                $dispatcher = $this->get(IEventDispatcher::class);
622
+                $dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password));
623
+            });
624
+            $userSession->listen('\OC\User', 'postLogin', function ($user, $loginName, $password, $isTokenLogin) {
625
+                /** @var \OC\User\User $user */
626
+                \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'loginName' => $loginName, 'password' => $password, 'isTokenLogin' => $isTokenLogin]);
627
+
628
+                /** @var IEventDispatcher $dispatcher */
629
+                $dispatcher = $this->get(IEventDispatcher::class);
630
+                $dispatcher->dispatchTyped(new UserLoggedInEvent($user, $loginName, $password, $isTokenLogin));
631
+            });
632
+            $userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) {
633
+                /** @var IEventDispatcher $dispatcher */
634
+                $dispatcher = $this->get(IEventDispatcher::class);
635
+                $dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid));
636
+            });
637
+            $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
638
+                /** @var \OC\User\User $user */
639
+                \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]);
640
+
641
+                /** @var IEventDispatcher $dispatcher */
642
+                $dispatcher = $this->get(IEventDispatcher::class);
643
+                $dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password));
644
+            });
645
+            $userSession->listen('\OC\User', 'logout', function ($user) {
646
+                \OC_Hook::emit('OC_User', 'logout', []);
647
+
648
+                /** @var IEventDispatcher $dispatcher */
649
+                $dispatcher = $this->get(IEventDispatcher::class);
650
+                $dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user));
651
+            });
652
+            $userSession->listen('\OC\User', 'postLogout', function ($user) {
653
+                /** @var IEventDispatcher $dispatcher */
654
+                $dispatcher = $this->get(IEventDispatcher::class);
655
+                $dispatcher->dispatchTyped(new UserLoggedOutEvent($user));
656
+            });
657
+            $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) {
658
+                /** @var \OC\User\User $user */
659
+                \OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]);
660
+
661
+                /** @var IEventDispatcher $dispatcher */
662
+                $dispatcher = $this->get(IEventDispatcher::class);
663
+                $dispatcher->dispatchTyped(new UserChangedEvent($user, $feature, $value, $oldValue));
664
+            });
665
+            return $userSession;
666
+        });
667
+        $this->registerAlias(\OCP\IUserSession::class, \OC\User\Session::class);
668
+        /** @deprecated 19.0.0 */
669
+        $this->registerDeprecatedAlias('UserSession', \OC\User\Session::class);
670
+
671
+        $this->registerAlias(\OCP\Authentication\TwoFactorAuth\IRegistry::class, \OC\Authentication\TwoFactorAuth\Registry::class);
672
+
673
+        $this->registerAlias(INavigationManager::class, \OC\NavigationManager::class);
674
+        /** @deprecated 19.0.0 */
675
+        $this->registerDeprecatedAlias('NavigationManager', INavigationManager::class);
676
+
677
+        /** @deprecated 19.0.0 */
678
+        $this->registerDeprecatedAlias('AllConfig', \OC\AllConfig::class);
679
+        $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class);
680
+
681
+        $this->registerService(\OC\SystemConfig::class, function ($c) use ($config) {
682
+            return new \OC\SystemConfig($config);
683
+        });
684
+        /** @deprecated 19.0.0 */
685
+        $this->registerDeprecatedAlias('SystemConfig', \OC\SystemConfig::class);
686
+
687
+        /** @deprecated 19.0.0 */
688
+        $this->registerDeprecatedAlias('AppConfig', \OC\AppConfig::class);
689
+        $this->registerAlias(IAppConfig::class, \OC\AppConfig::class);
690
+
691
+        $this->registerService(IFactory::class, function (Server $c) {
692
+            return new \OC\L10N\Factory(
693
+                $c->get(\OCP\IConfig::class),
694
+                $c->getRequest(),
695
+                $c->get(IUserSession::class),
696
+                $c->get(ICacheFactory::class),
697
+                \OC::$SERVERROOT
698
+            );
699
+        });
700
+        /** @deprecated 19.0.0 */
701
+        $this->registerDeprecatedAlias('L10NFactory', IFactory::class);
702
+
703
+        $this->registerAlias(IURLGenerator::class, URLGenerator::class);
704
+        /** @deprecated 19.0.0 */
705
+        $this->registerDeprecatedAlias('URLGenerator', IURLGenerator::class);
706
+
707
+        /** @deprecated 19.0.0 */
708
+        $this->registerDeprecatedAlias('AppFetcher', AppFetcher::class);
709
+        /** @deprecated 19.0.0 */
710
+        $this->registerDeprecatedAlias('CategoryFetcher', CategoryFetcher::class);
711
+
712
+        $this->registerService(ICache::class, function ($c) {
713
+            return new Cache\File();
714
+        });
715
+        /** @deprecated 19.0.0 */
716
+        $this->registerDeprecatedAlias('UserCache', ICache::class);
717
+
718
+        $this->registerService(Factory::class, function (Server $c) {
719
+            $profiler = $c->get(IProfiler::class);
720
+            $arrayCacheFactory = new \OC\Memcache\Factory('', $c->get(LoggerInterface::class),
721
+                $profiler,
722
+                ArrayCache::class,
723
+                ArrayCache::class,
724
+                ArrayCache::class
725
+            );
726
+            /** @var \OCP\IConfig $config */
727
+            $config = $c->get(\OCP\IConfig::class);
728
+
729
+            if ($config->getSystemValue('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
730
+                if (!$config->getSystemValueBool('log_query')) {
731
+                    $v = \OC_App::getAppVersions();
732
+                } else {
733
+                    // If the log_query is enabled, we can not get the app versions
734
+                    // as that does a query, which will be logged and the logging
735
+                    // depends on redis and here we are back again in the same function.
736
+                    $v = [
737
+                        'log_query' => 'enabled',
738
+                    ];
739
+                }
740
+                $v['core'] = implode(',', \OC_Util::getVersion());
741
+                $version = implode(',', $v);
742
+                $instanceId = \OC_Util::getInstanceId();
743
+                $path = \OC::$SERVERROOT;
744
+                $prefix = md5($instanceId . '-' . $version . '-' . $path);
745
+                return new \OC\Memcache\Factory($prefix,
746
+                    $c->get(LoggerInterface::class),
747
+                    $profiler,
748
+                    $config->getSystemValue('memcache.local', null),
749
+                    $config->getSystemValue('memcache.distributed', null),
750
+                    $config->getSystemValue('memcache.locking', null),
751
+                    $config->getSystemValueString('redis_log_file')
752
+                );
753
+            }
754
+            return $arrayCacheFactory;
755
+        });
756
+        /** @deprecated 19.0.0 */
757
+        $this->registerDeprecatedAlias('MemCacheFactory', Factory::class);
758
+        $this->registerAlias(ICacheFactory::class, Factory::class);
759
+
760
+        $this->registerService('RedisFactory', function (Server $c) {
761
+            $systemConfig = $c->get(SystemConfig::class);
762
+            return new RedisFactory($systemConfig, $c->getEventLogger());
763
+        });
764
+
765
+        $this->registerService(\OCP\Activity\IManager::class, function (Server $c) {
766
+            $l10n = $this->get(IFactory::class)->get('lib');
767
+            return new \OC\Activity\Manager(
768
+                $c->getRequest(),
769
+                $c->get(IUserSession::class),
770
+                $c->get(\OCP\IConfig::class),
771
+                $c->get(IValidator::class),
772
+                $l10n
773
+            );
774
+        });
775
+        /** @deprecated 19.0.0 */
776
+        $this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class);
777
+
778
+        $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
779
+            return new \OC\Activity\EventMerger(
780
+                $c->getL10N('lib')
781
+            );
782
+        });
783
+        $this->registerAlias(IValidator::class, Validator::class);
784
+
785
+        $this->registerService(AvatarManager::class, function (Server $c) {
786
+            return new AvatarManager(
787
+                $c->get(IUserSession::class),
788
+                $c->get(\OC\User\Manager::class),
789
+                $c->getAppDataDir('avatar'),
790
+                $c->getL10N('lib'),
791
+                $c->get(LoggerInterface::class),
792
+                $c->get(\OCP\IConfig::class),
793
+                $c->get(IAccountManager::class),
794
+                $c->get(KnownUserService::class)
795
+            );
796
+        });
797
+
798
+        $this->registerAlias(IAvatarManager::class, AvatarManager::class);
799
+        /** @deprecated 19.0.0 */
800
+        $this->registerDeprecatedAlias('AvatarManager', AvatarManager::class);
801
+
802
+        $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class);
803
+        $this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class);
804
+        $this->registerAlias(\OCP\Support\Subscription\IAssertion::class, \OC\Support\Subscription\Assertion::class);
805
+
806
+        $this->registerService(\OC\Log::class, function (Server $c) {
807
+            $logType = $c->get(AllConfig::class)->getSystemValue('log_type', 'file');
808
+            $factory = new LogFactory($c, $this->get(SystemConfig::class));
809
+            $logger = $factory->get($logType);
810
+            $registry = $c->get(\OCP\Support\CrashReport\IRegistry::class);
811
+
812
+            return new Log($logger, $this->get(SystemConfig::class), null, $registry);
813
+        });
814
+        $this->registerAlias(ILogger::class, \OC\Log::class);
815
+        /** @deprecated 19.0.0 */
816
+        $this->registerDeprecatedAlias('Logger', \OC\Log::class);
817
+        // PSR-3 logger
818
+        $this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class);
819
+
820
+        $this->registerService(ILogFactory::class, function (Server $c) {
821
+            return new LogFactory($c, $this->get(SystemConfig::class));
822
+        });
823
+
824
+        $this->registerAlias(IJobList::class, \OC\BackgroundJob\JobList::class);
825
+        /** @deprecated 19.0.0 */
826
+        $this->registerDeprecatedAlias('JobList', IJobList::class);
827
+
828
+        $this->registerService(Router::class, function (Server $c) {
829
+            $cacheFactory = $c->get(ICacheFactory::class);
830
+            if ($cacheFactory->isLocalCacheAvailable()) {
831
+                $router = $c->resolve(CachingRouter::class);
832
+            } else {
833
+                $router = $c->resolve(Router::class);
834
+            }
835
+            return $router;
836
+        });
837
+        $this->registerAlias(IRouter::class, Router::class);
838
+        /** @deprecated 19.0.0 */
839
+        $this->registerDeprecatedAlias('Router', IRouter::class);
840
+
841
+        $this->registerAlias(ISearch::class, Search::class);
842
+        /** @deprecated 19.0.0 */
843
+        $this->registerDeprecatedAlias('Search', ISearch::class);
844
+
845
+        $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) {
846
+            $cacheFactory = $c->get(ICacheFactory::class);
847
+            if ($cacheFactory->isAvailable()) {
848
+                $backend = new \OC\Security\RateLimiting\Backend\MemoryCacheBackend(
849
+                    $this->get(ICacheFactory::class),
850
+                    new \OC\AppFramework\Utility\TimeFactory()
851
+                );
852
+            } else {
853
+                $backend = new \OC\Security\RateLimiting\Backend\DatabaseBackend(
854
+                    $c->get(IDBConnection::class),
855
+                    new \OC\AppFramework\Utility\TimeFactory()
856
+                );
857
+            }
858
+
859
+            return $backend;
860
+        });
861
+
862
+        $this->registerAlias(\OCP\Security\ISecureRandom::class, SecureRandom::class);
863
+        /** @deprecated 19.0.0 */
864
+        $this->registerDeprecatedAlias('SecureRandom', \OCP\Security\ISecureRandom::class);
865
+        $this->registerAlias(\OCP\Security\IRemoteHostValidator::class, \OC\Security\RemoteHostValidator::class);
866
+        $this->registerAlias(IVerificationToken::class, VerificationToken::class);
867
+
868
+        $this->registerAlias(ICrypto::class, Crypto::class);
869
+        /** @deprecated 19.0.0 */
870
+        $this->registerDeprecatedAlias('Crypto', ICrypto::class);
871
+
872
+        $this->registerAlias(IHasher::class, Hasher::class);
873
+        /** @deprecated 19.0.0 */
874
+        $this->registerDeprecatedAlias('Hasher', IHasher::class);
875
+
876
+        $this->registerAlias(ICredentialsManager::class, CredentialsManager::class);
877
+        /** @deprecated 19.0.0 */
878
+        $this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class);
879
+
880
+        $this->registerAlias(IDBConnection::class, ConnectionAdapter::class);
881
+        $this->registerService(Connection::class, function (Server $c) {
882
+            $systemConfig = $c->get(SystemConfig::class);
883
+            $factory = new \OC\DB\ConnectionFactory($systemConfig);
884
+            $type = $systemConfig->getValue('dbtype', 'sqlite');
885
+            if (!$factory->isValidType($type)) {
886
+                throw new \OC\DatabaseException('Invalid database type');
887
+            }
888
+            $connectionParams = $factory->createConnectionParams();
889
+            $connection = $factory->getConnection($type, $connectionParams);
890
+            return $connection;
891
+        });
892
+        /** @deprecated 19.0.0 */
893
+        $this->registerDeprecatedAlias('DatabaseConnection', IDBConnection::class);
894
+
895
+        $this->registerAlias(ICertificateManager::class, CertificateManager::class);
896
+        $this->registerAlias(IClientService::class, ClientService::class);
897
+        $this->registerService(NegativeDnsCache::class, function (ContainerInterface $c) {
898
+            return new NegativeDnsCache(
899
+                $c->get(ICacheFactory::class),
900
+            );
901
+        });
902
+        $this->registerDeprecatedAlias('HttpClientService', IClientService::class);
903
+        $this->registerService(IEventLogger::class, function (ContainerInterface $c) {
904
+            return new EventLogger($c->get(SystemConfig::class), $c->get(LoggerInterface::class), $c->get(Log::class));
905
+        });
906
+        /** @deprecated 19.0.0 */
907
+        $this->registerDeprecatedAlias('EventLogger', IEventLogger::class);
908
+
909
+        $this->registerService(IQueryLogger::class, function (ContainerInterface $c) {
910
+            $queryLogger = new QueryLogger();
911
+            if ($c->get(SystemConfig::class)->getValue('debug', false)) {
912
+                // In debug mode, module is being activated by default
913
+                $queryLogger->activate();
914
+            }
915
+            return $queryLogger;
916
+        });
917
+        /** @deprecated 19.0.0 */
918
+        $this->registerDeprecatedAlias('QueryLogger', IQueryLogger::class);
919
+
920
+        /** @deprecated 19.0.0 */
921
+        $this->registerDeprecatedAlias('TempManager', TempManager::class);
922
+        $this->registerAlias(ITempManager::class, TempManager::class);
923
+
924
+        $this->registerService(AppManager::class, function (ContainerInterface $c) {
925
+            // TODO: use auto-wiring
926
+            return new \OC\App\AppManager(
927
+                $c->get(IUserSession::class),
928
+                $c->get(\OCP\IConfig::class),
929
+                $c->get(\OC\AppConfig::class),
930
+                $c->get(IGroupManager::class),
931
+                $c->get(ICacheFactory::class),
932
+                $c->get(SymfonyAdapter::class),
933
+                $c->get(IEventDispatcher::class),
934
+                $c->get(LoggerInterface::class)
935
+            );
936
+        });
937
+        /** @deprecated 19.0.0 */
938
+        $this->registerDeprecatedAlias('AppManager', AppManager::class);
939
+        $this->registerAlias(IAppManager::class, AppManager::class);
940
+
941
+        $this->registerAlias(IDateTimeZone::class, DateTimeZone::class);
942
+        /** @deprecated 19.0.0 */
943
+        $this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class);
944
+
945
+        $this->registerService(IDateTimeFormatter::class, function (Server $c) {
946
+            $language = $c->get(\OCP\IConfig::class)->getUserValue($c->get(ISession::class)->get('user_id'), 'core', 'lang', null);
947
+
948
+            return new DateTimeFormatter(
949
+                $c->get(IDateTimeZone::class)->getTimeZone(),
950
+                $c->getL10N('lib', $language)
951
+            );
952
+        });
953
+        /** @deprecated 19.0.0 */
954
+        $this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class);
955
+
956
+        $this->registerService(IUserMountCache::class, function (ContainerInterface $c) {
957
+            $mountCache = $c->get(UserMountCache::class);
958
+            $listener = new UserMountCacheListener($mountCache);
959
+            $listener->listen($c->get(IUserManager::class));
960
+            return $mountCache;
961
+        });
962
+        /** @deprecated 19.0.0 */
963
+        $this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class);
964
+
965
+        $this->registerService(IMountProviderCollection::class, function (ContainerInterface $c) {
966
+            $loader = $c->get(IStorageFactory::class);
967
+            $mountCache = $c->get(IUserMountCache::class);
968
+            $eventLogger = $c->get(IEventLogger::class);
969
+            $manager = new MountProviderCollection($loader, $mountCache, $eventLogger);
970
+
971
+            // builtin providers
972
+
973
+            $config = $c->get(\OCP\IConfig::class);
974
+            $logger = $c->get(LoggerInterface::class);
975
+            $manager->registerProvider(new CacheMountProvider($config));
976
+            $manager->registerHomeProvider(new LocalHomeMountProvider());
977
+            $manager->registerHomeProvider(new ObjectHomeMountProvider($config));
978
+            $manager->registerRootProvider(new RootMountProvider($config, $c->get(LoggerInterface::class)));
979
+            $manager->registerRootProvider(new ObjectStorePreviewCacheMountProvider($logger, $config));
980
+
981
+            return $manager;
982
+        });
983
+        /** @deprecated 19.0.0 */
984
+        $this->registerDeprecatedAlias('MountConfigManager', IMountProviderCollection::class);
985
+
986
+        /** @deprecated 20.0.0 */
987
+        $this->registerDeprecatedAlias('IniWrapper', IniGetWrapper::class);
988
+        $this->registerService(IBus::class, function (ContainerInterface $c) {
989
+            $busClass = $c->get(\OCP\IConfig::class)->getSystemValue('commandbus');
990
+            if ($busClass) {
991
+                [$app, $class] = explode('::', $busClass, 2);
992
+                if ($c->get(IAppManager::class)->isInstalled($app)) {
993
+                    \OC_App::loadApp($app);
994
+                    return $c->get($class);
995
+                } else {
996
+                    throw new ServiceUnavailableException("The app providing the command bus ($app) is not enabled");
997
+                }
998
+            } else {
999
+                $jobList = $c->get(IJobList::class);
1000
+                return new CronBus($jobList);
1001
+            }
1002
+        });
1003
+        $this->registerDeprecatedAlias('AsyncCommandBus', IBus::class);
1004
+        /** @deprecated 20.0.0 */
1005
+        $this->registerDeprecatedAlias('TrustedDomainHelper', TrustedDomainHelper::class);
1006
+        $this->registerAlias(ITrustedDomainHelper::class, TrustedDomainHelper::class);
1007
+        /** @deprecated 19.0.0 */
1008
+        $this->registerDeprecatedAlias('Throttler', Throttler::class);
1009
+        $this->registerAlias(IThrottler::class, Throttler::class);
1010
+        $this->registerService('IntegrityCodeChecker', function (ContainerInterface $c) {
1011
+            // IConfig and IAppManager requires a working database. This code
1012
+            // might however be called when ownCloud is not yet setup.
1013
+            if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) {
1014
+                $config = $c->get(\OCP\IConfig::class);
1015
+                $appManager = $c->get(IAppManager::class);
1016
+            } else {
1017
+                $config = null;
1018
+                $appManager = null;
1019
+            }
1020
+
1021
+            return new Checker(
1022
+                new EnvironmentHelper(),
1023
+                new FileAccessHelper(),
1024
+                new AppLocator(),
1025
+                $config,
1026
+                $c->get(ICacheFactory::class),
1027
+                $appManager,
1028
+                $c->get(IMimeTypeDetector::class)
1029
+            );
1030
+        });
1031
+        $this->registerService(\OCP\IRequest::class, function (ContainerInterface $c) {
1032
+            if (isset($this['urlParams'])) {
1033
+                $urlParams = $this['urlParams'];
1034
+            } else {
1035
+                $urlParams = [];
1036
+            }
1037
+
1038
+            if (defined('PHPUNIT_RUN') && PHPUNIT_RUN
1039
+                && in_array('fakeinput', stream_get_wrappers())
1040
+            ) {
1041
+                $stream = 'fakeinput://data';
1042
+            } else {
1043
+                $stream = 'php://input';
1044
+            }
1045
+
1046
+            return new Request(
1047
+                [
1048
+                    'get' => $_GET,
1049
+                    'post' => $_POST,
1050
+                    'files' => $_FILES,
1051
+                    'server' => $_SERVER,
1052
+                    'env' => $_ENV,
1053
+                    'cookies' => $_COOKIE,
1054
+                    'method' => (isset($_SERVER) && isset($_SERVER['REQUEST_METHOD']))
1055
+                        ? $_SERVER['REQUEST_METHOD']
1056
+                        : '',
1057
+                    'urlParams' => $urlParams,
1058
+                ],
1059
+                $this->get(IRequestId::class),
1060
+                $this->get(\OCP\IConfig::class),
1061
+                $this->get(CsrfTokenManager::class),
1062
+                $stream
1063
+            );
1064
+        });
1065
+        /** @deprecated 19.0.0 */
1066
+        $this->registerDeprecatedAlias('Request', \OCP\IRequest::class);
1067
+
1068
+        $this->registerService(IRequestId::class, function (ContainerInterface $c): IRequestId {
1069
+            return new RequestId(
1070
+                $_SERVER['UNIQUE_ID'] ?? '',
1071
+                $this->get(ISecureRandom::class)
1072
+            );
1073
+        });
1074
+
1075
+        $this->registerService(IMailer::class, function (Server $c) {
1076
+            return new Mailer(
1077
+                $c->get(\OCP\IConfig::class),
1078
+                $c->get(LoggerInterface::class),
1079
+                $c->get(Defaults::class),
1080
+                $c->get(IURLGenerator::class),
1081
+                $c->getL10N('lib'),
1082
+                $c->get(IEventDispatcher::class),
1083
+                $c->get(IFactory::class)
1084
+            );
1085
+        });
1086
+        /** @deprecated 19.0.0 */
1087
+        $this->registerDeprecatedAlias('Mailer', IMailer::class);
1088
+
1089
+        /** @deprecated 21.0.0 */
1090
+        $this->registerDeprecatedAlias('LDAPProvider', ILDAPProvider::class);
1091
+
1092
+        $this->registerService(ILDAPProviderFactory::class, function (ContainerInterface $c) {
1093
+            $config = $c->get(\OCP\IConfig::class);
1094
+            $factoryClass = $config->getSystemValue('ldapProviderFactory', null);
1095
+            if (is_null($factoryClass) || !class_exists($factoryClass)) {
1096
+                return new NullLDAPProviderFactory($this);
1097
+            }
1098
+            /** @var \OCP\LDAP\ILDAPProviderFactory $factory */
1099
+            return new $factoryClass($this);
1100
+        });
1101
+        $this->registerService(ILDAPProvider::class, function (ContainerInterface $c) {
1102
+            $factory = $c->get(ILDAPProviderFactory::class);
1103
+            return $factory->getLDAPProvider();
1104
+        });
1105
+        $this->registerService(ILockingProvider::class, function (ContainerInterface $c) {
1106
+            $ini = $c->get(IniGetWrapper::class);
1107
+            $config = $c->get(\OCP\IConfig::class);
1108
+            $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
1109
+            if ($config->getSystemValue('filelocking.enabled', true) or (defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
1110
+                /** @var \OC\Memcache\Factory $memcacheFactory */
1111
+                $memcacheFactory = $c->get(ICacheFactory::class);
1112
+                $memcache = $memcacheFactory->createLocking('lock');
1113
+                if (!($memcache instanceof \OC\Memcache\NullCache)) {
1114
+                    return new MemcacheLockingProvider($memcache, $ttl);
1115
+                }
1116
+                return new DBLockingProvider(
1117
+                    $c->get(IDBConnection::class),
1118
+                    new TimeFactory(),
1119
+                    $ttl,
1120
+                    !\OC::$CLI
1121
+                );
1122
+            }
1123
+            return new NoopLockingProvider();
1124
+        });
1125
+        /** @deprecated 19.0.0 */
1126
+        $this->registerDeprecatedAlias('LockingProvider', ILockingProvider::class);
1127
+
1128
+        $this->registerService(ILockManager::class, function (Server $c): LockManager {
1129
+            return new LockManager();
1130
+        });
1131
+
1132
+        $this->registerAlias(ILockdownManager::class, 'LockdownManager');
1133
+        $this->registerService(SetupManager::class, function ($c) {
1134
+            // create the setupmanager through the mount manager to resolve the cyclic dependency
1135
+            return $c->get(\OC\Files\Mount\Manager::class)->getSetupManager();
1136
+        });
1137
+        $this->registerAlias(IMountManager::class, \OC\Files\Mount\Manager::class);
1138
+        /** @deprecated 19.0.0 */
1139
+        $this->registerDeprecatedAlias('MountManager', IMountManager::class);
1140
+
1141
+        $this->registerService(IMimeTypeDetector::class, function (ContainerInterface $c) {
1142
+            return new \OC\Files\Type\Detection(
1143
+                $c->get(IURLGenerator::class),
1144
+                $c->get(LoggerInterface::class),
1145
+                \OC::$configDir,
1146
+                \OC::$SERVERROOT . '/resources/config/'
1147
+            );
1148
+        });
1149
+        /** @deprecated 19.0.0 */
1150
+        $this->registerDeprecatedAlias('MimeTypeDetector', IMimeTypeDetector::class);
1151
+
1152
+        $this->registerAlias(IMimeTypeLoader::class, Loader::class);
1153
+        /** @deprecated 19.0.0 */
1154
+        $this->registerDeprecatedAlias('MimeTypeLoader', IMimeTypeLoader::class);
1155
+        $this->registerService(BundleFetcher::class, function () {
1156
+            return new BundleFetcher($this->getL10N('lib'));
1157
+        });
1158
+        $this->registerAlias(\OCP\Notification\IManager::class, Manager::class);
1159
+        /** @deprecated 19.0.0 */
1160
+        $this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class);
1161
+
1162
+        $this->registerService(CapabilitiesManager::class, function (ContainerInterface $c) {
1163
+            $manager = new CapabilitiesManager($c->get(LoggerInterface::class));
1164
+            $manager->registerCapability(function () use ($c) {
1165
+                return new \OC\OCS\CoreCapabilities($c->get(\OCP\IConfig::class));
1166
+            });
1167
+            $manager->registerCapability(function () use ($c) {
1168
+                return $c->get(\OC\Security\Bruteforce\Capabilities::class);
1169
+            });
1170
+            $manager->registerCapability(function () use ($c) {
1171
+                return $c->get(MetadataCapabilities::class);
1172
+            });
1173
+            return $manager;
1174
+        });
1175
+        /** @deprecated 19.0.0 */
1176
+        $this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class);
1177
+
1178
+        $this->registerService(ICommentsManager::class, function (Server $c) {
1179
+            $config = $c->get(\OCP\IConfig::class);
1180
+            $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class);
1181
+            /** @var \OCP\Comments\ICommentsManagerFactory $factory */
1182
+            $factory = new $factoryClass($this);
1183
+            $manager = $factory->getManager();
1184
+
1185
+            $manager->registerDisplayNameResolver('user', function ($id) use ($c) {
1186
+                $manager = $c->get(IUserManager::class);
1187
+                $userDisplayName = $manager->getDisplayName($id);
1188
+                if ($userDisplayName === null) {
1189
+                    $l = $c->get(IFactory::class)->get('core');
1190
+                    return $l->t('Unknown user');
1191
+                }
1192
+                return $userDisplayName;
1193
+            });
1194
+
1195
+            return $manager;
1196
+        });
1197
+        /** @deprecated 19.0.0 */
1198
+        $this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class);
1199
+
1200
+        $this->registerAlias(\OC_Defaults::class, 'ThemingDefaults');
1201
+        $this->registerService('ThemingDefaults', function (Server $c) {
1202
+            try {
1203
+                $classExists = class_exists('OCA\Theming\ThemingDefaults');
1204
+            } catch (\OCP\AutoloadNotAllowedException $e) {
1205
+                // App disabled or in maintenance mode
1206
+                $classExists = false;
1207
+            }
1208
+
1209
+            if ($classExists && $c->get(\OCP\IConfig::class)->getSystemValue('installed', false) && $c->get(IAppManager::class)->isInstalled('theming') && $c->getTrustedDomainHelper()->isTrustedDomain($c->getRequest()->getInsecureServerHost())) {
1210
+                $imageManager = new ImageManager(
1211
+                    $c->get(\OCP\IConfig::class),
1212
+                    $c->getAppDataDir('theming'),
1213
+                    $c->get(IURLGenerator::class),
1214
+                    $this->get(ICacheFactory::class),
1215
+                    $this->get(ILogger::class),
1216
+                    $this->get(ITempManager::class)
1217
+                );
1218
+                return new ThemingDefaults(
1219
+                    $c->get(\OCP\IConfig::class),
1220
+                    $c->getL10N('theming'),
1221
+                    $c->get(IUserSession::class),
1222
+                    $c->get(IURLGenerator::class),
1223
+                    $c->get(ICacheFactory::class),
1224
+                    new Util($c->get(\OCP\IConfig::class), $this->get(IAppManager::class), $c->getAppDataDir('theming'), $imageManager),
1225
+                    $imageManager,
1226
+                    $c->get(IAppManager::class),
1227
+                    $c->get(INavigationManager::class)
1228
+                );
1229
+            }
1230
+            return new \OC_Defaults();
1231
+        });
1232
+        $this->registerService(JSCombiner::class, function (Server $c) {
1233
+            return new JSCombiner(
1234
+                $c->getAppDataDir('js'),
1235
+                $c->get(IURLGenerator::class),
1236
+                $this->get(ICacheFactory::class),
1237
+                $c->get(SystemConfig::class),
1238
+                $c->get(LoggerInterface::class)
1239
+            );
1240
+        });
1241
+        $this->registerAlias(\OCP\EventDispatcher\IEventDispatcher::class, \OC\EventDispatcher\EventDispatcher::class);
1242
+        /** @deprecated 19.0.0 */
1243
+        $this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class);
1244
+        $this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class);
1245
+
1246
+        $this->registerService('CryptoWrapper', function (ContainerInterface $c) {
1247
+            // FIXME: Instantiated here due to cyclic dependency
1248
+            $request = new Request(
1249
+                [
1250
+                    'get' => $_GET,
1251
+                    'post' => $_POST,
1252
+                    'files' => $_FILES,
1253
+                    'server' => $_SERVER,
1254
+                    'env' => $_ENV,
1255
+                    'cookies' => $_COOKIE,
1256
+                    'method' => (isset($_SERVER) && isset($_SERVER['REQUEST_METHOD']))
1257
+                        ? $_SERVER['REQUEST_METHOD']
1258
+                        : null,
1259
+                ],
1260
+                $c->get(IRequestId::class),
1261
+                $c->get(\OCP\IConfig::class)
1262
+            );
1263
+
1264
+            return new CryptoWrapper(
1265
+                $c->get(\OCP\IConfig::class),
1266
+                $c->get(ICrypto::class),
1267
+                $c->get(ISecureRandom::class),
1268
+                $request
1269
+            );
1270
+        });
1271
+        /** @deprecated 19.0.0 */
1272
+        $this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class);
1273
+        $this->registerService(SessionStorage::class, function (ContainerInterface $c) {
1274
+            return new SessionStorage($c->get(ISession::class));
1275
+        });
1276
+        $this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class);
1277
+        /** @deprecated 19.0.0 */
1278
+        $this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class);
1279
+
1280
+        $this->registerService(\OCP\Share\IManager::class, function (IServerContainer $c) {
1281
+            $config = $c->get(\OCP\IConfig::class);
1282
+            $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class);
1283
+            /** @var \OCP\Share\IProviderFactory $factory */
1284
+            $factory = new $factoryClass($this);
1285
+
1286
+            $manager = new \OC\Share20\Manager(
1287
+                $c->get(LoggerInterface::class),
1288
+                $c->get(\OCP\IConfig::class),
1289
+                $c->get(ISecureRandom::class),
1290
+                $c->get(IHasher::class),
1291
+                $c->get(IMountManager::class),
1292
+                $c->get(IGroupManager::class),
1293
+                $c->getL10N('lib'),
1294
+                $c->get(IFactory::class),
1295
+                $factory,
1296
+                $c->get(IUserManager::class),
1297
+                $c->get(IRootFolder::class),
1298
+                $c->get(SymfonyAdapter::class),
1299
+                $c->get(IMailer::class),
1300
+                $c->get(IURLGenerator::class),
1301
+                $c->get('ThemingDefaults'),
1302
+                $c->get(IEventDispatcher::class),
1303
+                $c->get(IUserSession::class),
1304
+                $c->get(KnownUserService::class)
1305
+            );
1306
+
1307
+            return $manager;
1308
+        });
1309
+        /** @deprecated 19.0.0 */
1310
+        $this->registerDeprecatedAlias('ShareManager', \OCP\Share\IManager::class);
1311
+
1312
+        $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) {
1313
+            $instance = new Collaboration\Collaborators\Search($c);
1314
+
1315
+            // register default plugins
1316
+            $instance->registerPlugin(['shareType' => 'SHARE_TYPE_USER', 'class' => UserPlugin::class]);
1317
+            $instance->registerPlugin(['shareType' => 'SHARE_TYPE_GROUP', 'class' => GroupPlugin::class]);
1318
+            $instance->registerPlugin(['shareType' => 'SHARE_TYPE_EMAIL', 'class' => MailPlugin::class]);
1319
+            $instance->registerPlugin(['shareType' => 'SHARE_TYPE_REMOTE', 'class' => RemotePlugin::class]);
1320
+            $instance->registerPlugin(['shareType' => 'SHARE_TYPE_REMOTE_GROUP', 'class' => RemoteGroupPlugin::class]);
1321
+
1322
+            return $instance;
1323
+        });
1324
+        /** @deprecated 19.0.0 */
1325
+        $this->registerDeprecatedAlias('CollaboratorSearch', \OCP\Collaboration\Collaborators\ISearch::class);
1326
+        $this->registerAlias(\OCP\Collaboration\Collaborators\ISearchResult::class, \OC\Collaboration\Collaborators\SearchResult::class);
1327
+
1328
+        $this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class);
1329
+
1330
+        $this->registerAlias(\OCP\Collaboration\Resources\IProviderManager::class, \OC\Collaboration\Resources\ProviderManager::class);
1331
+        $this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\Manager::class);
1332
+
1333
+        $this->registerAlias(IReferenceManager::class, ReferenceManager::class);
1334
+
1335
+        $this->registerDeprecatedAlias('SettingsManager', \OC\Settings\Manager::class);
1336
+        $this->registerAlias(\OCP\Settings\IManager::class, \OC\Settings\Manager::class);
1337
+        $this->registerService(\OC\Files\AppData\Factory::class, function (ContainerInterface $c) {
1338
+            return new \OC\Files\AppData\Factory(
1339
+                $c->get(IRootFolder::class),
1340
+                $c->get(SystemConfig::class)
1341
+            );
1342
+        });
1343
+
1344
+        $this->registerService('LockdownManager', function (ContainerInterface $c) {
1345
+            return new LockdownManager(function () use ($c) {
1346
+                return $c->get(ISession::class);
1347
+            });
1348
+        });
1349
+
1350
+        $this->registerService(\OCP\OCS\IDiscoveryService::class, function (ContainerInterface $c) {
1351
+            return new DiscoveryService(
1352
+                $c->get(ICacheFactory::class),
1353
+                $c->get(IClientService::class)
1354
+            );
1355
+        });
1356
+
1357
+        $this->registerService(ICloudIdManager::class, function (ContainerInterface $c) {
1358
+            return new CloudIdManager(
1359
+                $c->get(\OCP\Contacts\IManager::class),
1360
+                $c->get(IURLGenerator::class),
1361
+                $c->get(IUserManager::class),
1362
+                $c->get(ICacheFactory::class),
1363
+                $c->get(IEventDispatcher::class),
1364
+            );
1365
+        });
1366
+
1367
+        $this->registerAlias(\OCP\GlobalScale\IConfig::class, \OC\GlobalScale\Config::class);
1368
+
1369
+        $this->registerService(ICloudFederationProviderManager::class, function (ContainerInterface $c) {
1370
+            return new CloudFederationProviderManager(
1371
+                $c->get(IAppManager::class),
1372
+                $c->get(IClientService::class),
1373
+                $c->get(ICloudIdManager::class),
1374
+                $c->get(LoggerInterface::class)
1375
+            );
1376
+        });
1377
+
1378
+        $this->registerService(ICloudFederationFactory::class, function (Server $c) {
1379
+            return new CloudFederationFactory();
1380
+        });
1381
+
1382
+        $this->registerAlias(\OCP\AppFramework\Utility\IControllerMethodReflector::class, \OC\AppFramework\Utility\ControllerMethodReflector::class);
1383
+        /** @deprecated 19.0.0 */
1384
+        $this->registerDeprecatedAlias('ControllerMethodReflector', \OCP\AppFramework\Utility\IControllerMethodReflector::class);
1385
+
1386
+        $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class);
1387
+        $this->registerAlias(\Psr\Clock\ClockInterface::class, \OCP\AppFramework\Utility\ITimeFactory::class);
1388
+        /** @deprecated 19.0.0 */
1389
+        $this->registerDeprecatedAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class);
1390
+
1391
+        $this->registerService(Defaults::class, function (Server $c) {
1392
+            return new Defaults(
1393
+                $c->getThemingDefaults()
1394
+            );
1395
+        });
1396
+        /** @deprecated 19.0.0 */
1397
+        $this->registerDeprecatedAlias('Defaults', \OCP\Defaults::class);
1398
+
1399
+        $this->registerService(\OCP\ISession::class, function (ContainerInterface $c) {
1400
+            return $c->get(\OCP\IUserSession::class)->getSession();
1401
+        }, false);
1402
+
1403
+        $this->registerService(IShareHelper::class, function (ContainerInterface $c) {
1404
+            return new ShareHelper(
1405
+                $c->get(\OCP\Share\IManager::class)
1406
+            );
1407
+        });
1408
+
1409
+        $this->registerService(Installer::class, function (ContainerInterface $c) {
1410
+            return new Installer(
1411
+                $c->get(AppFetcher::class),
1412
+                $c->get(IClientService::class),
1413
+                $c->get(ITempManager::class),
1414
+                $c->get(LoggerInterface::class),
1415
+                $c->get(\OCP\IConfig::class),
1416
+                \OC::$CLI
1417
+            );
1418
+        });
1419
+
1420
+        $this->registerService(IApiFactory::class, function (ContainerInterface $c) {
1421
+            return new ApiFactory($c->get(IClientService::class));
1422
+        });
1423
+
1424
+        $this->registerService(IInstanceFactory::class, function (ContainerInterface $c) {
1425
+            $memcacheFactory = $c->get(ICacheFactory::class);
1426
+            return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->get(IClientService::class));
1427
+        });
1428
+
1429
+        $this->registerAlias(IContactsStore::class, ContactsStore::class);
1430
+        $this->registerAlias(IAccountManager::class, AccountManager::class);
1431
+
1432
+        $this->registerAlias(IStorageFactory::class, StorageFactory::class);
1433
+
1434
+        $this->registerAlias(\OCP\Dashboard\IManager::class, \OC\Dashboard\Manager::class);
1435
+
1436
+        $this->registerAlias(IFullTextSearchManager::class, FullTextSearchManager::class);
1437
+
1438
+        $this->registerAlias(ISubAdmin::class, SubAdmin::class);
1439
+
1440
+        $this->registerAlias(IInitialStateService::class, InitialStateService::class);
1441
+
1442
+        $this->registerAlias(\OCP\IEmojiHelper::class, \OC\EmojiHelper::class);
1443
+
1444
+        $this->registerAlias(\OCP\UserStatus\IManager::class, \OC\UserStatus\Manager::class);
1445
+
1446
+        $this->registerAlias(IBroker::class, Broker::class);
1447
+
1448
+        $this->registerAlias(IMetadataManager::class, MetadataManager::class);
1449
+
1450
+        $this->registerAlias(\OCP\Files\AppData\IAppDataFactory::class, \OC\Files\AppData\Factory::class);
1451
+
1452
+        $this->registerAlias(IBinaryFinder::class, BinaryFinder::class);
1453
+
1454
+        $this->registerAlias(\OCP\Share\IPublicShareTemplateFactory::class, \OC\Share20\PublicShareTemplateFactory::class);
1455
+
1456
+        $this->registerAlias(ITranslationManager::class, TranslationManager::class);
1457
+
1458
+        $this->connectDispatcher();
1459
+    }
1460
+
1461
+    public function boot() {
1462
+        /** @var HookConnector $hookConnector */
1463
+        $hookConnector = $this->get(HookConnector::class);
1464
+        $hookConnector->viewToNode();
1465
+    }
1466
+
1467
+    /**
1468
+     * @return \OCP\Calendar\IManager
1469
+     * @deprecated 20.0.0
1470
+     */
1471
+    public function getCalendarManager() {
1472
+        return $this->get(\OC\Calendar\Manager::class);
1473
+    }
1474
+
1475
+    /**
1476
+     * @return \OCP\Calendar\Resource\IManager
1477
+     * @deprecated 20.0.0
1478
+     */
1479
+    public function getCalendarResourceBackendManager() {
1480
+        return $this->get(\OC\Calendar\Resource\Manager::class);
1481
+    }
1482
+
1483
+    /**
1484
+     * @return \OCP\Calendar\Room\IManager
1485
+     * @deprecated 20.0.0
1486
+     */
1487
+    public function getCalendarRoomBackendManager() {
1488
+        return $this->get(\OC\Calendar\Room\Manager::class);
1489
+    }
1490
+
1491
+    private function connectDispatcher(): void {
1492
+        /** @var IEventDispatcher $eventDispatcher */
1493
+        $eventDispatcher = $this->get(IEventDispatcher::class);
1494
+        $eventDispatcher->addServiceListener(LoginFailed::class, LoginFailedListener::class);
1495
+        $eventDispatcher->addServiceListener(PostLoginEvent::class, UserLoggedInListener::class);
1496
+        $eventDispatcher->addServiceListener(UserChangedEvent::class, UserChangedListener::class);
1497
+        $eventDispatcher->addServiceListener(BeforeUserDeletedEvent::class, BeforeUserDeletedListener::class);
1498
+    }
1499
+
1500
+    /**
1501
+     * @return \OCP\Contacts\IManager
1502
+     * @deprecated 20.0.0
1503
+     */
1504
+    public function getContactsManager() {
1505
+        return $this->get(\OCP\Contacts\IManager::class);
1506
+    }
1507
+
1508
+    /**
1509
+     * @return \OC\Encryption\Manager
1510
+     * @deprecated 20.0.0
1511
+     */
1512
+    public function getEncryptionManager() {
1513
+        return $this->get(\OCP\Encryption\IManager::class);
1514
+    }
1515
+
1516
+    /**
1517
+     * @return \OC\Encryption\File
1518
+     * @deprecated 20.0.0
1519
+     */
1520
+    public function getEncryptionFilesHelper() {
1521
+        return $this->get(IFile::class);
1522
+    }
1523
+
1524
+    /**
1525
+     * @return \OCP\Encryption\Keys\IStorage
1526
+     * @deprecated 20.0.0
1527
+     */
1528
+    public function getEncryptionKeyStorage() {
1529
+        return $this->get(IStorage::class);
1530
+    }
1531
+
1532
+    /**
1533
+     * The current request object holding all information about the request
1534
+     * currently being processed is returned from this method.
1535
+     * In case the current execution was not initiated by a web request null is returned
1536
+     *
1537
+     * @return \OCP\IRequest
1538
+     * @deprecated 20.0.0
1539
+     */
1540
+    public function getRequest() {
1541
+        return $this->get(IRequest::class);
1542
+    }
1543
+
1544
+    /**
1545
+     * Returns the preview manager which can create preview images for a given file
1546
+     *
1547
+     * @return IPreview
1548
+     * @deprecated 20.0.0
1549
+     */
1550
+    public function getPreviewManager() {
1551
+        return $this->get(IPreview::class);
1552
+    }
1553
+
1554
+    /**
1555
+     * Returns the tag manager which can get and set tags for different object types
1556
+     *
1557
+     * @see \OCP\ITagManager::load()
1558
+     * @return ITagManager
1559
+     * @deprecated 20.0.0
1560
+     */
1561
+    public function getTagManager() {
1562
+        return $this->get(ITagManager::class);
1563
+    }
1564
+
1565
+    /**
1566
+     * Returns the system-tag manager
1567
+     *
1568
+     * @return ISystemTagManager
1569
+     *
1570
+     * @since 9.0.0
1571
+     * @deprecated 20.0.0
1572
+     */
1573
+    public function getSystemTagManager() {
1574
+        return $this->get(ISystemTagManager::class);
1575
+    }
1576
+
1577
+    /**
1578
+     * Returns the system-tag object mapper
1579
+     *
1580
+     * @return ISystemTagObjectMapper
1581
+     *
1582
+     * @since 9.0.0
1583
+     * @deprecated 20.0.0
1584
+     */
1585
+    public function getSystemTagObjectMapper() {
1586
+        return $this->get(ISystemTagObjectMapper::class);
1587
+    }
1588
+
1589
+    /**
1590
+     * Returns the avatar manager, used for avatar functionality
1591
+     *
1592
+     * @return IAvatarManager
1593
+     * @deprecated 20.0.0
1594
+     */
1595
+    public function getAvatarManager() {
1596
+        return $this->get(IAvatarManager::class);
1597
+    }
1598
+
1599
+    /**
1600
+     * Returns the root folder of ownCloud's data directory
1601
+     *
1602
+     * @return IRootFolder
1603
+     * @deprecated 20.0.0
1604
+     */
1605
+    public function getRootFolder() {
1606
+        return $this->get(IRootFolder::class);
1607
+    }
1608
+
1609
+    /**
1610
+     * Returns the root folder of ownCloud's data directory
1611
+     * This is the lazy variant so this gets only initialized once it
1612
+     * is actually used.
1613
+     *
1614
+     * @return IRootFolder
1615
+     * @deprecated 20.0.0
1616
+     */
1617
+    public function getLazyRootFolder() {
1618
+        return $this->get(IRootFolder::class);
1619
+    }
1620
+
1621
+    /**
1622
+     * Returns a view to ownCloud's files folder
1623
+     *
1624
+     * @param string $userId user ID
1625
+     * @return \OCP\Files\Folder|null
1626
+     * @deprecated 20.0.0
1627
+     */
1628
+    public function getUserFolder($userId = null) {
1629
+        if ($userId === null) {
1630
+            $user = $this->get(IUserSession::class)->getUser();
1631
+            if (!$user) {
1632
+                return null;
1633
+            }
1634
+            $userId = $user->getUID();
1635
+        }
1636
+        $root = $this->get(IRootFolder::class);
1637
+        return $root->getUserFolder($userId);
1638
+    }
1639
+
1640
+    /**
1641
+     * @return \OC\User\Manager
1642
+     * @deprecated 20.0.0
1643
+     */
1644
+    public function getUserManager() {
1645
+        return $this->get(IUserManager::class);
1646
+    }
1647
+
1648
+    /**
1649
+     * @return \OC\Group\Manager
1650
+     * @deprecated 20.0.0
1651
+     */
1652
+    public function getGroupManager() {
1653
+        return $this->get(IGroupManager::class);
1654
+    }
1655
+
1656
+    /**
1657
+     * @return \OC\User\Session
1658
+     * @deprecated 20.0.0
1659
+     */
1660
+    public function getUserSession() {
1661
+        return $this->get(IUserSession::class);
1662
+    }
1663
+
1664
+    /**
1665
+     * @return \OCP\ISession
1666
+     * @deprecated 20.0.0
1667
+     */
1668
+    public function getSession() {
1669
+        return $this->get(Session::class)->getSession();
1670
+    }
1671
+
1672
+    /**
1673
+     * @param \OCP\ISession $session
1674
+     */
1675
+    public function setSession(\OCP\ISession $session) {
1676
+        $this->get(SessionStorage::class)->setSession($session);
1677
+        $this->get(Session::class)->setSession($session);
1678
+        $this->get(Store::class)->setSession($session);
1679
+    }
1680
+
1681
+    /**
1682
+     * @return \OC\Authentication\TwoFactorAuth\Manager
1683
+     * @deprecated 20.0.0
1684
+     */
1685
+    public function getTwoFactorAuthManager() {
1686
+        return $this->get(\OC\Authentication\TwoFactorAuth\Manager::class);
1687
+    }
1688
+
1689
+    /**
1690
+     * @return \OC\NavigationManager
1691
+     * @deprecated 20.0.0
1692
+     */
1693
+    public function getNavigationManager() {
1694
+        return $this->get(INavigationManager::class);
1695
+    }
1696
+
1697
+    /**
1698
+     * @return \OCP\IConfig
1699
+     * @deprecated 20.0.0
1700
+     */
1701
+    public function getConfig() {
1702
+        return $this->get(AllConfig::class);
1703
+    }
1704
+
1705
+    /**
1706
+     * @return \OC\SystemConfig
1707
+     * @deprecated 20.0.0
1708
+     */
1709
+    public function getSystemConfig() {
1710
+        return $this->get(SystemConfig::class);
1711
+    }
1712
+
1713
+    /**
1714
+     * Returns the app config manager
1715
+     *
1716
+     * @return IAppConfig
1717
+     * @deprecated 20.0.0
1718
+     */
1719
+    public function getAppConfig() {
1720
+        return $this->get(IAppConfig::class);
1721
+    }
1722
+
1723
+    /**
1724
+     * @return IFactory
1725
+     * @deprecated 20.0.0
1726
+     */
1727
+    public function getL10NFactory() {
1728
+        return $this->get(IFactory::class);
1729
+    }
1730
+
1731
+    /**
1732
+     * get an L10N instance
1733
+     *
1734
+     * @param string $app appid
1735
+     * @param string $lang
1736
+     * @return IL10N
1737
+     * @deprecated 20.0.0
1738
+     */
1739
+    public function getL10N($app, $lang = null) {
1740
+        return $this->get(IFactory::class)->get($app, $lang);
1741
+    }
1742
+
1743
+    /**
1744
+     * @return IURLGenerator
1745
+     * @deprecated 20.0.0
1746
+     */
1747
+    public function getURLGenerator() {
1748
+        return $this->get(IURLGenerator::class);
1749
+    }
1750
+
1751
+    /**
1752
+     * @return AppFetcher
1753
+     * @deprecated 20.0.0
1754
+     */
1755
+    public function getAppFetcher() {
1756
+        return $this->get(AppFetcher::class);
1757
+    }
1758
+
1759
+    /**
1760
+     * Returns an ICache instance. Since 8.1.0 it returns a fake cache. Use
1761
+     * getMemCacheFactory() instead.
1762
+     *
1763
+     * @return ICache
1764
+     * @deprecated 8.1.0 use getMemCacheFactory to obtain a proper cache
1765
+     */
1766
+    public function getCache() {
1767
+        return $this->get(ICache::class);
1768
+    }
1769
+
1770
+    /**
1771
+     * Returns an \OCP\CacheFactory instance
1772
+     *
1773
+     * @return \OCP\ICacheFactory
1774
+     * @deprecated 20.0.0
1775
+     */
1776
+    public function getMemCacheFactory() {
1777
+        return $this->get(ICacheFactory::class);
1778
+    }
1779
+
1780
+    /**
1781
+     * Returns an \OC\RedisFactory instance
1782
+     *
1783
+     * @return \OC\RedisFactory
1784
+     * @deprecated 20.0.0
1785
+     */
1786
+    public function getGetRedisFactory() {
1787
+        return $this->get('RedisFactory');
1788
+    }
1789
+
1790
+
1791
+    /**
1792
+     * Returns the current session
1793
+     *
1794
+     * @return \OCP\IDBConnection
1795
+     * @deprecated 20.0.0
1796
+     */
1797
+    public function getDatabaseConnection() {
1798
+        return $this->get(IDBConnection::class);
1799
+    }
1800
+
1801
+    /**
1802
+     * Returns the activity manager
1803
+     *
1804
+     * @return \OCP\Activity\IManager
1805
+     * @deprecated 20.0.0
1806
+     */
1807
+    public function getActivityManager() {
1808
+        return $this->get(\OCP\Activity\IManager::class);
1809
+    }
1810
+
1811
+    /**
1812
+     * Returns an job list for controlling background jobs
1813
+     *
1814
+     * @return IJobList
1815
+     * @deprecated 20.0.0
1816
+     */
1817
+    public function getJobList() {
1818
+        return $this->get(IJobList::class);
1819
+    }
1820
+
1821
+    /**
1822
+     * Returns a logger instance
1823
+     *
1824
+     * @return ILogger
1825
+     * @deprecated 20.0.0
1826
+     */
1827
+    public function getLogger() {
1828
+        return $this->get(ILogger::class);
1829
+    }
1830
+
1831
+    /**
1832
+     * @return ILogFactory
1833
+     * @throws \OCP\AppFramework\QueryException
1834
+     * @deprecated 20.0.0
1835
+     */
1836
+    public function getLogFactory() {
1837
+        return $this->get(ILogFactory::class);
1838
+    }
1839
+
1840
+    /**
1841
+     * Returns a router for generating and matching urls
1842
+     *
1843
+     * @return IRouter
1844
+     * @deprecated 20.0.0
1845
+     */
1846
+    public function getRouter() {
1847
+        return $this->get(IRouter::class);
1848
+    }
1849
+
1850
+    /**
1851
+     * Returns a search instance
1852
+     *
1853
+     * @return ISearch
1854
+     * @deprecated 20.0.0
1855
+     */
1856
+    public function getSearch() {
1857
+        return $this->get(ISearch::class);
1858
+    }
1859
+
1860
+    /**
1861
+     * Returns a SecureRandom instance
1862
+     *
1863
+     * @return \OCP\Security\ISecureRandom
1864
+     * @deprecated 20.0.0
1865
+     */
1866
+    public function getSecureRandom() {
1867
+        return $this->get(ISecureRandom::class);
1868
+    }
1869
+
1870
+    /**
1871
+     * Returns a Crypto instance
1872
+     *
1873
+     * @return ICrypto
1874
+     * @deprecated 20.0.0
1875
+     */
1876
+    public function getCrypto() {
1877
+        return $this->get(ICrypto::class);
1878
+    }
1879
+
1880
+    /**
1881
+     * Returns a Hasher instance
1882
+     *
1883
+     * @return IHasher
1884
+     * @deprecated 20.0.0
1885
+     */
1886
+    public function getHasher() {
1887
+        return $this->get(IHasher::class);
1888
+    }
1889
+
1890
+    /**
1891
+     * Returns a CredentialsManager instance
1892
+     *
1893
+     * @return ICredentialsManager
1894
+     * @deprecated 20.0.0
1895
+     */
1896
+    public function getCredentialsManager() {
1897
+        return $this->get(ICredentialsManager::class);
1898
+    }
1899
+
1900
+    /**
1901
+     * Get the certificate manager
1902
+     *
1903
+     * @return \OCP\ICertificateManager
1904
+     */
1905
+    public function getCertificateManager() {
1906
+        return $this->get(ICertificateManager::class);
1907
+    }
1908
+
1909
+    /**
1910
+     * Returns an instance of the HTTP client service
1911
+     *
1912
+     * @return IClientService
1913
+     * @deprecated 20.0.0
1914
+     */
1915
+    public function getHTTPClientService() {
1916
+        return $this->get(IClientService::class);
1917
+    }
1918
+
1919
+    /**
1920
+     * Create a new event source
1921
+     *
1922
+     * @return \OCP\IEventSource
1923
+     * @deprecated 20.0.0
1924
+     */
1925
+    public function createEventSource() {
1926
+        return new \OC_EventSource();
1927
+    }
1928
+
1929
+    /**
1930
+     * Get the active event logger
1931
+     *
1932
+     * The returned logger only logs data when debug mode is enabled
1933
+     *
1934
+     * @return IEventLogger
1935
+     * @deprecated 20.0.0
1936
+     */
1937
+    public function getEventLogger() {
1938
+        return $this->get(IEventLogger::class);
1939
+    }
1940
+
1941
+    /**
1942
+     * Get the active query logger
1943
+     *
1944
+     * The returned logger only logs data when debug mode is enabled
1945
+     *
1946
+     * @return IQueryLogger
1947
+     * @deprecated 20.0.0
1948
+     */
1949
+    public function getQueryLogger() {
1950
+        return $this->get(IQueryLogger::class);
1951
+    }
1952
+
1953
+    /**
1954
+     * Get the manager for temporary files and folders
1955
+     *
1956
+     * @return \OCP\ITempManager
1957
+     * @deprecated 20.0.0
1958
+     */
1959
+    public function getTempManager() {
1960
+        return $this->get(ITempManager::class);
1961
+    }
1962
+
1963
+    /**
1964
+     * Get the app manager
1965
+     *
1966
+     * @return \OCP\App\IAppManager
1967
+     * @deprecated 20.0.0
1968
+     */
1969
+    public function getAppManager() {
1970
+        return $this->get(IAppManager::class);
1971
+    }
1972
+
1973
+    /**
1974
+     * Creates a new mailer
1975
+     *
1976
+     * @return IMailer
1977
+     * @deprecated 20.0.0
1978
+     */
1979
+    public function getMailer() {
1980
+        return $this->get(IMailer::class);
1981
+    }
1982
+
1983
+    /**
1984
+     * Get the webroot
1985
+     *
1986
+     * @return string
1987
+     * @deprecated 20.0.0
1988
+     */
1989
+    public function getWebRoot() {
1990
+        return $this->webRoot;
1991
+    }
1992
+
1993
+    /**
1994
+     * @return \OC\OCSClient
1995
+     * @deprecated 20.0.0
1996
+     */
1997
+    public function getOcsClient() {
1998
+        return $this->get('OcsClient');
1999
+    }
2000
+
2001
+    /**
2002
+     * @return IDateTimeZone
2003
+     * @deprecated 20.0.0
2004
+     */
2005
+    public function getDateTimeZone() {
2006
+        return $this->get(IDateTimeZone::class);
2007
+    }
2008
+
2009
+    /**
2010
+     * @return IDateTimeFormatter
2011
+     * @deprecated 20.0.0
2012
+     */
2013
+    public function getDateTimeFormatter() {
2014
+        return $this->get(IDateTimeFormatter::class);
2015
+    }
2016
+
2017
+    /**
2018
+     * @return IMountProviderCollection
2019
+     * @deprecated 20.0.0
2020
+     */
2021
+    public function getMountProviderCollection() {
2022
+        return $this->get(IMountProviderCollection::class);
2023
+    }
2024
+
2025
+    /**
2026
+     * Get the IniWrapper
2027
+     *
2028
+     * @return IniGetWrapper
2029
+     * @deprecated 20.0.0
2030
+     */
2031
+    public function getIniWrapper() {
2032
+        return $this->get(IniGetWrapper::class);
2033
+    }
2034
+
2035
+    /**
2036
+     * @return \OCP\Command\IBus
2037
+     * @deprecated 20.0.0
2038
+     */
2039
+    public function getCommandBus() {
2040
+        return $this->get(IBus::class);
2041
+    }
2042
+
2043
+    /**
2044
+     * Get the trusted domain helper
2045
+     *
2046
+     * @return TrustedDomainHelper
2047
+     * @deprecated 20.0.0
2048
+     */
2049
+    public function getTrustedDomainHelper() {
2050
+        return $this->get(TrustedDomainHelper::class);
2051
+    }
2052
+
2053
+    /**
2054
+     * Get the locking provider
2055
+     *
2056
+     * @return ILockingProvider
2057
+     * @since 8.1.0
2058
+     * @deprecated 20.0.0
2059
+     */
2060
+    public function getLockingProvider() {
2061
+        return $this->get(ILockingProvider::class);
2062
+    }
2063
+
2064
+    /**
2065
+     * @return IMountManager
2066
+     * @deprecated 20.0.0
2067
+     **/
2068
+    public function getMountManager() {
2069
+        return $this->get(IMountManager::class);
2070
+    }
2071
+
2072
+    /**
2073
+     * @return IUserMountCache
2074
+     * @deprecated 20.0.0
2075
+     */
2076
+    public function getUserMountCache() {
2077
+        return $this->get(IUserMountCache::class);
2078
+    }
2079
+
2080
+    /**
2081
+     * Get the MimeTypeDetector
2082
+     *
2083
+     * @return IMimeTypeDetector
2084
+     * @deprecated 20.0.0
2085
+     */
2086
+    public function getMimeTypeDetector() {
2087
+        return $this->get(IMimeTypeDetector::class);
2088
+    }
2089
+
2090
+    /**
2091
+     * Get the MimeTypeLoader
2092
+     *
2093
+     * @return IMimeTypeLoader
2094
+     * @deprecated 20.0.0
2095
+     */
2096
+    public function getMimeTypeLoader() {
2097
+        return $this->get(IMimeTypeLoader::class);
2098
+    }
2099
+
2100
+    /**
2101
+     * Get the manager of all the capabilities
2102
+     *
2103
+     * @return CapabilitiesManager
2104
+     * @deprecated 20.0.0
2105
+     */
2106
+    public function getCapabilitiesManager() {
2107
+        return $this->get(CapabilitiesManager::class);
2108
+    }
2109
+
2110
+    /**
2111
+     * Get the EventDispatcher
2112
+     *
2113
+     * @return EventDispatcherInterface
2114
+     * @since 8.2.0
2115
+     * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher
2116
+     */
2117
+    public function getEventDispatcher() {
2118
+        return $this->get(\OC\EventDispatcher\SymfonyAdapter::class);
2119
+    }
2120
+
2121
+    /**
2122
+     * Get the Notification Manager
2123
+     *
2124
+     * @return \OCP\Notification\IManager
2125
+     * @since 8.2.0
2126
+     * @deprecated 20.0.0
2127
+     */
2128
+    public function getNotificationManager() {
2129
+        return $this->get(\OCP\Notification\IManager::class);
2130
+    }
2131
+
2132
+    /**
2133
+     * @return ICommentsManager
2134
+     * @deprecated 20.0.0
2135
+     */
2136
+    public function getCommentsManager() {
2137
+        return $this->get(ICommentsManager::class);
2138
+    }
2139
+
2140
+    /**
2141
+     * @return \OCA\Theming\ThemingDefaults
2142
+     * @deprecated 20.0.0
2143
+     */
2144
+    public function getThemingDefaults() {
2145
+        return $this->get('ThemingDefaults');
2146
+    }
2147
+
2148
+    /**
2149
+     * @return \OC\IntegrityCheck\Checker
2150
+     * @deprecated 20.0.0
2151
+     */
2152
+    public function getIntegrityCodeChecker() {
2153
+        return $this->get('IntegrityCodeChecker');
2154
+    }
2155
+
2156
+    /**
2157
+     * @return \OC\Session\CryptoWrapper
2158
+     * @deprecated 20.0.0
2159
+     */
2160
+    public function getSessionCryptoWrapper() {
2161
+        return $this->get('CryptoWrapper');
2162
+    }
2163
+
2164
+    /**
2165
+     * @return CsrfTokenManager
2166
+     * @deprecated 20.0.0
2167
+     */
2168
+    public function getCsrfTokenManager() {
2169
+        return $this->get(CsrfTokenManager::class);
2170
+    }
2171
+
2172
+    /**
2173
+     * @return Throttler
2174
+     * @deprecated 20.0.0
2175
+     */
2176
+    public function getBruteForceThrottler() {
2177
+        return $this->get(Throttler::class);
2178
+    }
2179
+
2180
+    /**
2181
+     * @return IContentSecurityPolicyManager
2182
+     * @deprecated 20.0.0
2183
+     */
2184
+    public function getContentSecurityPolicyManager() {
2185
+        return $this->get(ContentSecurityPolicyManager::class);
2186
+    }
2187
+
2188
+    /**
2189
+     * @return ContentSecurityPolicyNonceManager
2190
+     * @deprecated 20.0.0
2191
+     */
2192
+    public function getContentSecurityPolicyNonceManager() {
2193
+        return $this->get(ContentSecurityPolicyNonceManager::class);
2194
+    }
2195
+
2196
+    /**
2197
+     * Not a public API as of 8.2, wait for 9.0
2198
+     *
2199
+     * @return \OCA\Files_External\Service\BackendService
2200
+     * @deprecated 20.0.0
2201
+     */
2202
+    public function getStoragesBackendService() {
2203
+        return $this->get(BackendService::class);
2204
+    }
2205
+
2206
+    /**
2207
+     * Not a public API as of 8.2, wait for 9.0
2208
+     *
2209
+     * @return \OCA\Files_External\Service\GlobalStoragesService
2210
+     * @deprecated 20.0.0
2211
+     */
2212
+    public function getGlobalStoragesService() {
2213
+        return $this->get(GlobalStoragesService::class);
2214
+    }
2215
+
2216
+    /**
2217
+     * Not a public API as of 8.2, wait for 9.0
2218
+     *
2219
+     * @return \OCA\Files_External\Service\UserGlobalStoragesService
2220
+     * @deprecated 20.0.0
2221
+     */
2222
+    public function getUserGlobalStoragesService() {
2223
+        return $this->get(UserGlobalStoragesService::class);
2224
+    }
2225
+
2226
+    /**
2227
+     * Not a public API as of 8.2, wait for 9.0
2228
+     *
2229
+     * @return \OCA\Files_External\Service\UserStoragesService
2230
+     * @deprecated 20.0.0
2231
+     */
2232
+    public function getUserStoragesService() {
2233
+        return $this->get(UserStoragesService::class);
2234
+    }
2235
+
2236
+    /**
2237
+     * @return \OCP\Share\IManager
2238
+     * @deprecated 20.0.0
2239
+     */
2240
+    public function getShareManager() {
2241
+        return $this->get(\OCP\Share\IManager::class);
2242
+    }
2243
+
2244
+    /**
2245
+     * @return \OCP\Collaboration\Collaborators\ISearch
2246
+     * @deprecated 20.0.0
2247
+     */
2248
+    public function getCollaboratorSearch() {
2249
+        return $this->get(\OCP\Collaboration\Collaborators\ISearch::class);
2250
+    }
2251
+
2252
+    /**
2253
+     * @return \OCP\Collaboration\AutoComplete\IManager
2254
+     * @deprecated 20.0.0
2255
+     */
2256
+    public function getAutoCompleteManager() {
2257
+        return $this->get(IManager::class);
2258
+    }
2259
+
2260
+    /**
2261
+     * Returns the LDAP Provider
2262
+     *
2263
+     * @return \OCP\LDAP\ILDAPProvider
2264
+     * @deprecated 20.0.0
2265
+     */
2266
+    public function getLDAPProvider() {
2267
+        return $this->get('LDAPProvider');
2268
+    }
2269
+
2270
+    /**
2271
+     * @return \OCP\Settings\IManager
2272
+     * @deprecated 20.0.0
2273
+     */
2274
+    public function getSettingsManager() {
2275
+        return $this->get(\OC\Settings\Manager::class);
2276
+    }
2277
+
2278
+    /**
2279
+     * @return \OCP\Files\IAppData
2280
+     * @deprecated 20.0.0 Use get(\OCP\Files\AppData\IAppDataFactory::class)->get($app) instead
2281
+     */
2282
+    public function getAppDataDir($app) {
2283
+        /** @var \OC\Files\AppData\Factory $factory */
2284
+        $factory = $this->get(\OC\Files\AppData\Factory::class);
2285
+        return $factory->get($app);
2286
+    }
2287
+
2288
+    /**
2289
+     * @return \OCP\Lockdown\ILockdownManager
2290
+     * @deprecated 20.0.0
2291
+     */
2292
+    public function getLockdownManager() {
2293
+        return $this->get('LockdownManager');
2294
+    }
2295
+
2296
+    /**
2297
+     * @return \OCP\Federation\ICloudIdManager
2298
+     * @deprecated 20.0.0
2299
+     */
2300
+    public function getCloudIdManager() {
2301
+        return $this->get(ICloudIdManager::class);
2302
+    }
2303
+
2304
+    /**
2305
+     * @return \OCP\GlobalScale\IConfig
2306
+     * @deprecated 20.0.0
2307
+     */
2308
+    public function getGlobalScaleConfig() {
2309
+        return $this->get(IConfig::class);
2310
+    }
2311
+
2312
+    /**
2313
+     * @return \OCP\Federation\ICloudFederationProviderManager
2314
+     * @deprecated 20.0.0
2315
+     */
2316
+    public function getCloudFederationProviderManager() {
2317
+        return $this->get(ICloudFederationProviderManager::class);
2318
+    }
2319
+
2320
+    /**
2321
+     * @return \OCP\Remote\Api\IApiFactory
2322
+     * @deprecated 20.0.0
2323
+     */
2324
+    public function getRemoteApiFactory() {
2325
+        return $this->get(IApiFactory::class);
2326
+    }
2327
+
2328
+    /**
2329
+     * @return \OCP\Federation\ICloudFederationFactory
2330
+     * @deprecated 20.0.0
2331
+     */
2332
+    public function getCloudFederationFactory() {
2333
+        return $this->get(ICloudFederationFactory::class);
2334
+    }
2335
+
2336
+    /**
2337
+     * @return \OCP\Remote\IInstanceFactory
2338
+     * @deprecated 20.0.0
2339
+     */
2340
+    public function getRemoteInstanceFactory() {
2341
+        return $this->get(IInstanceFactory::class);
2342
+    }
2343
+
2344
+    /**
2345
+     * @return IStorageFactory
2346
+     * @deprecated 20.0.0
2347
+     */
2348
+    public function getStorageFactory() {
2349
+        return $this->get(IStorageFactory::class);
2350
+    }
2351
+
2352
+    /**
2353
+     * Get the Preview GeneratorHelper
2354
+     *
2355
+     * @return GeneratorHelper
2356
+     * @since 17.0.0
2357
+     * @deprecated 20.0.0
2358
+     */
2359
+    public function getGeneratorHelper() {
2360
+        return $this->get(\OC\Preview\GeneratorHelper::class);
2361
+    }
2362
+
2363
+    private function registerDeprecatedAlias(string $alias, string $target) {
2364
+        $this->registerService($alias, function (ContainerInterface $container) use ($target, $alias) {
2365
+            try {
2366
+                /** @var LoggerInterface $logger */
2367
+                $logger = $container->get(LoggerInterface::class);
2368
+                $logger->debug('The requested alias "' . $alias . '" is deprecated. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']);
2369
+            } catch (ContainerExceptionInterface $e) {
2370
+                // Could not get logger. Continue
2371
+            }
2372
+
2373
+            return $container->get($target);
2374
+        }, false);
2375
+    }
2376 2376
 }
Please login to merge, or discard this patch.
Spacing   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -296,10 +296,10 @@  discard block
 block discarded – undo
296 296
 		$this->registerParameter('isCLI', \OC::$CLI);
297 297
 		$this->registerParameter('serverRoot', \OC::$SERVERROOT);
298 298
 
299
-		$this->registerService(ContainerInterface::class, function (ContainerInterface $c) {
299
+		$this->registerService(ContainerInterface::class, function(ContainerInterface $c) {
300 300
 			return $c;
301 301
 		});
302
-		$this->registerService(\OCP\IServerContainer::class, function (ContainerInterface $c) {
302
+		$this->registerService(\OCP\IServerContainer::class, function(ContainerInterface $c) {
303 303
 			return $c;
304 304
 		});
305 305
 
@@ -324,11 +324,11 @@  discard block
 block discarded – undo
324 324
 
325 325
 		$this->registerAlias(IActionFactory::class, ActionFactory::class);
326 326
 
327
-		$this->registerService(View::class, function (Server $c) {
327
+		$this->registerService(View::class, function(Server $c) {
328 328
 			return new View();
329 329
 		}, false);
330 330
 
331
-		$this->registerService(IPreview::class, function (ContainerInterface $c) {
331
+		$this->registerService(IPreview::class, function(ContainerInterface $c) {
332 332
 			return new PreviewManager(
333 333
 				$c->get(\OCP\IConfig::class),
334 334
 				$c->get(IRootFolder::class),
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 		/** @deprecated 19.0.0 */
350 350
 		$this->registerDeprecatedAlias('PreviewManager', IPreview::class);
351 351
 
352
-		$this->registerService(\OC\Preview\Watcher::class, function (ContainerInterface $c) {
352
+		$this->registerService(\OC\Preview\Watcher::class, function(ContainerInterface $c) {
353 353
 			return new \OC\Preview\Watcher(
354 354
 				new \OC\Preview\Storage\Root(
355 355
 					$c->get(IRootFolder::class),
@@ -358,11 +358,11 @@  discard block
 block discarded – undo
358 358
 			);
359 359
 		});
360 360
 
361
-		$this->registerService(IProfiler::class, function (Server $c) {
361
+		$this->registerService(IProfiler::class, function(Server $c) {
362 362
 			return new Profiler($c->get(SystemConfig::class));
363 363
 		});
364 364
 
365
-		$this->registerService(\OCP\Encryption\IManager::class, function (Server $c): Encryption\Manager {
365
+		$this->registerService(\OCP\Encryption\IManager::class, function(Server $c): Encryption\Manager {
366 366
 			$view = new View();
367 367
 			$util = new Encryption\Util(
368 368
 				$view,
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 
385 385
 		/** @deprecated 21.0.0 */
386 386
 		$this->registerDeprecatedAlias('EncryptionFileHelper', IFile::class);
387
-		$this->registerService(IFile::class, function (ContainerInterface $c) {
387
+		$this->registerService(IFile::class, function(ContainerInterface $c) {
388 388
 			$util = new Encryption\Util(
389 389
 				new View(),
390 390
 				$c->get(IUserManager::class),
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 
401 401
 		/** @deprecated 21.0.0 */
402 402
 		$this->registerDeprecatedAlias('EncryptionKeyStorage', IStorage::class);
403
-		$this->registerService(IStorage::class, function (ContainerInterface $c) {
403
+		$this->registerService(IStorage::class, function(ContainerInterface $c) {
404 404
 			$view = new View();
405 405
 			$util = new Encryption\Util(
406 406
 				$view,
@@ -423,22 +423,22 @@  discard block
 block discarded – undo
423 423
 		/** @deprecated 19.0.0 */
424 424
 		$this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class);
425 425
 
426
-		$this->registerService('SystemTagManagerFactory', function (ContainerInterface $c) {
426
+		$this->registerService('SystemTagManagerFactory', function(ContainerInterface $c) {
427 427
 			/** @var \OCP\IConfig $config */
428 428
 			$config = $c->get(\OCP\IConfig::class);
429 429
 			$factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class);
430 430
 			return new $factoryClass($this);
431 431
 		});
432
-		$this->registerService(ISystemTagManager::class, function (ContainerInterface $c) {
432
+		$this->registerService(ISystemTagManager::class, function(ContainerInterface $c) {
433 433
 			return $c->get('SystemTagManagerFactory')->getManager();
434 434
 		});
435 435
 		/** @deprecated 19.0.0 */
436 436
 		$this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class);
437 437
 
438
-		$this->registerService(ISystemTagObjectMapper::class, function (ContainerInterface $c) {
438
+		$this->registerService(ISystemTagObjectMapper::class, function(ContainerInterface $c) {
439 439
 			return $c->get('SystemTagManagerFactory')->getObjectMapper();
440 440
 		});
441
-		$this->registerService('RootFolder', function (ContainerInterface $c) {
441
+		$this->registerService('RootFolder', function(ContainerInterface $c) {
442 442
 			$manager = \OC\Files\Filesystem::getMountManager(null);
443 443
 			$view = new View();
444 444
 			$root = new Root(
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 
460 460
 			return $root;
461 461
 		});
462
-		$this->registerService(HookConnector::class, function (ContainerInterface $c) {
462
+		$this->registerService(HookConnector::class, function(ContainerInterface $c) {
463 463
 			return new HookConnector(
464 464
 				$c->get(IRootFolder::class),
465 465
 				new View(),
@@ -471,8 +471,8 @@  discard block
 block discarded – undo
471 471
 		/** @deprecated 19.0.0 */
472 472
 		$this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class);
473 473
 
474
-		$this->registerService(IRootFolder::class, function (ContainerInterface $c) {
475
-			return new LazyRoot(function () use ($c) {
474
+		$this->registerService(IRootFolder::class, function(ContainerInterface $c) {
475
+			return new LazyRoot(function() use ($c) {
476 476
 				return $c->get('RootFolder');
477 477
 			});
478 478
 		});
@@ -483,53 +483,53 @@  discard block
 block discarded – undo
483 483
 		$this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class);
484 484
 		$this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class);
485 485
 
486
-		$this->registerService(DisplayNameCache::class, function (ContainerInterface $c) {
486
+		$this->registerService(DisplayNameCache::class, function(ContainerInterface $c) {
487 487
 			return $c->get(\OC\User\Manager::class)->getDisplayNameCache();
488 488
 		});
489 489
 
490
-		$this->registerService(\OCP\IGroupManager::class, function (ContainerInterface $c) {
490
+		$this->registerService(\OCP\IGroupManager::class, function(ContainerInterface $c) {
491 491
 			$groupManager = new \OC\Group\Manager(
492 492
 				$this->get(IUserManager::class),
493 493
 				$c->get(SymfonyAdapter::class),
494 494
 				$this->get(LoggerInterface::class),
495 495
 				$this->get(ICacheFactory::class)
496 496
 			);
497
-			$groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
497
+			$groupManager->listen('\OC\Group', 'preCreate', function($gid) {
498 498
 				/** @var IEventDispatcher $dispatcher */
499 499
 				$dispatcher = $this->get(IEventDispatcher::class);
500 500
 				$dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid));
501 501
 			});
502
-			$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) {
502
+			$groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $group) {
503 503
 				/** @var IEventDispatcher $dispatcher */
504 504
 				$dispatcher = $this->get(IEventDispatcher::class);
505 505
 				$dispatcher->dispatchTyped(new GroupCreatedEvent($group));
506 506
 			});
507
-			$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
507
+			$groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) {
508 508
 				/** @var IEventDispatcher $dispatcher */
509 509
 				$dispatcher = $this->get(IEventDispatcher::class);
510 510
 				$dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group));
511 511
 			});
512
-			$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
512
+			$groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) {
513 513
 				/** @var IEventDispatcher $dispatcher */
514 514
 				$dispatcher = $this->get(IEventDispatcher::class);
515 515
 				$dispatcher->dispatchTyped(new GroupDeletedEvent($group));
516 516
 			});
517
-			$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
517
+			$groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
518 518
 				/** @var IEventDispatcher $dispatcher */
519 519
 				$dispatcher = $this->get(IEventDispatcher::class);
520 520
 				$dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user));
521 521
 			});
522
-			$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
522
+			$groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
523 523
 				/** @var IEventDispatcher $dispatcher */
524 524
 				$dispatcher = $this->get(IEventDispatcher::class);
525 525
 				$dispatcher->dispatchTyped(new UserAddedEvent($group, $user));
526 526
 			});
527
-			$groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
527
+			$groupManager->listen('\OC\Group', 'preRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) {
528 528
 				/** @var IEventDispatcher $dispatcher */
529 529
 				$dispatcher = $this->get(IEventDispatcher::class);
530 530
 				$dispatcher->dispatchTyped(new BeforeUserRemovedEvent($group, $user));
531 531
 			});
532
-			$groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
532
+			$groupManager->listen('\OC\Group', 'postRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) {
533 533
 				/** @var IEventDispatcher $dispatcher */
534 534
 				$dispatcher = $this->get(IEventDispatcher::class);
535 535
 				$dispatcher->dispatchTyped(new UserRemovedEvent($group, $user));
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 		/** @deprecated 19.0.0 */
540 540
 		$this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class);
541 541
 
542
-		$this->registerService(Store::class, function (ContainerInterface $c) {
542
+		$this->registerService(Store::class, function(ContainerInterface $c) {
543 543
 			$session = $c->get(ISession::class);
544 544
 			if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) {
545 545
 				$tokenProvider = $c->get(IProvider::class);
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 		$this->registerAlias(IProvider::class, Authentication\Token\Manager::class);
554 554
 		$this->registerAlias(OCPIProvider::class, Authentication\Token\Manager::class);
555 555
 
556
-		$this->registerService(\OC\User\Session::class, function (Server $c) {
556
+		$this->registerService(\OC\User\Session::class, function(Server $c) {
557 557
 			$manager = $c->get(IUserManager::class);
558 558
 			$session = new \OC\Session\Memory('');
559 559
 			$timeFactory = new TimeFactory();
@@ -579,26 +579,26 @@  discard block
 block discarded – undo
579 579
 				$c->get(IEventDispatcher::class)
580 580
 			);
581 581
 			/** @deprecated 21.0.0 use BeforeUserCreatedEvent event with the IEventDispatcher instead */
582
-			$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
582
+			$userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) {
583 583
 				\OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]);
584 584
 			});
585 585
 			/** @deprecated 21.0.0 use UserCreatedEvent event with the IEventDispatcher instead */
586
-			$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
586
+			$userSession->listen('\OC\User', 'postCreateUser', function($user, $password) {
587 587
 				/** @var \OC\User\User $user */
588 588
 				\OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]);
589 589
 			});
590 590
 			/** @deprecated 21.0.0 use BeforeUserDeletedEvent event with the IEventDispatcher instead */
591
-			$userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) {
591
+			$userSession->listen('\OC\User', 'preDelete', function($user) use ($legacyDispatcher) {
592 592
 				/** @var \OC\User\User $user */
593 593
 				\OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]);
594 594
 				$legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user));
595 595
 			});
596 596
 			/** @deprecated 21.0.0 use UserDeletedEvent event with the IEventDispatcher instead */
597
-			$userSession->listen('\OC\User', 'postDelete', function ($user) {
597
+			$userSession->listen('\OC\User', 'postDelete', function($user) {
598 598
 				/** @var \OC\User\User $user */
599 599
 				\OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]);
600 600
 			});
601
-			$userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
601
+			$userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) {
602 602
 				/** @var \OC\User\User $user */
603 603
 				\OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
604 604
 
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 				$dispatcher = $this->get(IEventDispatcher::class);
607 607
 				$dispatcher->dispatchTyped(new BeforePasswordUpdatedEvent($user, $password, $recoveryPassword));
608 608
 			});
609
-			$userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
609
+			$userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) {
610 610
 				/** @var \OC\User\User $user */
611 611
 				\OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
612 612
 
@@ -614,14 +614,14 @@  discard block
 block discarded – undo
614 614
 				$dispatcher = $this->get(IEventDispatcher::class);
615 615
 				$dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword));
616 616
 			});
617
-			$userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
617
+			$userSession->listen('\OC\User', 'preLogin', function($uid, $password) {
618 618
 				\OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]);
619 619
 
620 620
 				/** @var IEventDispatcher $dispatcher */
621 621
 				$dispatcher = $this->get(IEventDispatcher::class);
622 622
 				$dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password));
623 623
 			});
624
-			$userSession->listen('\OC\User', 'postLogin', function ($user, $loginName, $password, $isTokenLogin) {
624
+			$userSession->listen('\OC\User', 'postLogin', function($user, $loginName, $password, $isTokenLogin) {
625 625
 				/** @var \OC\User\User $user */
626 626
 				\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'loginName' => $loginName, 'password' => $password, 'isTokenLogin' => $isTokenLogin]);
627 627
 
@@ -629,12 +629,12 @@  discard block
 block discarded – undo
629 629
 				$dispatcher = $this->get(IEventDispatcher::class);
630 630
 				$dispatcher->dispatchTyped(new UserLoggedInEvent($user, $loginName, $password, $isTokenLogin));
631 631
 			});
632
-			$userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) {
632
+			$userSession->listen('\OC\User', 'preRememberedLogin', function($uid) {
633 633
 				/** @var IEventDispatcher $dispatcher */
634 634
 				$dispatcher = $this->get(IEventDispatcher::class);
635 635
 				$dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid));
636 636
 			});
637
-			$userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
637
+			$userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) {
638 638
 				/** @var \OC\User\User $user */
639 639
 				\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]);
640 640
 
@@ -642,19 +642,19 @@  discard block
 block discarded – undo
642 642
 				$dispatcher = $this->get(IEventDispatcher::class);
643 643
 				$dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password));
644 644
 			});
645
-			$userSession->listen('\OC\User', 'logout', function ($user) {
645
+			$userSession->listen('\OC\User', 'logout', function($user) {
646 646
 				\OC_Hook::emit('OC_User', 'logout', []);
647 647
 
648 648
 				/** @var IEventDispatcher $dispatcher */
649 649
 				$dispatcher = $this->get(IEventDispatcher::class);
650 650
 				$dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user));
651 651
 			});
652
-			$userSession->listen('\OC\User', 'postLogout', function ($user) {
652
+			$userSession->listen('\OC\User', 'postLogout', function($user) {
653 653
 				/** @var IEventDispatcher $dispatcher */
654 654
 				$dispatcher = $this->get(IEventDispatcher::class);
655 655
 				$dispatcher->dispatchTyped(new UserLoggedOutEvent($user));
656 656
 			});
657
-			$userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) {
657
+			$userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) {
658 658
 				/** @var \OC\User\User $user */
659 659
 				\OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]);
660 660
 
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
 		$this->registerDeprecatedAlias('AllConfig', \OC\AllConfig::class);
679 679
 		$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class);
680 680
 
681
-		$this->registerService(\OC\SystemConfig::class, function ($c) use ($config) {
681
+		$this->registerService(\OC\SystemConfig::class, function($c) use ($config) {
682 682
 			return new \OC\SystemConfig($config);
683 683
 		});
684 684
 		/** @deprecated 19.0.0 */
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
 		$this->registerDeprecatedAlias('AppConfig', \OC\AppConfig::class);
689 689
 		$this->registerAlias(IAppConfig::class, \OC\AppConfig::class);
690 690
 
691
-		$this->registerService(IFactory::class, function (Server $c) {
691
+		$this->registerService(IFactory::class, function(Server $c) {
692 692
 			return new \OC\L10N\Factory(
693 693
 				$c->get(\OCP\IConfig::class),
694 694
 				$c->getRequest(),
@@ -709,13 +709,13 @@  discard block
 block discarded – undo
709 709
 		/** @deprecated 19.0.0 */
710 710
 		$this->registerDeprecatedAlias('CategoryFetcher', CategoryFetcher::class);
711 711
 
712
-		$this->registerService(ICache::class, function ($c) {
712
+		$this->registerService(ICache::class, function($c) {
713 713
 			return new Cache\File();
714 714
 		});
715 715
 		/** @deprecated 19.0.0 */
716 716
 		$this->registerDeprecatedAlias('UserCache', ICache::class);
717 717
 
718
-		$this->registerService(Factory::class, function (Server $c) {
718
+		$this->registerService(Factory::class, function(Server $c) {
719 719
 			$profiler = $c->get(IProfiler::class);
720 720
 			$arrayCacheFactory = new \OC\Memcache\Factory('', $c->get(LoggerInterface::class),
721 721
 				$profiler,
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 				$version = implode(',', $v);
742 742
 				$instanceId = \OC_Util::getInstanceId();
743 743
 				$path = \OC::$SERVERROOT;
744
-				$prefix = md5($instanceId . '-' . $version . '-' . $path);
744
+				$prefix = md5($instanceId.'-'.$version.'-'.$path);
745 745
 				return new \OC\Memcache\Factory($prefix,
746 746
 					$c->get(LoggerInterface::class),
747 747
 					$profiler,
@@ -757,12 +757,12 @@  discard block
 block discarded – undo
757 757
 		$this->registerDeprecatedAlias('MemCacheFactory', Factory::class);
758 758
 		$this->registerAlias(ICacheFactory::class, Factory::class);
759 759
 
760
-		$this->registerService('RedisFactory', function (Server $c) {
760
+		$this->registerService('RedisFactory', function(Server $c) {
761 761
 			$systemConfig = $c->get(SystemConfig::class);
762 762
 			return new RedisFactory($systemConfig, $c->getEventLogger());
763 763
 		});
764 764
 
765
-		$this->registerService(\OCP\Activity\IManager::class, function (Server $c) {
765
+		$this->registerService(\OCP\Activity\IManager::class, function(Server $c) {
766 766
 			$l10n = $this->get(IFactory::class)->get('lib');
767 767
 			return new \OC\Activity\Manager(
768 768
 				$c->getRequest(),
@@ -775,14 +775,14 @@  discard block
 block discarded – undo
775 775
 		/** @deprecated 19.0.0 */
776 776
 		$this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class);
777 777
 
778
-		$this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
778
+		$this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) {
779 779
 			return new \OC\Activity\EventMerger(
780 780
 				$c->getL10N('lib')
781 781
 			);
782 782
 		});
783 783
 		$this->registerAlias(IValidator::class, Validator::class);
784 784
 
785
-		$this->registerService(AvatarManager::class, function (Server $c) {
785
+		$this->registerService(AvatarManager::class, function(Server $c) {
786 786
 			return new AvatarManager(
787 787
 				$c->get(IUserSession::class),
788 788
 				$c->get(\OC\User\Manager::class),
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
 		$this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class);
804 804
 		$this->registerAlias(\OCP\Support\Subscription\IAssertion::class, \OC\Support\Subscription\Assertion::class);
805 805
 
806
-		$this->registerService(\OC\Log::class, function (Server $c) {
806
+		$this->registerService(\OC\Log::class, function(Server $c) {
807 807
 			$logType = $c->get(AllConfig::class)->getSystemValue('log_type', 'file');
808 808
 			$factory = new LogFactory($c, $this->get(SystemConfig::class));
809 809
 			$logger = $factory->get($logType);
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
 		// PSR-3 logger
818 818
 		$this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class);
819 819
 
820
-		$this->registerService(ILogFactory::class, function (Server $c) {
820
+		$this->registerService(ILogFactory::class, function(Server $c) {
821 821
 			return new LogFactory($c, $this->get(SystemConfig::class));
822 822
 		});
823 823
 
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
 		/** @deprecated 19.0.0 */
826 826
 		$this->registerDeprecatedAlias('JobList', IJobList::class);
827 827
 
828
-		$this->registerService(Router::class, function (Server $c) {
828
+		$this->registerService(Router::class, function(Server $c) {
829 829
 			$cacheFactory = $c->get(ICacheFactory::class);
830 830
 			if ($cacheFactory->isLocalCacheAvailable()) {
831 831
 				$router = $c->resolve(CachingRouter::class);
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
 		/** @deprecated 19.0.0 */
843 843
 		$this->registerDeprecatedAlias('Search', ISearch::class);
844 844
 
845
-		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) {
845
+		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) {
846 846
 			$cacheFactory = $c->get(ICacheFactory::class);
847 847
 			if ($cacheFactory->isAvailable()) {
848 848
 				$backend = new \OC\Security\RateLimiting\Backend\MemoryCacheBackend(
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
 		$this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class);
879 879
 
880 880
 		$this->registerAlias(IDBConnection::class, ConnectionAdapter::class);
881
-		$this->registerService(Connection::class, function (Server $c) {
881
+		$this->registerService(Connection::class, function(Server $c) {
882 882
 			$systemConfig = $c->get(SystemConfig::class);
883 883
 			$factory = new \OC\DB\ConnectionFactory($systemConfig);
884 884
 			$type = $systemConfig->getValue('dbtype', 'sqlite');
@@ -894,19 +894,19 @@  discard block
 block discarded – undo
894 894
 
895 895
 		$this->registerAlias(ICertificateManager::class, CertificateManager::class);
896 896
 		$this->registerAlias(IClientService::class, ClientService::class);
897
-		$this->registerService(NegativeDnsCache::class, function (ContainerInterface $c) {
897
+		$this->registerService(NegativeDnsCache::class, function(ContainerInterface $c) {
898 898
 			return new NegativeDnsCache(
899 899
 				$c->get(ICacheFactory::class),
900 900
 			);
901 901
 		});
902 902
 		$this->registerDeprecatedAlias('HttpClientService', IClientService::class);
903
-		$this->registerService(IEventLogger::class, function (ContainerInterface $c) {
903
+		$this->registerService(IEventLogger::class, function(ContainerInterface $c) {
904 904
 			return new EventLogger($c->get(SystemConfig::class), $c->get(LoggerInterface::class), $c->get(Log::class));
905 905
 		});
906 906
 		/** @deprecated 19.0.0 */
907 907
 		$this->registerDeprecatedAlias('EventLogger', IEventLogger::class);
908 908
 
909
-		$this->registerService(IQueryLogger::class, function (ContainerInterface $c) {
909
+		$this->registerService(IQueryLogger::class, function(ContainerInterface $c) {
910 910
 			$queryLogger = new QueryLogger();
911 911
 			if ($c->get(SystemConfig::class)->getValue('debug', false)) {
912 912
 				// In debug mode, module is being activated by default
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
 		$this->registerDeprecatedAlias('TempManager', TempManager::class);
922 922
 		$this->registerAlias(ITempManager::class, TempManager::class);
923 923
 
924
-		$this->registerService(AppManager::class, function (ContainerInterface $c) {
924
+		$this->registerService(AppManager::class, function(ContainerInterface $c) {
925 925
 			// TODO: use auto-wiring
926 926
 			return new \OC\App\AppManager(
927 927
 				$c->get(IUserSession::class),
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
 		/** @deprecated 19.0.0 */
943 943
 		$this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class);
944 944
 
945
-		$this->registerService(IDateTimeFormatter::class, function (Server $c) {
945
+		$this->registerService(IDateTimeFormatter::class, function(Server $c) {
946 946
 			$language = $c->get(\OCP\IConfig::class)->getUserValue($c->get(ISession::class)->get('user_id'), 'core', 'lang', null);
947 947
 
948 948
 			return new DateTimeFormatter(
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
 		/** @deprecated 19.0.0 */
954 954
 		$this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class);
955 955
 
956
-		$this->registerService(IUserMountCache::class, function (ContainerInterface $c) {
956
+		$this->registerService(IUserMountCache::class, function(ContainerInterface $c) {
957 957
 			$mountCache = $c->get(UserMountCache::class);
958 958
 			$listener = new UserMountCacheListener($mountCache);
959 959
 			$listener->listen($c->get(IUserManager::class));
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
 		/** @deprecated 19.0.0 */
963 963
 		$this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class);
964 964
 
965
-		$this->registerService(IMountProviderCollection::class, function (ContainerInterface $c) {
965
+		$this->registerService(IMountProviderCollection::class, function(ContainerInterface $c) {
966 966
 			$loader = $c->get(IStorageFactory::class);
967 967
 			$mountCache = $c->get(IUserMountCache::class);
968 968
 			$eventLogger = $c->get(IEventLogger::class);
@@ -985,7 +985,7 @@  discard block
 block discarded – undo
985 985
 
986 986
 		/** @deprecated 20.0.0 */
987 987
 		$this->registerDeprecatedAlias('IniWrapper', IniGetWrapper::class);
988
-		$this->registerService(IBus::class, function (ContainerInterface $c) {
988
+		$this->registerService(IBus::class, function(ContainerInterface $c) {
989 989
 			$busClass = $c->get(\OCP\IConfig::class)->getSystemValue('commandbus');
990 990
 			if ($busClass) {
991 991
 				[$app, $class] = explode('::', $busClass, 2);
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
 		/** @deprecated 19.0.0 */
1008 1008
 		$this->registerDeprecatedAlias('Throttler', Throttler::class);
1009 1009
 		$this->registerAlias(IThrottler::class, Throttler::class);
1010
-		$this->registerService('IntegrityCodeChecker', function (ContainerInterface $c) {
1010
+		$this->registerService('IntegrityCodeChecker', function(ContainerInterface $c) {
1011 1011
 			// IConfig and IAppManager requires a working database. This code
1012 1012
 			// might however be called when ownCloud is not yet setup.
1013 1013
 			if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) {
@@ -1028,7 +1028,7 @@  discard block
 block discarded – undo
1028 1028
 				$c->get(IMimeTypeDetector::class)
1029 1029
 			);
1030 1030
 		});
1031
-		$this->registerService(\OCP\IRequest::class, function (ContainerInterface $c) {
1031
+		$this->registerService(\OCP\IRequest::class, function(ContainerInterface $c) {
1032 1032
 			if (isset($this['urlParams'])) {
1033 1033
 				$urlParams = $this['urlParams'];
1034 1034
 			} else {
@@ -1065,14 +1065,14 @@  discard block
 block discarded – undo
1065 1065
 		/** @deprecated 19.0.0 */
1066 1066
 		$this->registerDeprecatedAlias('Request', \OCP\IRequest::class);
1067 1067
 
1068
-		$this->registerService(IRequestId::class, function (ContainerInterface $c): IRequestId {
1068
+		$this->registerService(IRequestId::class, function(ContainerInterface $c): IRequestId {
1069 1069
 			return new RequestId(
1070 1070
 				$_SERVER['UNIQUE_ID'] ?? '',
1071 1071
 				$this->get(ISecureRandom::class)
1072 1072
 			);
1073 1073
 		});
1074 1074
 
1075
-		$this->registerService(IMailer::class, function (Server $c) {
1075
+		$this->registerService(IMailer::class, function(Server $c) {
1076 1076
 			return new Mailer(
1077 1077
 				$c->get(\OCP\IConfig::class),
1078 1078
 				$c->get(LoggerInterface::class),
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
 		/** @deprecated 21.0.0 */
1090 1090
 		$this->registerDeprecatedAlias('LDAPProvider', ILDAPProvider::class);
1091 1091
 
1092
-		$this->registerService(ILDAPProviderFactory::class, function (ContainerInterface $c) {
1092
+		$this->registerService(ILDAPProviderFactory::class, function(ContainerInterface $c) {
1093 1093
 			$config = $c->get(\OCP\IConfig::class);
1094 1094
 			$factoryClass = $config->getSystemValue('ldapProviderFactory', null);
1095 1095
 			if (is_null($factoryClass) || !class_exists($factoryClass)) {
@@ -1098,11 +1098,11 @@  discard block
 block discarded – undo
1098 1098
 			/** @var \OCP\LDAP\ILDAPProviderFactory $factory */
1099 1099
 			return new $factoryClass($this);
1100 1100
 		});
1101
-		$this->registerService(ILDAPProvider::class, function (ContainerInterface $c) {
1101
+		$this->registerService(ILDAPProvider::class, function(ContainerInterface $c) {
1102 1102
 			$factory = $c->get(ILDAPProviderFactory::class);
1103 1103
 			return $factory->getLDAPProvider();
1104 1104
 		});
1105
-		$this->registerService(ILockingProvider::class, function (ContainerInterface $c) {
1105
+		$this->registerService(ILockingProvider::class, function(ContainerInterface $c) {
1106 1106
 			$ini = $c->get(IniGetWrapper::class);
1107 1107
 			$config = $c->get(\OCP\IConfig::class);
1108 1108
 			$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
@@ -1125,12 +1125,12 @@  discard block
 block discarded – undo
1125 1125
 		/** @deprecated 19.0.0 */
1126 1126
 		$this->registerDeprecatedAlias('LockingProvider', ILockingProvider::class);
1127 1127
 
1128
-		$this->registerService(ILockManager::class, function (Server $c): LockManager {
1128
+		$this->registerService(ILockManager::class, function(Server $c): LockManager {
1129 1129
 			return new LockManager();
1130 1130
 		});
1131 1131
 
1132 1132
 		$this->registerAlias(ILockdownManager::class, 'LockdownManager');
1133
-		$this->registerService(SetupManager::class, function ($c) {
1133
+		$this->registerService(SetupManager::class, function($c) {
1134 1134
 			// create the setupmanager through the mount manager to resolve the cyclic dependency
1135 1135
 			return $c->get(\OC\Files\Mount\Manager::class)->getSetupManager();
1136 1136
 		});
@@ -1138,12 +1138,12 @@  discard block
 block discarded – undo
1138 1138
 		/** @deprecated 19.0.0 */
1139 1139
 		$this->registerDeprecatedAlias('MountManager', IMountManager::class);
1140 1140
 
1141
-		$this->registerService(IMimeTypeDetector::class, function (ContainerInterface $c) {
1141
+		$this->registerService(IMimeTypeDetector::class, function(ContainerInterface $c) {
1142 1142
 			return new \OC\Files\Type\Detection(
1143 1143
 				$c->get(IURLGenerator::class),
1144 1144
 				$c->get(LoggerInterface::class),
1145 1145
 				\OC::$configDir,
1146
-				\OC::$SERVERROOT . '/resources/config/'
1146
+				\OC::$SERVERROOT.'/resources/config/'
1147 1147
 			);
1148 1148
 		});
1149 1149
 		/** @deprecated 19.0.0 */
@@ -1152,22 +1152,22 @@  discard block
 block discarded – undo
1152 1152
 		$this->registerAlias(IMimeTypeLoader::class, Loader::class);
1153 1153
 		/** @deprecated 19.0.0 */
1154 1154
 		$this->registerDeprecatedAlias('MimeTypeLoader', IMimeTypeLoader::class);
1155
-		$this->registerService(BundleFetcher::class, function () {
1155
+		$this->registerService(BundleFetcher::class, function() {
1156 1156
 			return new BundleFetcher($this->getL10N('lib'));
1157 1157
 		});
1158 1158
 		$this->registerAlias(\OCP\Notification\IManager::class, Manager::class);
1159 1159
 		/** @deprecated 19.0.0 */
1160 1160
 		$this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class);
1161 1161
 
1162
-		$this->registerService(CapabilitiesManager::class, function (ContainerInterface $c) {
1162
+		$this->registerService(CapabilitiesManager::class, function(ContainerInterface $c) {
1163 1163
 			$manager = new CapabilitiesManager($c->get(LoggerInterface::class));
1164
-			$manager->registerCapability(function () use ($c) {
1164
+			$manager->registerCapability(function() use ($c) {
1165 1165
 				return new \OC\OCS\CoreCapabilities($c->get(\OCP\IConfig::class));
1166 1166
 			});
1167
-			$manager->registerCapability(function () use ($c) {
1167
+			$manager->registerCapability(function() use ($c) {
1168 1168
 				return $c->get(\OC\Security\Bruteforce\Capabilities::class);
1169 1169
 			});
1170
-			$manager->registerCapability(function () use ($c) {
1170
+			$manager->registerCapability(function() use ($c) {
1171 1171
 				return $c->get(MetadataCapabilities::class);
1172 1172
 			});
1173 1173
 			return $manager;
@@ -1175,14 +1175,14 @@  discard block
 block discarded – undo
1175 1175
 		/** @deprecated 19.0.0 */
1176 1176
 		$this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class);
1177 1177
 
1178
-		$this->registerService(ICommentsManager::class, function (Server $c) {
1178
+		$this->registerService(ICommentsManager::class, function(Server $c) {
1179 1179
 			$config = $c->get(\OCP\IConfig::class);
1180 1180
 			$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class);
1181 1181
 			/** @var \OCP\Comments\ICommentsManagerFactory $factory */
1182 1182
 			$factory = new $factoryClass($this);
1183 1183
 			$manager = $factory->getManager();
1184 1184
 
1185
-			$manager->registerDisplayNameResolver('user', function ($id) use ($c) {
1185
+			$manager->registerDisplayNameResolver('user', function($id) use ($c) {
1186 1186
 				$manager = $c->get(IUserManager::class);
1187 1187
 				$userDisplayName = $manager->getDisplayName($id);
1188 1188
 				if ($userDisplayName === null) {
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
 		$this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class);
1199 1199
 
1200 1200
 		$this->registerAlias(\OC_Defaults::class, 'ThemingDefaults');
1201
-		$this->registerService('ThemingDefaults', function (Server $c) {
1201
+		$this->registerService('ThemingDefaults', function(Server $c) {
1202 1202
 			try {
1203 1203
 				$classExists = class_exists('OCA\Theming\ThemingDefaults');
1204 1204
 			} catch (\OCP\AutoloadNotAllowedException $e) {
@@ -1229,7 +1229,7 @@  discard block
 block discarded – undo
1229 1229
 			}
1230 1230
 			return new \OC_Defaults();
1231 1231
 		});
1232
-		$this->registerService(JSCombiner::class, function (Server $c) {
1232
+		$this->registerService(JSCombiner::class, function(Server $c) {
1233 1233
 			return new JSCombiner(
1234 1234
 				$c->getAppDataDir('js'),
1235 1235
 				$c->get(IURLGenerator::class),
@@ -1243,7 +1243,7 @@  discard block
 block discarded – undo
1243 1243
 		$this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class);
1244 1244
 		$this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class);
1245 1245
 
1246
-		$this->registerService('CryptoWrapper', function (ContainerInterface $c) {
1246
+		$this->registerService('CryptoWrapper', function(ContainerInterface $c) {
1247 1247
 			// FIXME: Instantiated here due to cyclic dependency
1248 1248
 			$request = new Request(
1249 1249
 				[
@@ -1270,14 +1270,14 @@  discard block
 block discarded – undo
1270 1270
 		});
1271 1271
 		/** @deprecated 19.0.0 */
1272 1272
 		$this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class);
1273
-		$this->registerService(SessionStorage::class, function (ContainerInterface $c) {
1273
+		$this->registerService(SessionStorage::class, function(ContainerInterface $c) {
1274 1274
 			return new SessionStorage($c->get(ISession::class));
1275 1275
 		});
1276 1276
 		$this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class);
1277 1277
 		/** @deprecated 19.0.0 */
1278 1278
 		$this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class);
1279 1279
 
1280
-		$this->registerService(\OCP\Share\IManager::class, function (IServerContainer $c) {
1280
+		$this->registerService(\OCP\Share\IManager::class, function(IServerContainer $c) {
1281 1281
 			$config = $c->get(\OCP\IConfig::class);
1282 1282
 			$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class);
1283 1283
 			/** @var \OCP\Share\IProviderFactory $factory */
@@ -1309,7 +1309,7 @@  discard block
 block discarded – undo
1309 1309
 		/** @deprecated 19.0.0 */
1310 1310
 		$this->registerDeprecatedAlias('ShareManager', \OCP\Share\IManager::class);
1311 1311
 
1312
-		$this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) {
1312
+		$this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function(Server $c) {
1313 1313
 			$instance = new Collaboration\Collaborators\Search($c);
1314 1314
 
1315 1315
 			// register default plugins
@@ -1334,27 +1334,27 @@  discard block
 block discarded – undo
1334 1334
 
1335 1335
 		$this->registerDeprecatedAlias('SettingsManager', \OC\Settings\Manager::class);
1336 1336
 		$this->registerAlias(\OCP\Settings\IManager::class, \OC\Settings\Manager::class);
1337
-		$this->registerService(\OC\Files\AppData\Factory::class, function (ContainerInterface $c) {
1337
+		$this->registerService(\OC\Files\AppData\Factory::class, function(ContainerInterface $c) {
1338 1338
 			return new \OC\Files\AppData\Factory(
1339 1339
 				$c->get(IRootFolder::class),
1340 1340
 				$c->get(SystemConfig::class)
1341 1341
 			);
1342 1342
 		});
1343 1343
 
1344
-		$this->registerService('LockdownManager', function (ContainerInterface $c) {
1345
-			return new LockdownManager(function () use ($c) {
1344
+		$this->registerService('LockdownManager', function(ContainerInterface $c) {
1345
+			return new LockdownManager(function() use ($c) {
1346 1346
 				return $c->get(ISession::class);
1347 1347
 			});
1348 1348
 		});
1349 1349
 
1350
-		$this->registerService(\OCP\OCS\IDiscoveryService::class, function (ContainerInterface $c) {
1350
+		$this->registerService(\OCP\OCS\IDiscoveryService::class, function(ContainerInterface $c) {
1351 1351
 			return new DiscoveryService(
1352 1352
 				$c->get(ICacheFactory::class),
1353 1353
 				$c->get(IClientService::class)
1354 1354
 			);
1355 1355
 		});
1356 1356
 
1357
-		$this->registerService(ICloudIdManager::class, function (ContainerInterface $c) {
1357
+		$this->registerService(ICloudIdManager::class, function(ContainerInterface $c) {
1358 1358
 			return new CloudIdManager(
1359 1359
 				$c->get(\OCP\Contacts\IManager::class),
1360 1360
 				$c->get(IURLGenerator::class),
@@ -1366,7 +1366,7 @@  discard block
 block discarded – undo
1366 1366
 
1367 1367
 		$this->registerAlias(\OCP\GlobalScale\IConfig::class, \OC\GlobalScale\Config::class);
1368 1368
 
1369
-		$this->registerService(ICloudFederationProviderManager::class, function (ContainerInterface $c) {
1369
+		$this->registerService(ICloudFederationProviderManager::class, function(ContainerInterface $c) {
1370 1370
 			return new CloudFederationProviderManager(
1371 1371
 				$c->get(IAppManager::class),
1372 1372
 				$c->get(IClientService::class),
@@ -1375,7 +1375,7 @@  discard block
 block discarded – undo
1375 1375
 			);
1376 1376
 		});
1377 1377
 
1378
-		$this->registerService(ICloudFederationFactory::class, function (Server $c) {
1378
+		$this->registerService(ICloudFederationFactory::class, function(Server $c) {
1379 1379
 			return new CloudFederationFactory();
1380 1380
 		});
1381 1381
 
@@ -1388,7 +1388,7 @@  discard block
 block discarded – undo
1388 1388
 		/** @deprecated 19.0.0 */
1389 1389
 		$this->registerDeprecatedAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class);
1390 1390
 
1391
-		$this->registerService(Defaults::class, function (Server $c) {
1391
+		$this->registerService(Defaults::class, function(Server $c) {
1392 1392
 			return new Defaults(
1393 1393
 				$c->getThemingDefaults()
1394 1394
 			);
@@ -1396,17 +1396,17 @@  discard block
 block discarded – undo
1396 1396
 		/** @deprecated 19.0.0 */
1397 1397
 		$this->registerDeprecatedAlias('Defaults', \OCP\Defaults::class);
1398 1398
 
1399
-		$this->registerService(\OCP\ISession::class, function (ContainerInterface $c) {
1399
+		$this->registerService(\OCP\ISession::class, function(ContainerInterface $c) {
1400 1400
 			return $c->get(\OCP\IUserSession::class)->getSession();
1401 1401
 		}, false);
1402 1402
 
1403
-		$this->registerService(IShareHelper::class, function (ContainerInterface $c) {
1403
+		$this->registerService(IShareHelper::class, function(ContainerInterface $c) {
1404 1404
 			return new ShareHelper(
1405 1405
 				$c->get(\OCP\Share\IManager::class)
1406 1406
 			);
1407 1407
 		});
1408 1408
 
1409
-		$this->registerService(Installer::class, function (ContainerInterface $c) {
1409
+		$this->registerService(Installer::class, function(ContainerInterface $c) {
1410 1410
 			return new Installer(
1411 1411
 				$c->get(AppFetcher::class),
1412 1412
 				$c->get(IClientService::class),
@@ -1417,11 +1417,11 @@  discard block
 block discarded – undo
1417 1417
 			);
1418 1418
 		});
1419 1419
 
1420
-		$this->registerService(IApiFactory::class, function (ContainerInterface $c) {
1420
+		$this->registerService(IApiFactory::class, function(ContainerInterface $c) {
1421 1421
 			return new ApiFactory($c->get(IClientService::class));
1422 1422
 		});
1423 1423
 
1424
-		$this->registerService(IInstanceFactory::class, function (ContainerInterface $c) {
1424
+		$this->registerService(IInstanceFactory::class, function(ContainerInterface $c) {
1425 1425
 			$memcacheFactory = $c->get(ICacheFactory::class);
1426 1426
 			return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->get(IClientService::class));
1427 1427
 		});
@@ -2361,11 +2361,11 @@  discard block
 block discarded – undo
2361 2361
 	}
2362 2362
 
2363 2363
 	private function registerDeprecatedAlias(string $alias, string $target) {
2364
-		$this->registerService($alias, function (ContainerInterface $container) use ($target, $alias) {
2364
+		$this->registerService($alias, function(ContainerInterface $container) use ($target, $alias) {
2365 2365
 			try {
2366 2366
 				/** @var LoggerInterface $logger */
2367 2367
 				$logger = $container->get(LoggerInterface::class);
2368
-				$logger->debug('The requested alias "' . $alias . '" is deprecated. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']);
2368
+				$logger->debug('The requested alias "'.$alias.'" is deprecated. Please request "'.$target.'" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']);
2369 2369
 			} catch (ContainerExceptionInterface $e) {
2370 2370
 				// Could not get logger. Continue
2371 2371
 			}
Please login to merge, or discard this patch.
apps/theming/composer/autoload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,6 +20,6 @@
 block discarded – undo
20 20
     );
21 21
 }
22 22
 
23
-require_once __DIR__ . '/composer/autoload_real.php';
23
+require_once __DIR__.'/composer/autoload_real.php';
24 24
 
25 25
 return ComposerAutoloaderInitTheming::getLoader();
Please login to merge, or discard this patch.
apps/theming/composer/composer/installed.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
         'version' => 'dev-master',
6 6
         'reference' => '20912695daee931f54263e48159f9dd44ab1dad1',
7 7
         'type' => 'library',
8
-        'install_path' => __DIR__ . '/../',
8
+        'install_path' => __DIR__.'/../',
9 9
         'aliases' => array(),
10 10
         'dev' => false,
11 11
     ),
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
             'version' => 'dev-master',
16 16
             'reference' => '20912695daee931f54263e48159f9dd44ab1dad1',
17 17
             'type' => 'library',
18
-            'install_path' => __DIR__ . '/../',
18
+            'install_path' => __DIR__.'/../',
19 19
             'aliases' => array(),
20 20
             'dev_requirement' => false,
21 21
         ),
Please login to merge, or discard this patch.
apps/theming/composer/composer/autoload_real.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     public static function loadClassLoader($class)
10 10
     {
11 11
         if ('Composer\Autoload\ClassLoader' === $class) {
12
-            require __DIR__ . '/ClassLoader.php';
12
+            require __DIR__.'/ClassLoader.php';
13 13
         }
14 14
     }
15 15
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
27 27
         spl_autoload_unregister(array('ComposerAutoloaderInitTheming', 'loadClassLoader'));
28 28
 
29
-        require __DIR__ . '/autoload_static.php';
29
+        require __DIR__.'/autoload_static.php';
30 30
         call_user_func(\Composer\Autoload\ComposerStaticInitTheming::getInitializer($loader));
31 31
 
32 32
         $loader->setClassMapAuthoritative(true);
Please login to merge, or discard this patch.
apps/theming/composer/composer/ClassLoader.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -370,18 +370,18 @@  discard block
 block discarded – undo
370 370
     private function findFileWithExtension($class, $ext)
371 371
     {
372 372
         // PSR-4 lookup
373
-        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
373
+        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR).$ext;
374 374
 
375 375
         $first = $class[0];
376 376
         if (isset($this->prefixLengthsPsr4[$first])) {
377 377
             $subPath = $class;
378 378
             while (false !== $lastPos = strrpos($subPath, '\\')) {
379 379
                 $subPath = substr($subPath, 0, $lastPos);
380
-                $search = $subPath . '\\';
380
+                $search = $subPath.'\\';
381 381
                 if (isset($this->prefixDirsPsr4[$search])) {
382
-                    $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
382
+                    $pathEnd = DIRECTORY_SEPARATOR.substr($logicalPathPsr4, $lastPos + 1);
383 383
                     foreach ($this->prefixDirsPsr4[$search] as $dir) {
384
-                        if (file_exists($file = $dir . $pathEnd)) {
384
+                        if (file_exists($file = $dir.$pathEnd)) {
385 385
                             return $file;
386 386
                         }
387 387
                     }
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 
392 392
         // PSR-4 fallback dirs
393 393
         foreach ($this->fallbackDirsPsr4 as $dir) {
394
-            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
394
+            if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr4)) {
395 395
                 return $file;
396 396
             }
397 397
         }
@@ -403,14 +403,14 @@  discard block
 block discarded – undo
403 403
                 . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
404 404
         } else {
405 405
             // PEAR-like class name
406
-            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
406
+            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR).$ext;
407 407
         }
408 408
 
409 409
         if (isset($this->prefixesPsr0[$first])) {
410 410
             foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
411 411
                 if (0 === strpos($class, $prefix)) {
412 412
                     foreach ($dirs as $dir) {
413
-                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
413
+                        if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) {
414 414
                             return $file;
415 415
                         }
416 416
                     }
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 
421 421
         // PSR-0 fallback dirs
422 422
         foreach ($this->fallbackDirsPsr0 as $dir) {
423
-            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
423
+            if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) {
424 424
                 return $file;
425 425
             }
426 426
         }
Please login to merge, or discard this patch.
apps/theming/composer/composer/InstalledVersions.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             return implode(' || ', $ranges);
159 159
         }
160 160
 
161
-        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
161
+        throw new \OutOfBoundsException('Package "'.$packageName.'" is not installed');
162 162
     }
163 163
 
164 164
     /**
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             return $installed['versions'][$packageName]['version'];
180 180
         }
181 181
 
182
-        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
182
+        throw new \OutOfBoundsException('Package "'.$packageName.'" is not installed');
183 183
     }
184 184
 
185 185
     /**
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
             return $installed['versions'][$packageName]['pretty_version'];
201 201
         }
202 202
 
203
-        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
203
+        throw new \OutOfBoundsException('Package "'.$packageName.'" is not installed');
204 204
     }
205 205
 
206 206
     /**
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             return $installed['versions'][$packageName]['reference'];
222 222
         }
223 223
 
224
-        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
224
+        throw new \OutOfBoundsException('Package "'.$packageName.'" is not installed');
225 225
     }
226 226
 
227 227
     /**
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
             return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
239 239
         }
240 240
 
241
-        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
241
+        throw new \OutOfBoundsException('Package "'.$packageName.'" is not installed');
242 242
     }
243 243
 
244 244
     /**
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
             // only require the installed.php file if this file is loaded from its dumped location,
268 268
             // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
269 269
             if (substr(__DIR__, -8, 1) !== 'C') {
270
-                self::$installed = include __DIR__ . '/installed.php';
270
+                self::$installed = include __DIR__.'/installed.php';
271 271
             } else {
272 272
                 self::$installed = array();
273 273
             }
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
             // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
344 344
             if (substr(__DIR__, -8, 1) !== 'C') {
345 345
                 /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
346
-                $required = require __DIR__ . '/installed.php';
346
+                $required = require __DIR__.'/installed.php';
347 347
                 self::$installed = $required;
348 348
             } else {
349 349
                 self::$installed = array();
Please login to merge, or discard this patch.
apps/theming/composer/composer/autoload_static.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -6,59 +6,59 @@
 block discarded – undo
6 6
 
7 7
 class ComposerStaticInitTheming
8 8
 {
9
-    public static $prefixLengthsPsr4 = array (
9
+    public static $prefixLengthsPsr4 = array(
10 10
         'O' => 
11
-        array (
11
+        array(
12 12
             'OCA\\Theming\\' => 12,
13 13
         ),
14 14
     );
15 15
 
16
-    public static $prefixDirsPsr4 = array (
16
+    public static $prefixDirsPsr4 = array(
17 17
         'OCA\\Theming\\' => 
18
-        array (
19
-            0 => __DIR__ . '/..' . '/../lib',
18
+        array(
19
+            0 => __DIR__.'/..'.'/../lib',
20 20
         ),
21 21
     );
22 22
 
23
-    public static $classMap = array (
24
-        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
25
-        'OCA\\Theming\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
26
-        'OCA\\Theming\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php',
27
-        'OCA\\Theming\\Command\\UpdateConfig' => __DIR__ . '/..' . '/../lib/Command/UpdateConfig.php',
28
-        'OCA\\Theming\\Controller\\IconController' => __DIR__ . '/..' . '/../lib/Controller/IconController.php',
29
-        'OCA\\Theming\\Controller\\ThemingController' => __DIR__ . '/..' . '/../lib/Controller/ThemingController.php',
30
-        'OCA\\Theming\\Controller\\UserThemeController' => __DIR__ . '/..' . '/../lib/Controller/UserThemeController.php',
31
-        'OCA\\Theming\\ITheme' => __DIR__ . '/..' . '/../lib/ITheme.php',
32
-        'OCA\\Theming\\IconBuilder' => __DIR__ . '/..' . '/../lib/IconBuilder.php',
33
-        'OCA\\Theming\\ImageManager' => __DIR__ . '/..' . '/../lib/ImageManager.php',
34
-        'OCA\\Theming\\Jobs\\MigrateBackgroundImages' => __DIR__ . '/..' . '/../lib/Jobs/MigrateBackgroundImages.php',
35
-        'OCA\\Theming\\Listener\\BeforePreferenceListener' => __DIR__ . '/..' . '/../lib/Listener/BeforePreferenceListener.php',
36
-        'OCA\\Theming\\Listener\\BeforeTemplateRenderedListener' => __DIR__ . '/..' . '/../lib/Listener/BeforeTemplateRenderedListener.php',
37
-        'OCA\\Theming\\Migration\\InitBackgroundImagesMigration' => __DIR__ . '/..' . '/../lib/Migration/InitBackgroundImagesMigration.php',
38
-        'OCA\\Theming\\Migration\\MigrateAdminConfig' => __DIR__ . '/..' . '/../lib/Migration/MigrateAdminConfig.php',
39
-        'OCA\\Theming\\Migration\\MigrateUserConfig' => __DIR__ . '/..' . '/../lib/Migration/MigrateUserConfig.php',
40
-        'OCA\\Theming\\Service\\BackgroundService' => __DIR__ . '/..' . '/../lib/Service/BackgroundService.php',
41
-        'OCA\\Theming\\Service\\JSDataService' => __DIR__ . '/..' . '/../lib/Service/JSDataService.php',
42
-        'OCA\\Theming\\Service\\ThemeInjectionService' => __DIR__ . '/..' . '/../lib/Service/ThemeInjectionService.php',
43
-        'OCA\\Theming\\Service\\ThemesService' => __DIR__ . '/..' . '/../lib/Service/ThemesService.php',
44
-        'OCA\\Theming\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php',
45
-        'OCA\\Theming\\Settings\\AdminSection' => __DIR__ . '/..' . '/../lib/Settings/AdminSection.php',
46
-        'OCA\\Theming\\Settings\\Personal' => __DIR__ . '/..' . '/../lib/Settings/Personal.php',
47
-        'OCA\\Theming\\Settings\\PersonalSection' => __DIR__ . '/..' . '/../lib/Settings/PersonalSection.php',
48
-        'OCA\\Theming\\Themes\\CommonThemeTrait' => __DIR__ . '/..' . '/../lib/Themes/CommonThemeTrait.php',
49
-        'OCA\\Theming\\Themes\\DarkHighContrastTheme' => __DIR__ . '/..' . '/../lib/Themes/DarkHighContrastTheme.php',
50
-        'OCA\\Theming\\Themes\\DarkTheme' => __DIR__ . '/..' . '/../lib/Themes/DarkTheme.php',
51
-        'OCA\\Theming\\Themes\\DefaultTheme' => __DIR__ . '/..' . '/../lib/Themes/DefaultTheme.php',
52
-        'OCA\\Theming\\Themes\\DyslexiaFont' => __DIR__ . '/..' . '/../lib/Themes/DyslexiaFont.php',
53
-        'OCA\\Theming\\Themes\\HighContrastTheme' => __DIR__ . '/..' . '/../lib/Themes/HighContrastTheme.php',
54
-        'OCA\\Theming\\Themes\\LightTheme' => __DIR__ . '/..' . '/../lib/Themes/LightTheme.php',
55
-        'OCA\\Theming\\ThemingDefaults' => __DIR__ . '/..' . '/../lib/ThemingDefaults.php',
56
-        'OCA\\Theming\\Util' => __DIR__ . '/..' . '/../lib/Util.php',
23
+    public static $classMap = array(
24
+        'Composer\\InstalledVersions' => __DIR__.'/..'.'/composer/InstalledVersions.php',
25
+        'OCA\\Theming\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php',
26
+        'OCA\\Theming\\Capabilities' => __DIR__.'/..'.'/../lib/Capabilities.php',
27
+        'OCA\\Theming\\Command\\UpdateConfig' => __DIR__.'/..'.'/../lib/Command/UpdateConfig.php',
28
+        'OCA\\Theming\\Controller\\IconController' => __DIR__.'/..'.'/../lib/Controller/IconController.php',
29
+        'OCA\\Theming\\Controller\\ThemingController' => __DIR__.'/..'.'/../lib/Controller/ThemingController.php',
30
+        'OCA\\Theming\\Controller\\UserThemeController' => __DIR__.'/..'.'/../lib/Controller/UserThemeController.php',
31
+        'OCA\\Theming\\ITheme' => __DIR__.'/..'.'/../lib/ITheme.php',
32
+        'OCA\\Theming\\IconBuilder' => __DIR__.'/..'.'/../lib/IconBuilder.php',
33
+        'OCA\\Theming\\ImageManager' => __DIR__.'/..'.'/../lib/ImageManager.php',
34
+        'OCA\\Theming\\Jobs\\MigrateBackgroundImages' => __DIR__.'/..'.'/../lib/Jobs/MigrateBackgroundImages.php',
35
+        'OCA\\Theming\\Listener\\BeforePreferenceListener' => __DIR__.'/..'.'/../lib/Listener/BeforePreferenceListener.php',
36
+        'OCA\\Theming\\Listener\\BeforeTemplateRenderedListener' => __DIR__.'/..'.'/../lib/Listener/BeforeTemplateRenderedListener.php',
37
+        'OCA\\Theming\\Migration\\InitBackgroundImagesMigration' => __DIR__.'/..'.'/../lib/Migration/InitBackgroundImagesMigration.php',
38
+        'OCA\\Theming\\Migration\\MigrateAdminConfig' => __DIR__.'/..'.'/../lib/Migration/MigrateAdminConfig.php',
39
+        'OCA\\Theming\\Migration\\MigrateUserConfig' => __DIR__.'/..'.'/../lib/Migration/MigrateUserConfig.php',
40
+        'OCA\\Theming\\Service\\BackgroundService' => __DIR__.'/..'.'/../lib/Service/BackgroundService.php',
41
+        'OCA\\Theming\\Service\\JSDataService' => __DIR__.'/..'.'/../lib/Service/JSDataService.php',
42
+        'OCA\\Theming\\Service\\ThemeInjectionService' => __DIR__.'/..'.'/../lib/Service/ThemeInjectionService.php',
43
+        'OCA\\Theming\\Service\\ThemesService' => __DIR__.'/..'.'/../lib/Service/ThemesService.php',
44
+        'OCA\\Theming\\Settings\\Admin' => __DIR__.'/..'.'/../lib/Settings/Admin.php',
45
+        'OCA\\Theming\\Settings\\AdminSection' => __DIR__.'/..'.'/../lib/Settings/AdminSection.php',
46
+        'OCA\\Theming\\Settings\\Personal' => __DIR__.'/..'.'/../lib/Settings/Personal.php',
47
+        'OCA\\Theming\\Settings\\PersonalSection' => __DIR__.'/..'.'/../lib/Settings/PersonalSection.php',
48
+        'OCA\\Theming\\Themes\\CommonThemeTrait' => __DIR__.'/..'.'/../lib/Themes/CommonThemeTrait.php',
49
+        'OCA\\Theming\\Themes\\DarkHighContrastTheme' => __DIR__.'/..'.'/../lib/Themes/DarkHighContrastTheme.php',
50
+        'OCA\\Theming\\Themes\\DarkTheme' => __DIR__.'/..'.'/../lib/Themes/DarkTheme.php',
51
+        'OCA\\Theming\\Themes\\DefaultTheme' => __DIR__.'/..'.'/../lib/Themes/DefaultTheme.php',
52
+        'OCA\\Theming\\Themes\\DyslexiaFont' => __DIR__.'/..'.'/../lib/Themes/DyslexiaFont.php',
53
+        'OCA\\Theming\\Themes\\HighContrastTheme' => __DIR__.'/..'.'/../lib/Themes/HighContrastTheme.php',
54
+        'OCA\\Theming\\Themes\\LightTheme' => __DIR__.'/..'.'/../lib/Themes/LightTheme.php',
55
+        'OCA\\Theming\\ThemingDefaults' => __DIR__.'/..'.'/../lib/ThemingDefaults.php',
56
+        'OCA\\Theming\\Util' => __DIR__.'/..'.'/../lib/Util.php',
57 57
     );
58 58
 
59 59
     public static function getInitializer(ClassLoader $loader)
60 60
     {
61
-        return \Closure::bind(function () use ($loader) {
61
+        return \Closure::bind(function() use ($loader) {
62 62
             $loader->prefixLengthsPsr4 = ComposerStaticInitTheming::$prefixLengthsPsr4;
63 63
             $loader->prefixDirsPsr4 = ComposerStaticInitTheming::$prefixDirsPsr4;
64 64
             $loader->classMap = ComposerStaticInitTheming::$classMap;
Please login to merge, or discard this patch.
apps/theming/composer/composer/autoload_classmap.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -6,37 +6,37 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
10
-    'OCA\\Theming\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
11
-    'OCA\\Theming\\Capabilities' => $baseDir . '/../lib/Capabilities.php',
12
-    'OCA\\Theming\\Command\\UpdateConfig' => $baseDir . '/../lib/Command/UpdateConfig.php',
13
-    'OCA\\Theming\\Controller\\IconController' => $baseDir . '/../lib/Controller/IconController.php',
14
-    'OCA\\Theming\\Controller\\ThemingController' => $baseDir . '/../lib/Controller/ThemingController.php',
15
-    'OCA\\Theming\\Controller\\UserThemeController' => $baseDir . '/../lib/Controller/UserThemeController.php',
16
-    'OCA\\Theming\\ITheme' => $baseDir . '/../lib/ITheme.php',
17
-    'OCA\\Theming\\IconBuilder' => $baseDir . '/../lib/IconBuilder.php',
18
-    'OCA\\Theming\\ImageManager' => $baseDir . '/../lib/ImageManager.php',
19
-    'OCA\\Theming\\Jobs\\MigrateBackgroundImages' => $baseDir . '/../lib/Jobs/MigrateBackgroundImages.php',
20
-    'OCA\\Theming\\Listener\\BeforePreferenceListener' => $baseDir . '/../lib/Listener/BeforePreferenceListener.php',
21
-    'OCA\\Theming\\Listener\\BeforeTemplateRenderedListener' => $baseDir . '/../lib/Listener/BeforeTemplateRenderedListener.php',
22
-    'OCA\\Theming\\Migration\\InitBackgroundImagesMigration' => $baseDir . '/../lib/Migration/InitBackgroundImagesMigration.php',
23
-    'OCA\\Theming\\Migration\\MigrateAdminConfig' => $baseDir . '/../lib/Migration/MigrateAdminConfig.php',
24
-    'OCA\\Theming\\Migration\\MigrateUserConfig' => $baseDir . '/../lib/Migration/MigrateUserConfig.php',
25
-    'OCA\\Theming\\Service\\BackgroundService' => $baseDir . '/../lib/Service/BackgroundService.php',
26
-    'OCA\\Theming\\Service\\JSDataService' => $baseDir . '/../lib/Service/JSDataService.php',
27
-    'OCA\\Theming\\Service\\ThemeInjectionService' => $baseDir . '/../lib/Service/ThemeInjectionService.php',
28
-    'OCA\\Theming\\Service\\ThemesService' => $baseDir . '/../lib/Service/ThemesService.php',
29
-    'OCA\\Theming\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php',
30
-    'OCA\\Theming\\Settings\\AdminSection' => $baseDir . '/../lib/Settings/AdminSection.php',
31
-    'OCA\\Theming\\Settings\\Personal' => $baseDir . '/../lib/Settings/Personal.php',
32
-    'OCA\\Theming\\Settings\\PersonalSection' => $baseDir . '/../lib/Settings/PersonalSection.php',
33
-    'OCA\\Theming\\Themes\\CommonThemeTrait' => $baseDir . '/../lib/Themes/CommonThemeTrait.php',
34
-    'OCA\\Theming\\Themes\\DarkHighContrastTheme' => $baseDir . '/../lib/Themes/DarkHighContrastTheme.php',
35
-    'OCA\\Theming\\Themes\\DarkTheme' => $baseDir . '/../lib/Themes/DarkTheme.php',
36
-    'OCA\\Theming\\Themes\\DefaultTheme' => $baseDir . '/../lib/Themes/DefaultTheme.php',
37
-    'OCA\\Theming\\Themes\\DyslexiaFont' => $baseDir . '/../lib/Themes/DyslexiaFont.php',
38
-    'OCA\\Theming\\Themes\\HighContrastTheme' => $baseDir . '/../lib/Themes/HighContrastTheme.php',
39
-    'OCA\\Theming\\Themes\\LightTheme' => $baseDir . '/../lib/Themes/LightTheme.php',
40
-    'OCA\\Theming\\ThemingDefaults' => $baseDir . '/../lib/ThemingDefaults.php',
41
-    'OCA\\Theming\\Util' => $baseDir . '/../lib/Util.php',
9
+    'Composer\\InstalledVersions' => $vendorDir.'/composer/InstalledVersions.php',
10
+    'OCA\\Theming\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php',
11
+    'OCA\\Theming\\Capabilities' => $baseDir.'/../lib/Capabilities.php',
12
+    'OCA\\Theming\\Command\\UpdateConfig' => $baseDir.'/../lib/Command/UpdateConfig.php',
13
+    'OCA\\Theming\\Controller\\IconController' => $baseDir.'/../lib/Controller/IconController.php',
14
+    'OCA\\Theming\\Controller\\ThemingController' => $baseDir.'/../lib/Controller/ThemingController.php',
15
+    'OCA\\Theming\\Controller\\UserThemeController' => $baseDir.'/../lib/Controller/UserThemeController.php',
16
+    'OCA\\Theming\\ITheme' => $baseDir.'/../lib/ITheme.php',
17
+    'OCA\\Theming\\IconBuilder' => $baseDir.'/../lib/IconBuilder.php',
18
+    'OCA\\Theming\\ImageManager' => $baseDir.'/../lib/ImageManager.php',
19
+    'OCA\\Theming\\Jobs\\MigrateBackgroundImages' => $baseDir.'/../lib/Jobs/MigrateBackgroundImages.php',
20
+    'OCA\\Theming\\Listener\\BeforePreferenceListener' => $baseDir.'/../lib/Listener/BeforePreferenceListener.php',
21
+    'OCA\\Theming\\Listener\\BeforeTemplateRenderedListener' => $baseDir.'/../lib/Listener/BeforeTemplateRenderedListener.php',
22
+    'OCA\\Theming\\Migration\\InitBackgroundImagesMigration' => $baseDir.'/../lib/Migration/InitBackgroundImagesMigration.php',
23
+    'OCA\\Theming\\Migration\\MigrateAdminConfig' => $baseDir.'/../lib/Migration/MigrateAdminConfig.php',
24
+    'OCA\\Theming\\Migration\\MigrateUserConfig' => $baseDir.'/../lib/Migration/MigrateUserConfig.php',
25
+    'OCA\\Theming\\Service\\BackgroundService' => $baseDir.'/../lib/Service/BackgroundService.php',
26
+    'OCA\\Theming\\Service\\JSDataService' => $baseDir.'/../lib/Service/JSDataService.php',
27
+    'OCA\\Theming\\Service\\ThemeInjectionService' => $baseDir.'/../lib/Service/ThemeInjectionService.php',
28
+    'OCA\\Theming\\Service\\ThemesService' => $baseDir.'/../lib/Service/ThemesService.php',
29
+    'OCA\\Theming\\Settings\\Admin' => $baseDir.'/../lib/Settings/Admin.php',
30
+    'OCA\\Theming\\Settings\\AdminSection' => $baseDir.'/../lib/Settings/AdminSection.php',
31
+    'OCA\\Theming\\Settings\\Personal' => $baseDir.'/../lib/Settings/Personal.php',
32
+    'OCA\\Theming\\Settings\\PersonalSection' => $baseDir.'/../lib/Settings/PersonalSection.php',
33
+    'OCA\\Theming\\Themes\\CommonThemeTrait' => $baseDir.'/../lib/Themes/CommonThemeTrait.php',
34
+    'OCA\\Theming\\Themes\\DarkHighContrastTheme' => $baseDir.'/../lib/Themes/DarkHighContrastTheme.php',
35
+    'OCA\\Theming\\Themes\\DarkTheme' => $baseDir.'/../lib/Themes/DarkTheme.php',
36
+    'OCA\\Theming\\Themes\\DefaultTheme' => $baseDir.'/../lib/Themes/DefaultTheme.php',
37
+    'OCA\\Theming\\Themes\\DyslexiaFont' => $baseDir.'/../lib/Themes/DyslexiaFont.php',
38
+    'OCA\\Theming\\Themes\\HighContrastTheme' => $baseDir.'/../lib/Themes/HighContrastTheme.php',
39
+    'OCA\\Theming\\Themes\\LightTheme' => $baseDir.'/../lib/Themes/LightTheme.php',
40
+    'OCA\\Theming\\ThemingDefaults' => $baseDir.'/../lib/ThemingDefaults.php',
41
+    'OCA\\Theming\\Util' => $baseDir.'/../lib/Util.php',
42 42
 );
Please login to merge, or discard this patch.