|
@@ -293,10 +293,10 @@ discard block |
|
|
block discarded – undo |
293
|
293
|
$this->registerParameter('isCLI', \OC::$CLI); |
294
|
294
|
$this->registerParameter('serverRoot', \OC::$SERVERROOT); |
295
|
295
|
|
296
|
|
- $this->registerService(ContainerInterface::class, function (ContainerInterface $c) { |
|
296
|
+ $this->registerService(ContainerInterface::class, function(ContainerInterface $c) { |
297
|
297
|
return $c; |
298
|
298
|
}); |
299
|
|
- $this->registerService(\OCP\IServerContainer::class, function (ContainerInterface $c) { |
|
299
|
+ $this->registerService(\OCP\IServerContainer::class, function(ContainerInterface $c) { |
300
|
300
|
return $c; |
301
|
301
|
}); |
302
|
302
|
|
|
@@ -321,11 +321,11 @@ discard block |
|
|
block discarded – undo |
321
|
321
|
|
322
|
322
|
$this->registerAlias(IActionFactory::class, ActionFactory::class); |
323
|
323
|
|
324
|
|
- $this->registerService(View::class, function (Server $c) { |
|
324
|
+ $this->registerService(View::class, function(Server $c) { |
325
|
325
|
return new View(); |
326
|
326
|
}, false); |
327
|
327
|
|
328
|
|
- $this->registerService(IPreview::class, function (ContainerInterface $c) { |
|
328
|
+ $this->registerService(IPreview::class, function(ContainerInterface $c) { |
329
|
329
|
return new PreviewManager( |
330
|
330
|
$c->get(\OCP\IConfig::class), |
331
|
331
|
$c->get(IRootFolder::class), |
|
@@ -345,7 +345,7 @@ discard block |
|
|
block discarded – undo |
345
|
345
|
/** @deprecated 19.0.0 */ |
346
|
346
|
$this->registerDeprecatedAlias('PreviewManager', IPreview::class); |
347
|
347
|
|
348
|
|
- $this->registerService(\OC\Preview\Watcher::class, function (ContainerInterface $c) { |
|
348
|
+ $this->registerService(\OC\Preview\Watcher::class, function(ContainerInterface $c) { |
349
|
349
|
return new \OC\Preview\Watcher( |
350
|
350
|
new \OC\Preview\Storage\Root( |
351
|
351
|
$c->get(IRootFolder::class), |
|
@@ -354,11 +354,11 @@ discard block |
|
|
block discarded – undo |
354
|
354
|
); |
355
|
355
|
}); |
356
|
356
|
|
357
|
|
- $this->registerService(IProfiler::class, function (Server $c) { |
|
357
|
+ $this->registerService(IProfiler::class, function(Server $c) { |
358
|
358
|
return new Profiler($c->get(SystemConfig::class)); |
359
|
359
|
}); |
360
|
360
|
|
361
|
|
- $this->registerService(\OCP\Encryption\IManager::class, function (Server $c): Encryption\Manager { |
|
361
|
+ $this->registerService(\OCP\Encryption\IManager::class, function(Server $c): Encryption\Manager { |
362
|
362
|
$view = new View(); |
363
|
363
|
$util = new Encryption\Util( |
364
|
364
|
$view, |
|
@@ -380,7 +380,7 @@ discard block |
|
|
block discarded – undo |
380
|
380
|
|
381
|
381
|
/** @deprecated 21.0.0 */ |
382
|
382
|
$this->registerDeprecatedAlias('EncryptionFileHelper', IFile::class); |
383
|
|
- $this->registerService(IFile::class, function (ContainerInterface $c) { |
|
383
|
+ $this->registerService(IFile::class, function(ContainerInterface $c) { |
384
|
384
|
$util = new Encryption\Util( |
385
|
385
|
new View(), |
386
|
386
|
$c->get(IUserManager::class), |
|
@@ -396,7 +396,7 @@ discard block |
|
|
block discarded – undo |
396
|
396
|
|
397
|
397
|
/** @deprecated 21.0.0 */ |
398
|
398
|
$this->registerDeprecatedAlias('EncryptionKeyStorage', IStorage::class); |
399
|
|
- $this->registerService(IStorage::class, function (ContainerInterface $c) { |
|
399
|
+ $this->registerService(IStorage::class, function(ContainerInterface $c) { |
400
|
400
|
$view = new View(); |
401
|
401
|
$util = new Encryption\Util( |
402
|
402
|
$view, |
|
@@ -419,22 +419,22 @@ discard block |
|
|
block discarded – undo |
419
|
419
|
/** @deprecated 19.0.0 */ |
420
|
420
|
$this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class); |
421
|
421
|
|
422
|
|
- $this->registerService('SystemTagManagerFactory', function (ContainerInterface $c) { |
|
422
|
+ $this->registerService('SystemTagManagerFactory', function(ContainerInterface $c) { |
423
|
423
|
/** @var \OCP\IConfig $config */ |
424
|
424
|
$config = $c->get(\OCP\IConfig::class); |
425
|
425
|
$factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
426
|
426
|
return new $factoryClass($this); |
427
|
427
|
}); |
428
|
|
- $this->registerService(ISystemTagManager::class, function (ContainerInterface $c) { |
|
428
|
+ $this->registerService(ISystemTagManager::class, function(ContainerInterface $c) { |
429
|
429
|
return $c->get('SystemTagManagerFactory')->getManager(); |
430
|
430
|
}); |
431
|
431
|
/** @deprecated 19.0.0 */ |
432
|
432
|
$this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class); |
433
|
433
|
|
434
|
|
- $this->registerService(ISystemTagObjectMapper::class, function (ContainerInterface $c) { |
|
434
|
+ $this->registerService(ISystemTagObjectMapper::class, function(ContainerInterface $c) { |
435
|
435
|
return $c->get('SystemTagManagerFactory')->getObjectMapper(); |
436
|
436
|
}); |
437
|
|
- $this->registerService('RootFolder', function (ContainerInterface $c) { |
|
437
|
+ $this->registerService('RootFolder', function(ContainerInterface $c) { |
438
|
438
|
$manager = \OC\Files\Filesystem::getMountManager(null); |
439
|
439
|
$view = new View(); |
440
|
440
|
$root = new Root( |
|
@@ -455,7 +455,7 @@ discard block |
|
|
block discarded – undo |
455
|
455
|
|
456
|
456
|
return $root; |
457
|
457
|
}); |
458
|
|
- $this->registerService(HookConnector::class, function (ContainerInterface $c) { |
|
458
|
+ $this->registerService(HookConnector::class, function(ContainerInterface $c) { |
459
|
459
|
return new HookConnector( |
460
|
460
|
$c->get(IRootFolder::class), |
461
|
461
|
new View(), |
|
@@ -467,8 +467,8 @@ discard block |
|
|
block discarded – undo |
467
|
467
|
/** @deprecated 19.0.0 */ |
468
|
468
|
$this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class); |
469
|
469
|
|
470
|
|
- $this->registerService(IRootFolder::class, function (ContainerInterface $c) { |
471
|
|
- return new LazyRoot(function () use ($c) { |
|
470
|
+ $this->registerService(IRootFolder::class, function(ContainerInterface $c) { |
|
471
|
+ return new LazyRoot(function() use ($c) { |
472
|
472
|
return $c->get('RootFolder'); |
473
|
473
|
}); |
474
|
474
|
}); |
|
@@ -479,52 +479,52 @@ discard block |
|
|
block discarded – undo |
479
|
479
|
$this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class); |
480
|
480
|
$this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
481
|
481
|
|
482
|
|
- $this->registerService(DisplayNameCache::class, function (ContainerInterface $c) { |
|
482
|
+ $this->registerService(DisplayNameCache::class, function(ContainerInterface $c) { |
483
|
483
|
return $c->get(\OC\User\Manager::class)->getDisplayNameCache(); |
484
|
484
|
}); |
485
|
485
|
|
486
|
|
- $this->registerService(\OCP\IGroupManager::class, function (ContainerInterface $c) { |
|
486
|
+ $this->registerService(\OCP\IGroupManager::class, function(ContainerInterface $c) { |
487
|
487
|
$groupManager = new \OC\Group\Manager( |
488
|
488
|
$this->get(IUserManager::class), |
489
|
489
|
$c->get(SymfonyAdapter::class), |
490
|
490
|
$this->get(LoggerInterface::class) |
491
|
491
|
); |
492
|
|
- $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
492
|
+ $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
493
|
493
|
/** @var IEventDispatcher $dispatcher */ |
494
|
494
|
$dispatcher = $this->get(IEventDispatcher::class); |
495
|
495
|
$dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid)); |
496
|
496
|
}); |
497
|
|
- $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) { |
|
497
|
+ $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $group) { |
498
|
498
|
/** @var IEventDispatcher $dispatcher */ |
499
|
499
|
$dispatcher = $this->get(IEventDispatcher::class); |
500
|
500
|
$dispatcher->dispatchTyped(new GroupCreatedEvent($group)); |
501
|
501
|
}); |
502
|
|
- $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
502
|
+ $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
503
|
503
|
/** @var IEventDispatcher $dispatcher */ |
504
|
504
|
$dispatcher = $this->get(IEventDispatcher::class); |
505
|
505
|
$dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group)); |
506
|
506
|
}); |
507
|
|
- $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
507
|
+ $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
508
|
508
|
/** @var IEventDispatcher $dispatcher */ |
509
|
509
|
$dispatcher = $this->get(IEventDispatcher::class); |
510
|
510
|
$dispatcher->dispatchTyped(new GroupDeletedEvent($group)); |
511
|
511
|
}); |
512
|
|
- $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
512
|
+ $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
513
|
513
|
/** @var IEventDispatcher $dispatcher */ |
514
|
514
|
$dispatcher = $this->get(IEventDispatcher::class); |
515
|
515
|
$dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user)); |
516
|
516
|
}); |
517
|
|
- $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
517
|
+ $groupManager->listen('\OC\Group', 'postAddUser', 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 UserAddedEvent($group, $user)); |
521
|
521
|
}); |
522
|
|
- $groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
522
|
+ $groupManager->listen('\OC\Group', 'preRemoveUser', 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 BeforeUserRemovedEvent($group, $user)); |
526
|
526
|
}); |
527
|
|
- $groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
527
|
+ $groupManager->listen('\OC\Group', 'postRemoveUser', 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 UserRemovedEvent($group, $user)); |
|
@@ -534,7 +534,7 @@ discard block |
|
|
block discarded – undo |
534
|
534
|
/** @deprecated 19.0.0 */ |
535
|
535
|
$this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class); |
536
|
536
|
|
537
|
|
- $this->registerService(Store::class, function (ContainerInterface $c) { |
|
537
|
+ $this->registerService(Store::class, function(ContainerInterface $c) { |
538
|
538
|
$session = $c->get(ISession::class); |
539
|
539
|
if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) { |
540
|
540
|
$tokenProvider = $c->get(IProvider::class); |
|
@@ -547,7 +547,7 @@ discard block |
|
|
block discarded – undo |
547
|
547
|
$this->registerAlias(IStore::class, Store::class); |
548
|
548
|
$this->registerAlias(IProvider::class, Authentication\Token\Manager::class); |
549
|
549
|
|
550
|
|
- $this->registerService(\OC\User\Session::class, function (Server $c) { |
|
550
|
+ $this->registerService(\OC\User\Session::class, function(Server $c) { |
551
|
551
|
$manager = $c->get(IUserManager::class); |
552
|
552
|
$session = new \OC\Session\Memory(''); |
553
|
553
|
$timeFactory = new TimeFactory(); |
|
@@ -573,26 +573,26 @@ discard block |
|
|
block discarded – undo |
573
|
573
|
$c->get(IEventDispatcher::class) |
574
|
574
|
); |
575
|
575
|
/** @deprecated 21.0.0 use BeforeUserCreatedEvent event with the IEventDispatcher instead */ |
576
|
|
- $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
576
|
+ $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
577
|
577
|
\OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]); |
578
|
578
|
}); |
579
|
579
|
/** @deprecated 21.0.0 use UserCreatedEvent event with the IEventDispatcher instead */ |
580
|
|
- $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
580
|
+ $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
581
|
581
|
/** @var \OC\User\User $user */ |
582
|
582
|
\OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]); |
583
|
583
|
}); |
584
|
584
|
/** @deprecated 21.0.0 use BeforeUserDeletedEvent event with the IEventDispatcher instead */ |
585
|
|
- $userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) { |
|
585
|
+ $userSession->listen('\OC\User', 'preDelete', function($user) use ($legacyDispatcher) { |
586
|
586
|
/** @var \OC\User\User $user */ |
587
|
587
|
\OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]); |
588
|
588
|
$legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
589
|
589
|
}); |
590
|
590
|
/** @deprecated 21.0.0 use UserDeletedEvent event with the IEventDispatcher instead */ |
591
|
|
- $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
591
|
+ $userSession->listen('\OC\User', 'postDelete', function($user) { |
592
|
592
|
/** @var \OC\User\User $user */ |
593
|
593
|
\OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]); |
594
|
594
|
}); |
595
|
|
- $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
595
|
+ $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
596
|
596
|
/** @var \OC\User\User $user */ |
597
|
597
|
\OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]); |
598
|
598
|
|
|
@@ -600,7 +600,7 @@ discard block |
|
|
block discarded – undo |
600
|
600
|
$dispatcher = $this->get(IEventDispatcher::class); |
601
|
601
|
$dispatcher->dispatchTyped(new BeforePasswordUpdatedEvent($user, $password, $recoveryPassword)); |
602
|
602
|
}); |
603
|
|
- $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
603
|
+ $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
604
|
604
|
/** @var \OC\User\User $user */ |
605
|
605
|
\OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]); |
606
|
606
|
|
|
@@ -608,14 +608,14 @@ discard block |
|
|
block discarded – undo |
608
|
608
|
$dispatcher = $this->get(IEventDispatcher::class); |
609
|
609
|
$dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword)); |
610
|
610
|
}); |
611
|
|
- $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
611
|
+ $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
612
|
612
|
\OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]); |
613
|
613
|
|
614
|
614
|
/** @var IEventDispatcher $dispatcher */ |
615
|
615
|
$dispatcher = $this->get(IEventDispatcher::class); |
616
|
616
|
$dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password)); |
617
|
617
|
}); |
618
|
|
- $userSession->listen('\OC\User', 'postLogin', function ($user, $loginName, $password, $isTokenLogin) { |
|
618
|
+ $userSession->listen('\OC\User', 'postLogin', function($user, $loginName, $password, $isTokenLogin) { |
619
|
619
|
/** @var \OC\User\User $user */ |
620
|
620
|
\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'loginName' => $loginName, 'password' => $password, 'isTokenLogin' => $isTokenLogin]); |
621
|
621
|
|
|
@@ -623,12 +623,12 @@ discard block |
|
|
block discarded – undo |
623
|
623
|
$dispatcher = $this->get(IEventDispatcher::class); |
624
|
624
|
$dispatcher->dispatchTyped(new UserLoggedInEvent($user, $loginName, $password, $isTokenLogin)); |
625
|
625
|
}); |
626
|
|
- $userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) { |
|
626
|
+ $userSession->listen('\OC\User', 'preRememberedLogin', function($uid) { |
627
|
627
|
/** @var IEventDispatcher $dispatcher */ |
628
|
628
|
$dispatcher = $this->get(IEventDispatcher::class); |
629
|
629
|
$dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid)); |
630
|
630
|
}); |
631
|
|
- $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
631
|
+ $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
632
|
632
|
/** @var \OC\User\User $user */ |
633
|
633
|
\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]); |
634
|
634
|
|
|
@@ -636,19 +636,19 @@ discard block |
|
|
block discarded – undo |
636
|
636
|
$dispatcher = $this->get(IEventDispatcher::class); |
637
|
637
|
$dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password)); |
638
|
638
|
}); |
639
|
|
- $userSession->listen('\OC\User', 'logout', function ($user) { |
|
639
|
+ $userSession->listen('\OC\User', 'logout', function($user) { |
640
|
640
|
\OC_Hook::emit('OC_User', 'logout', []); |
641
|
641
|
|
642
|
642
|
/** @var IEventDispatcher $dispatcher */ |
643
|
643
|
$dispatcher = $this->get(IEventDispatcher::class); |
644
|
644
|
$dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user)); |
645
|
645
|
}); |
646
|
|
- $userSession->listen('\OC\User', 'postLogout', function ($user) { |
|
646
|
+ $userSession->listen('\OC\User', 'postLogout', function($user) { |
647
|
647
|
/** @var IEventDispatcher $dispatcher */ |
648
|
648
|
$dispatcher = $this->get(IEventDispatcher::class); |
649
|
649
|
$dispatcher->dispatchTyped(new UserLoggedOutEvent($user)); |
650
|
650
|
}); |
651
|
|
- $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
|
651
|
+ $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) { |
652
|
652
|
/** @var \OC\User\User $user */ |
653
|
653
|
\OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]); |
654
|
654
|
|
|
@@ -672,7 +672,7 @@ discard block |
|
|
block discarded – undo |
672
|
672
|
$this->registerDeprecatedAlias('AllConfig', \OC\AllConfig::class); |
673
|
673
|
$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
674
|
674
|
|
675
|
|
- $this->registerService(\OC\SystemConfig::class, function ($c) use ($config) { |
|
675
|
+ $this->registerService(\OC\SystemConfig::class, function($c) use ($config) { |
676
|
676
|
return new \OC\SystemConfig($config); |
677
|
677
|
}); |
678
|
678
|
/** @deprecated 19.0.0 */ |
|
@@ -682,7 +682,7 @@ discard block |
|
|
block discarded – undo |
682
|
682
|
$this->registerDeprecatedAlias('AppConfig', \OC\AppConfig::class); |
683
|
683
|
$this->registerAlias(IAppConfig::class, \OC\AppConfig::class); |
684
|
684
|
|
685
|
|
- $this->registerService(IFactory::class, function (Server $c) { |
|
685
|
+ $this->registerService(IFactory::class, function(Server $c) { |
686
|
686
|
return new \OC\L10N\Factory( |
687
|
687
|
$c->get(\OCP\IConfig::class), |
688
|
688
|
$c->getRequest(), |
|
@@ -702,13 +702,13 @@ discard block |
|
|
block discarded – undo |
702
|
702
|
/** @deprecated 19.0.0 */ |
703
|
703
|
$this->registerDeprecatedAlias('CategoryFetcher', CategoryFetcher::class); |
704
|
704
|
|
705
|
|
- $this->registerService(ICache::class, function ($c) { |
|
705
|
+ $this->registerService(ICache::class, function($c) { |
706
|
706
|
return new Cache\File(); |
707
|
707
|
}); |
708
|
708
|
/** @deprecated 19.0.0 */ |
709
|
709
|
$this->registerDeprecatedAlias('UserCache', ICache::class); |
710
|
710
|
|
711
|
|
- $this->registerService(Factory::class, function (Server $c) { |
|
711
|
+ $this->registerService(Factory::class, function(Server $c) { |
712
|
712
|
$profiler = $c->get(IProfiler::class); |
713
|
713
|
$arrayCacheFactory = new \OC\Memcache\Factory('', $c->get(LoggerInterface::class), |
714
|
714
|
$profiler, |
|
@@ -734,7 +734,7 @@ discard block |
|
|
block discarded – undo |
734
|
734
|
$version = implode(',', $v); |
735
|
735
|
$instanceId = \OC_Util::getInstanceId(); |
736
|
736
|
$path = \OC::$SERVERROOT; |
737
|
|
- $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
737
|
+ $prefix = md5($instanceId.'-'.$version.'-'.$path); |
738
|
738
|
return new \OC\Memcache\Factory($prefix, |
739
|
739
|
$c->get(LoggerInterface::class), |
740
|
740
|
$profiler, |
|
@@ -750,12 +750,12 @@ discard block |
|
|
block discarded – undo |
750
|
750
|
$this->registerDeprecatedAlias('MemCacheFactory', Factory::class); |
751
|
751
|
$this->registerAlias(ICacheFactory::class, Factory::class); |
752
|
752
|
|
753
|
|
- $this->registerService('RedisFactory', function (Server $c) { |
|
753
|
+ $this->registerService('RedisFactory', function(Server $c) { |
754
|
754
|
$systemConfig = $c->get(SystemConfig::class); |
755
|
755
|
return new RedisFactory($systemConfig, $c->getEventLogger()); |
756
|
756
|
}); |
757
|
757
|
|
758
|
|
- $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
758
|
+ $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
759
|
759
|
$l10n = $this->get(IFactory::class)->get('lib'); |
760
|
760
|
return new \OC\Activity\Manager( |
761
|
761
|
$c->getRequest(), |
|
@@ -768,14 +768,14 @@ discard block |
|
|
block discarded – undo |
768
|
768
|
/** @deprecated 19.0.0 */ |
769
|
769
|
$this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class); |
770
|
770
|
|
771
|
|
- $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
771
|
+ $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
772
|
772
|
return new \OC\Activity\EventMerger( |
773
|
773
|
$c->getL10N('lib') |
774
|
774
|
); |
775
|
775
|
}); |
776
|
776
|
$this->registerAlias(IValidator::class, Validator::class); |
777
|
777
|
|
778
|
|
- $this->registerService(AvatarManager::class, function (Server $c) { |
|
778
|
+ $this->registerService(AvatarManager::class, function(Server $c) { |
779
|
779
|
return new AvatarManager( |
780
|
780
|
$c->get(IUserSession::class), |
781
|
781
|
$c->get(\OC\User\Manager::class), |
|
@@ -796,7 +796,7 @@ discard block |
|
|
block discarded – undo |
796
|
796
|
$this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class); |
797
|
797
|
$this->registerAlias(\OCP\Support\Subscription\IAssertion::class, \OC\Support\Subscription\Assertion::class); |
798
|
798
|
|
799
|
|
- $this->registerService(\OC\Log::class, function (Server $c) { |
|
799
|
+ $this->registerService(\OC\Log::class, function(Server $c) { |
800
|
800
|
$logType = $c->get(AllConfig::class)->getSystemValue('log_type', 'file'); |
801
|
801
|
$factory = new LogFactory($c, $this->get(SystemConfig::class)); |
802
|
802
|
$logger = $factory->get($logType); |
|
@@ -810,7 +810,7 @@ discard block |
|
|
block discarded – undo |
810
|
810
|
// PSR-3 logger |
811
|
811
|
$this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class); |
812
|
812
|
|
813
|
|
- $this->registerService(ILogFactory::class, function (Server $c) { |
|
813
|
+ $this->registerService(ILogFactory::class, function(Server $c) { |
814
|
814
|
return new LogFactory($c, $this->get(SystemConfig::class)); |
815
|
815
|
}); |
816
|
816
|
|
|
@@ -818,7 +818,7 @@ discard block |
|
|
block discarded – undo |
818
|
818
|
/** @deprecated 19.0.0 */ |
819
|
819
|
$this->registerDeprecatedAlias('JobList', IJobList::class); |
820
|
820
|
|
821
|
|
- $this->registerService(Router::class, function (Server $c) { |
|
821
|
+ $this->registerService(Router::class, function(Server $c) { |
822
|
822
|
$cacheFactory = $c->get(ICacheFactory::class); |
823
|
823
|
$logger = $c->get(LoggerInterface::class); |
824
|
824
|
if ($cacheFactory->isLocalCacheAvailable()) { |
|
@@ -836,7 +836,7 @@ discard block |
|
|
block discarded – undo |
836
|
836
|
/** @deprecated 19.0.0 */ |
837
|
837
|
$this->registerDeprecatedAlias('Search', ISearch::class); |
838
|
838
|
|
839
|
|
- $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
839
|
+ $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
840
|
840
|
$cacheFactory = $c->get(ICacheFactory::class); |
841
|
841
|
if ($cacheFactory->isAvailable()) { |
842
|
842
|
$backend = new \OC\Security\RateLimiting\Backend\MemoryCacheBackend( |
|
@@ -872,7 +872,7 @@ discard block |
|
|
block discarded – undo |
872
|
872
|
$this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class); |
873
|
873
|
|
874
|
874
|
$this->registerAlias(IDBConnection::class, ConnectionAdapter::class); |
875
|
|
- $this->registerService(Connection::class, function (Server $c) { |
|
875
|
+ $this->registerService(Connection::class, function(Server $c) { |
876
|
876
|
$systemConfig = $c->get(SystemConfig::class); |
877
|
877
|
$factory = new \OC\DB\ConnectionFactory($systemConfig); |
878
|
878
|
$type = $systemConfig->getValue('dbtype', 'sqlite'); |
|
@@ -888,19 +888,19 @@ discard block |
|
|
block discarded – undo |
888
|
888
|
|
889
|
889
|
$this->registerAlias(ICertificateManager::class, CertificateManager::class); |
890
|
890
|
$this->registerAlias(IClientService::class, ClientService::class); |
891
|
|
- $this->registerService(NegativeDnsCache::class, function (ContainerInterface $c) { |
|
891
|
+ $this->registerService(NegativeDnsCache::class, function(ContainerInterface $c) { |
892
|
892
|
return new NegativeDnsCache( |
893
|
893
|
$c->get(ICacheFactory::class), |
894
|
894
|
); |
895
|
895
|
}); |
896
|
896
|
$this->registerDeprecatedAlias('HttpClientService', IClientService::class); |
897
|
|
- $this->registerService(IEventLogger::class, function (ContainerInterface $c) { |
|
897
|
+ $this->registerService(IEventLogger::class, function(ContainerInterface $c) { |
898
|
898
|
return new EventLogger($c->get(SystemConfig::class), $c->get(LoggerInterface::class), $c->get(Log::class)); |
899
|
899
|
}); |
900
|
900
|
/** @deprecated 19.0.0 */ |
901
|
901
|
$this->registerDeprecatedAlias('EventLogger', IEventLogger::class); |
902
|
902
|
|
903
|
|
- $this->registerService(IQueryLogger::class, function (ContainerInterface $c) { |
|
903
|
+ $this->registerService(IQueryLogger::class, function(ContainerInterface $c) { |
904
|
904
|
$queryLogger = new QueryLogger(); |
905
|
905
|
if ($c->get(SystemConfig::class)->getValue('debug', false)) { |
906
|
906
|
// In debug mode, module is being activated by default |
|
@@ -915,7 +915,7 @@ discard block |
|
|
block discarded – undo |
915
|
915
|
$this->registerDeprecatedAlias('TempManager', TempManager::class); |
916
|
916
|
$this->registerAlias(ITempManager::class, TempManager::class); |
917
|
917
|
|
918
|
|
- $this->registerService(AppManager::class, function (ContainerInterface $c) { |
|
918
|
+ $this->registerService(AppManager::class, function(ContainerInterface $c) { |
919
|
919
|
// TODO: use auto-wiring |
920
|
920
|
return new \OC\App\AppManager( |
921
|
921
|
$c->get(IUserSession::class), |
|
@@ -935,7 +935,7 @@ discard block |
|
|
block discarded – undo |
935
|
935
|
/** @deprecated 19.0.0 */ |
936
|
936
|
$this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class); |
937
|
937
|
|
938
|
|
- $this->registerService(IDateTimeFormatter::class, function (Server $c) { |
|
938
|
+ $this->registerService(IDateTimeFormatter::class, function(Server $c) { |
939
|
939
|
$language = $c->get(\OCP\IConfig::class)->getUserValue($c->get(ISession::class)->get('user_id'), 'core', 'lang', null); |
940
|
940
|
|
941
|
941
|
return new DateTimeFormatter( |
|
@@ -946,7 +946,7 @@ discard block |
|
|
block discarded – undo |
946
|
946
|
/** @deprecated 19.0.0 */ |
947
|
947
|
$this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class); |
948
|
948
|
|
949
|
|
- $this->registerService(IUserMountCache::class, function (ContainerInterface $c) { |
|
949
|
+ $this->registerService(IUserMountCache::class, function(ContainerInterface $c) { |
950
|
950
|
$mountCache = new UserMountCache( |
951
|
951
|
$c->get(IDBConnection::class), |
952
|
952
|
$c->get(IUserManager::class), |
|
@@ -959,7 +959,7 @@ discard block |
|
|
block discarded – undo |
959
|
959
|
/** @deprecated 19.0.0 */ |
960
|
960
|
$this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class); |
961
|
961
|
|
962
|
|
- $this->registerService(IMountProviderCollection::class, function (ContainerInterface $c) { |
|
962
|
+ $this->registerService(IMountProviderCollection::class, function(ContainerInterface $c) { |
963
|
963
|
$loader = \OC\Files\Filesystem::getLoader(); |
964
|
964
|
$mountCache = $c->get(IUserMountCache::class); |
965
|
965
|
$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
|
@@ -981,7 +981,7 @@ discard block |
|
|
block discarded – undo |
981
|
981
|
|
982
|
982
|
/** @deprecated 20.0.0 */ |
983
|
983
|
$this->registerDeprecatedAlias('IniWrapper', IniGetWrapper::class); |
984
|
|
- $this->registerService(IBus::class, function (ContainerInterface $c) { |
|
984
|
+ $this->registerService(IBus::class, function(ContainerInterface $c) { |
985
|
985
|
$busClass = $c->get(\OCP\IConfig::class)->getSystemValue('commandbus'); |
986
|
986
|
if ($busClass) { |
987
|
987
|
[$app, $class] = explode('::', $busClass, 2); |
|
@@ -1003,7 +1003,7 @@ discard block |
|
|
block discarded – undo |
1003
|
1003
|
/** @deprecated 19.0.0 */ |
1004
|
1004
|
$this->registerDeprecatedAlias('Throttler', Throttler::class); |
1005
|
1005
|
$this->registerAlias(IThrottler::class, Throttler::class); |
1006
|
|
- $this->registerService('IntegrityCodeChecker', function (ContainerInterface $c) { |
|
1006
|
+ $this->registerService('IntegrityCodeChecker', function(ContainerInterface $c) { |
1007
|
1007
|
// IConfig and IAppManager requires a working database. This code |
1008
|
1008
|
// might however be called when ownCloud is not yet setup. |
1009
|
1009
|
if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) { |
|
@@ -1024,7 +1024,7 @@ discard block |
|
|
block discarded – undo |
1024
|
1024
|
$c->get(IMimeTypeDetector::class) |
1025
|
1025
|
); |
1026
|
1026
|
}); |
1027
|
|
- $this->registerService(\OCP\IRequest::class, function (ContainerInterface $c) { |
|
1027
|
+ $this->registerService(\OCP\IRequest::class, function(ContainerInterface $c) { |
1028
|
1028
|
if (isset($this['urlParams'])) { |
1029
|
1029
|
$urlParams = $this['urlParams']; |
1030
|
1030
|
} else { |
|
@@ -1061,14 +1061,14 @@ discard block |
|
|
block discarded – undo |
1061
|
1061
|
/** @deprecated 19.0.0 */ |
1062
|
1062
|
$this->registerDeprecatedAlias('Request', \OCP\IRequest::class); |
1063
|
1063
|
|
1064
|
|
- $this->registerService(IRequestId::class, function (ContainerInterface $c): IRequestId { |
|
1064
|
+ $this->registerService(IRequestId::class, function(ContainerInterface $c): IRequestId { |
1065
|
1065
|
return new RequestId( |
1066
|
1066
|
$_SERVER['UNIQUE_ID'] ?? '', |
1067
|
1067
|
$this->get(ISecureRandom::class) |
1068
|
1068
|
); |
1069
|
1069
|
}); |
1070
|
1070
|
|
1071
|
|
- $this->registerService(IMailer::class, function (Server $c) { |
|
1071
|
+ $this->registerService(IMailer::class, function(Server $c) { |
1072
|
1072
|
return new Mailer( |
1073
|
1073
|
$c->get(\OCP\IConfig::class), |
1074
|
1074
|
$c->get(LoggerInterface::class), |
|
@@ -1085,7 +1085,7 @@ discard block |
|
|
block discarded – undo |
1085
|
1085
|
/** @deprecated 21.0.0 */ |
1086
|
1086
|
$this->registerDeprecatedAlias('LDAPProvider', ILDAPProvider::class); |
1087
|
1087
|
|
1088
|
|
- $this->registerService(ILDAPProviderFactory::class, function (ContainerInterface $c) { |
|
1088
|
+ $this->registerService(ILDAPProviderFactory::class, function(ContainerInterface $c) { |
1089
|
1089
|
$config = $c->get(\OCP\IConfig::class); |
1090
|
1090
|
$factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
1091
|
1091
|
if (is_null($factoryClass) || !class_exists($factoryClass)) { |
|
@@ -1094,11 +1094,11 @@ discard block |
|
|
block discarded – undo |
1094
|
1094
|
/** @var \OCP\LDAP\ILDAPProviderFactory $factory */ |
1095
|
1095
|
return new $factoryClass($this); |
1096
|
1096
|
}); |
1097
|
|
- $this->registerService(ILDAPProvider::class, function (ContainerInterface $c) { |
|
1097
|
+ $this->registerService(ILDAPProvider::class, function(ContainerInterface $c) { |
1098
|
1098
|
$factory = $c->get(ILDAPProviderFactory::class); |
1099
|
1099
|
return $factory->getLDAPProvider(); |
1100
|
1100
|
}); |
1101
|
|
- $this->registerService(ILockingProvider::class, function (ContainerInterface $c) { |
|
1101
|
+ $this->registerService(ILockingProvider::class, function(ContainerInterface $c) { |
1102
|
1102
|
$ini = $c->get(IniGetWrapper::class); |
1103
|
1103
|
$config = $c->get(\OCP\IConfig::class); |
1104
|
1104
|
$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
|
@@ -1121,12 +1121,12 @@ discard block |
|
|
block discarded – undo |
1121
|
1121
|
/** @deprecated 19.0.0 */ |
1122
|
1122
|
$this->registerDeprecatedAlias('LockingProvider', ILockingProvider::class); |
1123
|
1123
|
|
1124
|
|
- $this->registerService(ILockManager::class, function (Server $c): LockManager { |
|
1124
|
+ $this->registerService(ILockManager::class, function(Server $c): LockManager { |
1125
|
1125
|
return new LockManager(); |
1126
|
1126
|
}); |
1127
|
1127
|
|
1128
|
1128
|
$this->registerAlias(ILockdownManager::class, 'LockdownManager'); |
1129
|
|
- $this->registerService(SetupManager::class, function ($c) { |
|
1129
|
+ $this->registerService(SetupManager::class, function($c) { |
1130
|
1130
|
// create the setupmanager through the mount manager to resolve the cyclic dependency |
1131
|
1131
|
return $c->get(\OC\Files\Mount\Manager::class)->getSetupManager(); |
1132
|
1132
|
}); |
|
@@ -1134,12 +1134,12 @@ discard block |
|
|
block discarded – undo |
1134
|
1134
|
/** @deprecated 19.0.0 */ |
1135
|
1135
|
$this->registerDeprecatedAlias('MountManager', IMountManager::class); |
1136
|
1136
|
|
1137
|
|
- $this->registerService(IMimeTypeDetector::class, function (ContainerInterface $c) { |
|
1137
|
+ $this->registerService(IMimeTypeDetector::class, function(ContainerInterface $c) { |
1138
|
1138
|
return new \OC\Files\Type\Detection( |
1139
|
1139
|
$c->get(IURLGenerator::class), |
1140
|
1140
|
$c->get(LoggerInterface::class), |
1141
|
1141
|
\OC::$configDir, |
1142
|
|
- \OC::$SERVERROOT . '/resources/config/' |
|
1142
|
+ \OC::$SERVERROOT.'/resources/config/' |
1143
|
1143
|
); |
1144
|
1144
|
}); |
1145
|
1145
|
/** @deprecated 19.0.0 */ |
|
@@ -1148,22 +1148,22 @@ discard block |
|
|
block discarded – undo |
1148
|
1148
|
$this->registerAlias(IMimeTypeLoader::class, Loader::class); |
1149
|
1149
|
/** @deprecated 19.0.0 */ |
1150
|
1150
|
$this->registerDeprecatedAlias('MimeTypeLoader', IMimeTypeLoader::class); |
1151
|
|
- $this->registerService(BundleFetcher::class, function () { |
|
1151
|
+ $this->registerService(BundleFetcher::class, function() { |
1152
|
1152
|
return new BundleFetcher($this->getL10N('lib')); |
1153
|
1153
|
}); |
1154
|
1154
|
$this->registerAlias(\OCP\Notification\IManager::class, Manager::class); |
1155
|
1155
|
/** @deprecated 19.0.0 */ |
1156
|
1156
|
$this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class); |
1157
|
1157
|
|
1158
|
|
- $this->registerService(CapabilitiesManager::class, function (ContainerInterface $c) { |
|
1158
|
+ $this->registerService(CapabilitiesManager::class, function(ContainerInterface $c) { |
1159
|
1159
|
$manager = new CapabilitiesManager($c->get(LoggerInterface::class)); |
1160
|
|
- $manager->registerCapability(function () use ($c) { |
|
1160
|
+ $manager->registerCapability(function() use ($c) { |
1161
|
1161
|
return new \OC\OCS\CoreCapabilities($c->get(\OCP\IConfig::class)); |
1162
|
1162
|
}); |
1163
|
|
- $manager->registerCapability(function () use ($c) { |
|
1163
|
+ $manager->registerCapability(function() use ($c) { |
1164
|
1164
|
return $c->get(\OC\Security\Bruteforce\Capabilities::class); |
1165
|
1165
|
}); |
1166
|
|
- $manager->registerCapability(function () use ($c) { |
|
1166
|
+ $manager->registerCapability(function() use ($c) { |
1167
|
1167
|
return $c->get(MetadataCapabilities::class); |
1168
|
1168
|
}); |
1169
|
1169
|
return $manager; |
|
@@ -1171,14 +1171,14 @@ discard block |
|
|
block discarded – undo |
1171
|
1171
|
/** @deprecated 19.0.0 */ |
1172
|
1172
|
$this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class); |
1173
|
1173
|
|
1174
|
|
- $this->registerService(ICommentsManager::class, function (Server $c) { |
|
1174
|
+ $this->registerService(ICommentsManager::class, function(Server $c) { |
1175
|
1175
|
$config = $c->get(\OCP\IConfig::class); |
1176
|
1176
|
$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
1177
|
1177
|
/** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
1178
|
1178
|
$factory = new $factoryClass($this); |
1179
|
1179
|
$manager = $factory->getManager(); |
1180
|
1180
|
|
1181
|
|
- $manager->registerDisplayNameResolver('user', function ($id) use ($c) { |
|
1181
|
+ $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
1182
|
1182
|
$manager = $c->get(IUserManager::class); |
1183
|
1183
|
$userDisplayName = $manager->getDisplayName($id); |
1184
|
1184
|
if ($userDisplayName === null) { |
|
@@ -1194,7 +1194,7 @@ discard block |
|
|
block discarded – undo |
1194
|
1194
|
$this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class); |
1195
|
1195
|
|
1196
|
1196
|
$this->registerAlias(\OC_Defaults::class, 'ThemingDefaults'); |
1197
|
|
- $this->registerService('ThemingDefaults', function (Server $c) { |
|
1197
|
+ $this->registerService('ThemingDefaults', function(Server $c) { |
1198
|
1198
|
/* |
1199
|
1199
|
* Dark magic for autoloader. |
1200
|
1200
|
* If we do a class_exists it will try to load the class which will |
|
@@ -1230,7 +1230,7 @@ discard block |
|
|
block discarded – undo |
1230
|
1230
|
} |
1231
|
1231
|
return new \OC_Defaults(); |
1232
|
1232
|
}); |
1233
|
|
- $this->registerService(JSCombiner::class, function (Server $c) { |
|
1233
|
+ $this->registerService(JSCombiner::class, function(Server $c) { |
1234
|
1234
|
return new JSCombiner( |
1235
|
1235
|
$c->getAppDataDir('js'), |
1236
|
1236
|
$c->get(IURLGenerator::class), |
|
@@ -1244,7 +1244,7 @@ discard block |
|
|
block discarded – undo |
1244
|
1244
|
$this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class); |
1245
|
1245
|
$this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class); |
1246
|
1246
|
|
1247
|
|
- $this->registerService('CryptoWrapper', function (ContainerInterface $c) { |
|
1247
|
+ $this->registerService('CryptoWrapper', function(ContainerInterface $c) { |
1248
|
1248
|
// FIXME: Instantiated here due to cyclic dependency |
1249
|
1249
|
$request = new Request( |
1250
|
1250
|
[ |
|
@@ -1271,14 +1271,14 @@ discard block |
|
|
block discarded – undo |
1271
|
1271
|
}); |
1272
|
1272
|
/** @deprecated 19.0.0 */ |
1273
|
1273
|
$this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class); |
1274
|
|
- $this->registerService(SessionStorage::class, function (ContainerInterface $c) { |
|
1274
|
+ $this->registerService(SessionStorage::class, function(ContainerInterface $c) { |
1275
|
1275
|
return new SessionStorage($c->get(ISession::class)); |
1276
|
1276
|
}); |
1277
|
1277
|
$this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class); |
1278
|
1278
|
/** @deprecated 19.0.0 */ |
1279
|
1279
|
$this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class); |
1280
|
1280
|
|
1281
|
|
- $this->registerService(\OCP\Share\IManager::class, function (IServerContainer $c) { |
|
1281
|
+ $this->registerService(\OCP\Share\IManager::class, function(IServerContainer $c) { |
1282
|
1282
|
$config = $c->get(\OCP\IConfig::class); |
1283
|
1283
|
$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
1284
|
1284
|
/** @var \OCP\Share\IProviderFactory $factory */ |
|
@@ -1310,7 +1310,7 @@ discard block |
|
|
block discarded – undo |
1310
|
1310
|
/** @deprecated 19.0.0 */ |
1311
|
1311
|
$this->registerDeprecatedAlias('ShareManager', \OCP\Share\IManager::class); |
1312
|
1312
|
|
1313
|
|
- $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) { |
|
1313
|
+ $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function(Server $c) { |
1314
|
1314
|
$instance = new Collaboration\Collaborators\Search($c); |
1315
|
1315
|
|
1316
|
1316
|
// register default plugins |
|
@@ -1335,27 +1335,27 @@ discard block |
|
|
block discarded – undo |
1335
|
1335
|
|
1336
|
1336
|
$this->registerDeprecatedAlias('SettingsManager', \OC\Settings\Manager::class); |
1337
|
1337
|
$this->registerAlias(\OCP\Settings\IManager::class, \OC\Settings\Manager::class); |
1338
|
|
- $this->registerService(\OC\Files\AppData\Factory::class, function (ContainerInterface $c) { |
|
1338
|
+ $this->registerService(\OC\Files\AppData\Factory::class, function(ContainerInterface $c) { |
1339
|
1339
|
return new \OC\Files\AppData\Factory( |
1340
|
1340
|
$c->get(IRootFolder::class), |
1341
|
1341
|
$c->get(SystemConfig::class) |
1342
|
1342
|
); |
1343
|
1343
|
}); |
1344
|
1344
|
|
1345
|
|
- $this->registerService('LockdownManager', function (ContainerInterface $c) { |
1346
|
|
- return new LockdownManager(function () use ($c) { |
|
1345
|
+ $this->registerService('LockdownManager', function(ContainerInterface $c) { |
|
1346
|
+ return new LockdownManager(function() use ($c) { |
1347
|
1347
|
return $c->get(ISession::class); |
1348
|
1348
|
}); |
1349
|
1349
|
}); |
1350
|
1350
|
|
1351
|
|
- $this->registerService(\OCP\OCS\IDiscoveryService::class, function (ContainerInterface $c) { |
|
1351
|
+ $this->registerService(\OCP\OCS\IDiscoveryService::class, function(ContainerInterface $c) { |
1352
|
1352
|
return new DiscoveryService( |
1353
|
1353
|
$c->get(ICacheFactory::class), |
1354
|
1354
|
$c->get(IClientService::class) |
1355
|
1355
|
); |
1356
|
1356
|
}); |
1357
|
1357
|
|
1358
|
|
- $this->registerService(ICloudIdManager::class, function (ContainerInterface $c) { |
|
1358
|
+ $this->registerService(ICloudIdManager::class, function(ContainerInterface $c) { |
1359
|
1359
|
return new CloudIdManager( |
1360
|
1360
|
$c->get(\OCP\Contacts\IManager::class), |
1361
|
1361
|
$c->get(IURLGenerator::class), |
|
@@ -1367,7 +1367,7 @@ discard block |
|
|
block discarded – undo |
1367
|
1367
|
|
1368
|
1368
|
$this->registerAlias(\OCP\GlobalScale\IConfig::class, \OC\GlobalScale\Config::class); |
1369
|
1369
|
|
1370
|
|
- $this->registerService(ICloudFederationProviderManager::class, function (ContainerInterface $c) { |
|
1370
|
+ $this->registerService(ICloudFederationProviderManager::class, function(ContainerInterface $c) { |
1371
|
1371
|
return new CloudFederationProviderManager( |
1372
|
1372
|
$c->get(IAppManager::class), |
1373
|
1373
|
$c->get(IClientService::class), |
|
@@ -1376,7 +1376,7 @@ discard block |
|
|
block discarded – undo |
1376
|
1376
|
); |
1377
|
1377
|
}); |
1378
|
1378
|
|
1379
|
|
- $this->registerService(ICloudFederationFactory::class, function (Server $c) { |
|
1379
|
+ $this->registerService(ICloudFederationFactory::class, function(Server $c) { |
1380
|
1380
|
return new CloudFederationFactory(); |
1381
|
1381
|
}); |
1382
|
1382
|
|
|
@@ -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
|
}); |
|
@@ -2357,11 +2357,11 @@ discard block |
|
|
block discarded – undo |
2357
|
2357
|
} |
2358
|
2358
|
|
2359
|
2359
|
private function registerDeprecatedAlias(string $alias, string $target) { |
2360
|
|
- $this->registerService($alias, function (ContainerInterface $container) use ($target, $alias) { |
|
2360
|
+ $this->registerService($alias, function(ContainerInterface $container) use ($target, $alias) { |
2361
|
2361
|
try { |
2362
|
2362
|
/** @var LoggerInterface $logger */ |
2363
|
2363
|
$logger = $container->get(LoggerInterface::class); |
2364
|
|
- $logger->debug('The requested alias "' . $alias . '" is deprecated. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); |
|
2364
|
+ $logger->debug('The requested alias "'.$alias.'" is deprecated. Please request "'.$target.'" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); |
2365
|
2365
|
} catch (ContainerExceptionInterface $e) { |
2366
|
2366
|
// Could not get logger. Continue |
2367
|
2367
|
} |