|
@@ -264,10 +264,10 @@ discard block |
|
|
block discarded – undo |
264
|
264
|
$this->registerParameter('isCLI', \OC::$CLI); |
265
|
265
|
$this->registerParameter('serverRoot', \OC::$SERVERROOT); |
266
|
266
|
|
267
|
|
- $this->registerService(ContainerInterface::class, function (ContainerInterface $c) { |
|
267
|
+ $this->registerService(ContainerInterface::class, function(ContainerInterface $c) { |
268
|
268
|
return $c; |
269
|
269
|
}); |
270
|
|
- $this->registerService(\OCP\IServerContainer::class, function (ContainerInterface $c) { |
|
270
|
+ $this->registerService(\OCP\IServerContainer::class, function(ContainerInterface $c) { |
271
|
271
|
return $c; |
272
|
272
|
}); |
273
|
273
|
|
|
@@ -291,11 +291,11 @@ discard block |
|
|
block discarded – undo |
291
|
291
|
|
292
|
292
|
$this->registerAlias(IActionFactory::class, ActionFactory::class); |
293
|
293
|
|
294
|
|
- $this->registerService(View::class, function (Server $c) { |
|
294
|
+ $this->registerService(View::class, function(Server $c) { |
295
|
295
|
return new View(); |
296
|
296
|
}, false); |
297
|
297
|
|
298
|
|
- $this->registerService(IPreview::class, function (ContainerInterface $c) { |
|
298
|
+ $this->registerService(IPreview::class, function(ContainerInterface $c) { |
299
|
299
|
return new PreviewManager( |
300
|
300
|
$c->get(\OCP\IConfig::class), |
301
|
301
|
$c->get(IRootFolder::class), |
|
@@ -311,7 +311,7 @@ discard block |
|
|
block discarded – undo |
311
|
311
|
/** @deprecated 19.0.0 */ |
312
|
312
|
$this->registerDeprecatedAlias('PreviewManager', IPreview::class); |
313
|
313
|
|
314
|
|
- $this->registerService(\OC\Preview\Watcher::class, function (ContainerInterface $c) { |
|
314
|
+ $this->registerService(\OC\Preview\Watcher::class, function(ContainerInterface $c) { |
315
|
315
|
return new \OC\Preview\Watcher( |
316
|
316
|
new \OC\Preview\Storage\Root( |
317
|
317
|
$c->get(IRootFolder::class), |
|
@@ -320,7 +320,7 @@ discard block |
|
|
block discarded – undo |
320
|
320
|
); |
321
|
321
|
}); |
322
|
322
|
|
323
|
|
- $this->registerService(\OCP\Encryption\IManager::class, function (Server $c) { |
|
323
|
+ $this->registerService(\OCP\Encryption\IManager::class, function(Server $c) { |
324
|
324
|
$view = new View(); |
325
|
325
|
$util = new Encryption\Util( |
326
|
326
|
$view, |
|
@@ -342,7 +342,7 @@ discard block |
|
|
block discarded – undo |
342
|
342
|
|
343
|
343
|
/** @deprecated 21.0.0 */ |
344
|
344
|
$this->registerDeprecatedAlias('EncryptionFileHelper', IFile::class); |
345
|
|
- $this->registerService(IFile::class, function (ContainerInterface $c) { |
|
345
|
+ $this->registerService(IFile::class, function(ContainerInterface $c) { |
346
|
346
|
$util = new Encryption\Util( |
347
|
347
|
new View(), |
348
|
348
|
$c->get(IUserManager::class), |
|
@@ -358,7 +358,7 @@ discard block |
|
|
block discarded – undo |
358
|
358
|
|
359
|
359
|
/** @deprecated 21.0.0 */ |
360
|
360
|
$this->registerDeprecatedAlias('EncryptionKeyStorage', IStorage::class); |
361
|
|
- $this->registerService(IStorage::class, function (ContainerInterface $c) { |
|
361
|
+ $this->registerService(IStorage::class, function(ContainerInterface $c) { |
362
|
362
|
$view = new View(); |
363
|
363
|
$util = new Encryption\Util( |
364
|
364
|
$view, |
|
@@ -381,22 +381,22 @@ discard block |
|
|
block discarded – undo |
381
|
381
|
/** @deprecated 19.0.0 */ |
382
|
382
|
$this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class); |
383
|
383
|
|
384
|
|
- $this->registerService('SystemTagManagerFactory', function (ContainerInterface $c) { |
|
384
|
+ $this->registerService('SystemTagManagerFactory', function(ContainerInterface $c) { |
385
|
385
|
/** @var \OCP\IConfig $config */ |
386
|
386
|
$config = $c->get(\OCP\IConfig::class); |
387
|
387
|
$factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
388
|
388
|
return new $factoryClass($this); |
389
|
389
|
}); |
390
|
|
- $this->registerService(ISystemTagManager::class, function (ContainerInterface $c) { |
|
390
|
+ $this->registerService(ISystemTagManager::class, function(ContainerInterface $c) { |
391
|
391
|
return $c->get('SystemTagManagerFactory')->getManager(); |
392
|
392
|
}); |
393
|
393
|
/** @deprecated 19.0.0 */ |
394
|
394
|
$this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class); |
395
|
395
|
|
396
|
|
- $this->registerService(ISystemTagObjectMapper::class, function (ContainerInterface $c) { |
|
396
|
+ $this->registerService(ISystemTagObjectMapper::class, function(ContainerInterface $c) { |
397
|
397
|
return $c->get('SystemTagManagerFactory')->getObjectMapper(); |
398
|
398
|
}); |
399
|
|
- $this->registerService('RootFolder', function (ContainerInterface $c) { |
|
399
|
+ $this->registerService('RootFolder', function(ContainerInterface $c) { |
400
|
400
|
$manager = \OC\Files\Filesystem::getMountManager(null); |
401
|
401
|
$view = new View(); |
402
|
402
|
$root = new Root( |
|
@@ -416,7 +416,7 @@ discard block |
|
|
block discarded – undo |
416
|
416
|
|
417
|
417
|
return $root; |
418
|
418
|
}); |
419
|
|
- $this->registerService(HookConnector::class, function (ContainerInterface $c) { |
|
419
|
+ $this->registerService(HookConnector::class, function(ContainerInterface $c) { |
420
|
420
|
return new HookConnector( |
421
|
421
|
$c->get(IRootFolder::class), |
422
|
422
|
new View(), |
|
@@ -428,8 +428,8 @@ discard block |
|
|
block discarded – undo |
428
|
428
|
/** @deprecated 19.0.0 */ |
429
|
429
|
$this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class); |
430
|
430
|
|
431
|
|
- $this->registerService(IRootFolder::class, function (ContainerInterface $c) { |
432
|
|
- return new LazyRoot(function () use ($c) { |
|
431
|
+ $this->registerService(IRootFolder::class, function(ContainerInterface $c) { |
|
432
|
+ return new LazyRoot(function() use ($c) { |
433
|
433
|
return $c->get('RootFolder'); |
434
|
434
|
}); |
435
|
435
|
}); |
|
@@ -440,44 +440,44 @@ discard block |
|
|
block discarded – undo |
440
|
440
|
$this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class); |
441
|
441
|
$this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
442
|
442
|
|
443
|
|
- $this->registerService(\OCP\IGroupManager::class, function (ContainerInterface $c) { |
|
443
|
+ $this->registerService(\OCP\IGroupManager::class, function(ContainerInterface $c) { |
444
|
444
|
$groupManager = new \OC\Group\Manager($this->get(IUserManager::class), $c->get(SymfonyAdapter::class), $this->get(ILogger::class)); |
445
|
|
- $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
445
|
+ $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
446
|
446
|
/** @var IEventDispatcher $dispatcher */ |
447
|
447
|
$dispatcher = $this->get(IEventDispatcher::class); |
448
|
448
|
$dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid)); |
449
|
449
|
}); |
450
|
|
- $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) { |
|
450
|
+ $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $group) { |
451
|
451
|
/** @var IEventDispatcher $dispatcher */ |
452
|
452
|
$dispatcher = $this->get(IEventDispatcher::class); |
453
|
453
|
$dispatcher->dispatchTyped(new GroupCreatedEvent($group)); |
454
|
454
|
}); |
455
|
|
- $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
455
|
+ $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
456
|
456
|
/** @var IEventDispatcher $dispatcher */ |
457
|
457
|
$dispatcher = $this->get(IEventDispatcher::class); |
458
|
458
|
$dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group)); |
459
|
459
|
}); |
460
|
|
- $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
460
|
+ $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
461
|
461
|
/** @var IEventDispatcher $dispatcher */ |
462
|
462
|
$dispatcher = $this->get(IEventDispatcher::class); |
463
|
463
|
$dispatcher->dispatchTyped(new GroupDeletedEvent($group)); |
464
|
464
|
}); |
465
|
|
- $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
465
|
+ $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
466
|
466
|
/** @var IEventDispatcher $dispatcher */ |
467
|
467
|
$dispatcher = $this->get(IEventDispatcher::class); |
468
|
468
|
$dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user)); |
469
|
469
|
}); |
470
|
|
- $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
470
|
+ $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
471
|
471
|
/** @var IEventDispatcher $dispatcher */ |
472
|
472
|
$dispatcher = $this->get(IEventDispatcher::class); |
473
|
473
|
$dispatcher->dispatchTyped(new UserAddedEvent($group, $user)); |
474
|
474
|
}); |
475
|
|
- $groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
475
|
+ $groupManager->listen('\OC\Group', 'preRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
476
|
476
|
/** @var IEventDispatcher $dispatcher */ |
477
|
477
|
$dispatcher = $this->get(IEventDispatcher::class); |
478
|
478
|
$dispatcher->dispatchTyped(new BeforeUserRemovedEvent($group, $user)); |
479
|
479
|
}); |
480
|
|
- $groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
480
|
+ $groupManager->listen('\OC\Group', 'postRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
481
|
481
|
/** @var IEventDispatcher $dispatcher */ |
482
|
482
|
$dispatcher = $this->get(IEventDispatcher::class); |
483
|
483
|
$dispatcher->dispatchTyped(new UserRemovedEvent($group, $user)); |
|
@@ -487,7 +487,7 @@ discard block |
|
|
block discarded – undo |
487
|
487
|
/** @deprecated 19.0.0 */ |
488
|
488
|
$this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class); |
489
|
489
|
|
490
|
|
- $this->registerService(Store::class, function (ContainerInterface $c) { |
|
490
|
+ $this->registerService(Store::class, function(ContainerInterface $c) { |
491
|
491
|
$session = $c->get(ISession::class); |
492
|
492
|
if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) { |
493
|
493
|
$tokenProvider = $c->get(IProvider::class); |
|
@@ -500,7 +500,7 @@ discard block |
|
|
block discarded – undo |
500
|
500
|
$this->registerAlias(IStore::class, Store::class); |
501
|
501
|
$this->registerAlias(IProvider::class, Authentication\Token\Manager::class); |
502
|
502
|
|
503
|
|
- $this->registerService(\OC\User\Session::class, function (Server $c) { |
|
503
|
+ $this->registerService(\OC\User\Session::class, function(Server $c) { |
504
|
504
|
$manager = $c->get(IUserManager::class); |
505
|
505
|
$session = new \OC\Session\Memory(''); |
506
|
506
|
$timeFactory = new TimeFactory(); |
|
@@ -525,18 +525,18 @@ discard block |
|
|
block discarded – undo |
525
|
525
|
$c->get(ILogger::class), |
526
|
526
|
$c->get(IEventDispatcher::class) |
527
|
527
|
); |
528
|
|
- $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
528
|
+ $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
529
|
529
|
\OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]); |
530
|
530
|
|
531
|
531
|
/** @var IEventDispatcher $dispatcher */ |
532
|
532
|
$dispatcher = $this->get(IEventDispatcher::class); |
533
|
533
|
$dispatcher->dispatchTyped(new BeforeUserCreatedEvent($uid, $password)); |
534
|
534
|
}); |
535
|
|
- $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
535
|
+ $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
536
|
536
|
/** @var \OC\User\User $user */ |
537
|
537
|
\OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]); |
538
|
538
|
}); |
539
|
|
- $userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) { |
|
539
|
+ $userSession->listen('\OC\User', 'preDelete', function($user) use ($legacyDispatcher) { |
540
|
540
|
/** @var \OC\User\User $user */ |
541
|
541
|
\OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]); |
542
|
542
|
$legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
|
@@ -545,7 +545,7 @@ discard block |
|
|
block discarded – undo |
545
|
545
|
$dispatcher = $this->get(IEventDispatcher::class); |
546
|
546
|
$dispatcher->dispatchTyped(new BeforeUserDeletedEvent($user)); |
547
|
547
|
}); |
548
|
|
- $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
548
|
+ $userSession->listen('\OC\User', 'postDelete', function($user) { |
549
|
549
|
/** @var \OC\User\User $user */ |
550
|
550
|
\OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]); |
551
|
551
|
|
|
@@ -553,7 +553,7 @@ discard block |
|
|
block discarded – undo |
553
|
553
|
$dispatcher = $this->get(IEventDispatcher::class); |
554
|
554
|
$dispatcher->dispatchTyped(new UserDeletedEvent($user)); |
555
|
555
|
}); |
556
|
|
- $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
556
|
+ $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
557
|
557
|
/** @var \OC\User\User $user */ |
558
|
558
|
\OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]); |
559
|
559
|
|
|
@@ -561,7 +561,7 @@ discard block |
|
|
block discarded – undo |
561
|
561
|
$dispatcher = $this->get(IEventDispatcher::class); |
562
|
562
|
$dispatcher->dispatchTyped(new BeforePasswordUpdatedEvent($user, $password, $recoveryPassword)); |
563
|
563
|
}); |
564
|
|
- $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
564
|
+ $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
565
|
565
|
/** @var \OC\User\User $user */ |
566
|
566
|
\OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]); |
567
|
567
|
|
|
@@ -569,14 +569,14 @@ discard block |
|
|
block discarded – undo |
569
|
569
|
$dispatcher = $this->get(IEventDispatcher::class); |
570
|
570
|
$dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword)); |
571
|
571
|
}); |
572
|
|
- $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
572
|
+ $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
573
|
573
|
\OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]); |
574
|
574
|
|
575
|
575
|
/** @var IEventDispatcher $dispatcher */ |
576
|
576
|
$dispatcher = $this->get(IEventDispatcher::class); |
577
|
577
|
$dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password)); |
578
|
578
|
}); |
579
|
|
- $userSession->listen('\OC\User', 'postLogin', function ($user, $loginName, $password, $isTokenLogin) { |
|
579
|
+ $userSession->listen('\OC\User', 'postLogin', function($user, $loginName, $password, $isTokenLogin) { |
580
|
580
|
/** @var \OC\User\User $user */ |
581
|
581
|
\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'loginName' => $loginName, 'password' => $password, 'isTokenLogin' => $isTokenLogin]); |
582
|
582
|
|
|
@@ -584,12 +584,12 @@ discard block |
|
|
block discarded – undo |
584
|
584
|
$dispatcher = $this->get(IEventDispatcher::class); |
585
|
585
|
$dispatcher->dispatchTyped(new UserLoggedInEvent($user, $password, $isTokenLogin)); |
586
|
586
|
}); |
587
|
|
- $userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) { |
|
587
|
+ $userSession->listen('\OC\User', 'preRememberedLogin', function($uid) { |
588
|
588
|
/** @var IEventDispatcher $dispatcher */ |
589
|
589
|
$dispatcher = $this->get(IEventDispatcher::class); |
590
|
590
|
$dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid)); |
591
|
591
|
}); |
592
|
|
- $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
592
|
+ $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
593
|
593
|
/** @var \OC\User\User $user */ |
594
|
594
|
\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]); |
595
|
595
|
|
|
@@ -597,19 +597,19 @@ discard block |
|
|
block discarded – undo |
597
|
597
|
$dispatcher = $this->get(IEventDispatcher::class); |
598
|
598
|
$dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password)); |
599
|
599
|
}); |
600
|
|
- $userSession->listen('\OC\User', 'logout', function ($user) { |
|
600
|
+ $userSession->listen('\OC\User', 'logout', function($user) { |
601
|
601
|
\OC_Hook::emit('OC_User', 'logout', []); |
602
|
602
|
|
603
|
603
|
/** @var IEventDispatcher $dispatcher */ |
604
|
604
|
$dispatcher = $this->get(IEventDispatcher::class); |
605
|
605
|
$dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user)); |
606
|
606
|
}); |
607
|
|
- $userSession->listen('\OC\User', 'postLogout', function ($user) { |
|
607
|
+ $userSession->listen('\OC\User', 'postLogout', function($user) { |
608
|
608
|
/** @var IEventDispatcher $dispatcher */ |
609
|
609
|
$dispatcher = $this->get(IEventDispatcher::class); |
610
|
610
|
$dispatcher->dispatchTyped(new UserLoggedOutEvent($user)); |
611
|
611
|
}); |
612
|
|
- $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
|
612
|
+ $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) { |
613
|
613
|
/** @var \OC\User\User $user */ |
614
|
614
|
\OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]); |
615
|
615
|
|
|
@@ -633,7 +633,7 @@ discard block |
|
|
block discarded – undo |
633
|
633
|
$this->registerDeprecatedAlias('AllConfig', \OC\AllConfig::class); |
634
|
634
|
$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
635
|
635
|
|
636
|
|
- $this->registerService(\OC\SystemConfig::class, function ($c) use ($config) { |
|
636
|
+ $this->registerService(\OC\SystemConfig::class, function($c) use ($config) { |
637
|
637
|
return new \OC\SystemConfig($config); |
638
|
638
|
}); |
639
|
639
|
/** @deprecated 19.0.0 */ |
|
@@ -643,7 +643,7 @@ discard block |
|
|
block discarded – undo |
643
|
643
|
$this->registerDeprecatedAlias('AppConfig', \OC\AppConfig::class); |
644
|
644
|
$this->registerAlias(IAppConfig::class, \OC\AppConfig::class); |
645
|
645
|
|
646
|
|
- $this->registerService(IFactory::class, function (Server $c) { |
|
646
|
+ $this->registerService(IFactory::class, function(Server $c) { |
647
|
647
|
return new \OC\L10N\Factory( |
648
|
648
|
$c->get(\OCP\IConfig::class), |
649
|
649
|
$c->getRequest(), |
|
@@ -663,13 +663,13 @@ discard block |
|
|
block discarded – undo |
663
|
663
|
/** @deprecated 19.0.0 */ |
664
|
664
|
$this->registerDeprecatedAlias('CategoryFetcher', CategoryFetcher::class); |
665
|
665
|
|
666
|
|
- $this->registerService(ICache::class, function ($c) { |
|
666
|
+ $this->registerService(ICache::class, function($c) { |
667
|
667
|
return new Cache\File(); |
668
|
668
|
}); |
669
|
669
|
/** @deprecated 19.0.0 */ |
670
|
670
|
$this->registerDeprecatedAlias('UserCache', ICache::class); |
671
|
671
|
|
672
|
|
- $this->registerService(Factory::class, function (Server $c) { |
|
672
|
+ $this->registerService(Factory::class, function(Server $c) { |
673
|
673
|
$arrayCacheFactory = new \OC\Memcache\Factory('', $c->get(ILogger::class), |
674
|
674
|
ArrayCache::class, |
675
|
675
|
ArrayCache::class, |
|
@@ -684,7 +684,7 @@ discard block |
|
|
block discarded – undo |
684
|
684
|
$version = implode(',', $v); |
685
|
685
|
$instanceId = \OC_Util::getInstanceId(); |
686
|
686
|
$path = \OC::$SERVERROOT; |
687
|
|
- $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
687
|
+ $prefix = md5($instanceId.'-'.$version.'-'.$path); |
688
|
688
|
return new \OC\Memcache\Factory($prefix, $c->get(ILogger::class), |
689
|
689
|
$config->getSystemValue('memcache.local', null), |
690
|
690
|
$config->getSystemValue('memcache.distributed', null), |
|
@@ -697,12 +697,12 @@ discard block |
|
|
block discarded – undo |
697
|
697
|
$this->registerDeprecatedAlias('MemCacheFactory', Factory::class); |
698
|
698
|
$this->registerAlias(ICacheFactory::class, Factory::class); |
699
|
699
|
|
700
|
|
- $this->registerService('RedisFactory', function (Server $c) { |
|
700
|
+ $this->registerService('RedisFactory', function(Server $c) { |
701
|
701
|
$systemConfig = $c->get(SystemConfig::class); |
702
|
702
|
return new RedisFactory($systemConfig); |
703
|
703
|
}); |
704
|
704
|
|
705
|
|
- $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
705
|
+ $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
706
|
706
|
$l10n = $this->get(IFactory::class)->get('lib'); |
707
|
707
|
return new \OC\Activity\Manager( |
708
|
708
|
$c->getRequest(), |
|
@@ -715,14 +715,14 @@ discard block |
|
|
block discarded – undo |
715
|
715
|
/** @deprecated 19.0.0 */ |
716
|
716
|
$this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class); |
717
|
717
|
|
718
|
|
- $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
718
|
+ $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
719
|
719
|
return new \OC\Activity\EventMerger( |
720
|
720
|
$c->getL10N('lib') |
721
|
721
|
); |
722
|
722
|
}); |
723
|
723
|
$this->registerAlias(IValidator::class, Validator::class); |
724
|
724
|
|
725
|
|
- $this->registerService(AvatarManager::class, function (Server $c) { |
|
725
|
+ $this->registerService(AvatarManager::class, function(Server $c) { |
726
|
726
|
return new AvatarManager( |
727
|
727
|
$c->get(\OC\User\Manager::class), |
728
|
728
|
$c->getAppDataDir('avatar'), |
|
@@ -738,7 +738,7 @@ discard block |
|
|
block discarded – undo |
738
|
738
|
$this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
739
|
739
|
$this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class); |
740
|
740
|
|
741
|
|
- $this->registerService(\OC\Log::class, function (Server $c) { |
|
741
|
+ $this->registerService(\OC\Log::class, function(Server $c) { |
742
|
742
|
$logType = $c->get(AllConfig::class)->getSystemValue('log_type', 'file'); |
743
|
743
|
$factory = new LogFactory($c, $this->get(SystemConfig::class)); |
744
|
744
|
$logger = $factory->get($logType); |
|
@@ -752,7 +752,7 @@ discard block |
|
|
block discarded – undo |
752
|
752
|
// PSR-3 logger |
753
|
753
|
$this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class); |
754
|
754
|
|
755
|
|
- $this->registerService(ILogFactory::class, function (Server $c) { |
|
755
|
+ $this->registerService(ILogFactory::class, function(Server $c) { |
756
|
756
|
return new LogFactory($c, $this->get(SystemConfig::class)); |
757
|
757
|
}); |
758
|
758
|
|
|
@@ -760,7 +760,7 @@ discard block |
|
|
block discarded – undo |
760
|
760
|
/** @deprecated 19.0.0 */ |
761
|
761
|
$this->registerDeprecatedAlias('JobList', IJobList::class); |
762
|
762
|
|
763
|
|
- $this->registerService(Router::class, function (Server $c) { |
|
763
|
+ $this->registerService(Router::class, function(Server $c) { |
764
|
764
|
$cacheFactory = $c->get(ICacheFactory::class); |
765
|
765
|
$logger = $c->get(ILogger::class); |
766
|
766
|
if ($cacheFactory->isLocalCacheAvailable()) { |
|
@@ -778,7 +778,7 @@ discard block |
|
|
block discarded – undo |
778
|
778
|
/** @deprecated 19.0.0 */ |
779
|
779
|
$this->registerDeprecatedAlias('Search', ISearch::class); |
780
|
780
|
|
781
|
|
- $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
781
|
+ $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
782
|
782
|
return new \OC\Security\RateLimiting\Backend\MemoryCache( |
783
|
783
|
$this->get(ICacheFactory::class), |
784
|
784
|
new \OC\AppFramework\Utility\TimeFactory() |
|
@@ -801,7 +801,7 @@ discard block |
|
|
block discarded – undo |
801
|
801
|
/** @deprecated 19.0.0 */ |
802
|
802
|
$this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class); |
803
|
803
|
|
804
|
|
- $this->registerService(IDBConnection::class, function (Server $c) { |
|
804
|
+ $this->registerService(IDBConnection::class, function(Server $c) { |
805
|
805
|
$systemConfig = $c->get(SystemConfig::class); |
806
|
806
|
$factory = new \OC\DB\ConnectionFactory($systemConfig); |
807
|
807
|
$type = $systemConfig->getValue('dbtype', 'sqlite'); |
|
@@ -819,7 +819,7 @@ discard block |
|
|
block discarded – undo |
819
|
819
|
$this->registerAlias(ICertificateManager::class, CertificateManager::class); |
820
|
820
|
$this->registerAlias(IClientService::class, ClientService::class); |
821
|
821
|
$this->registerDeprecatedAlias('HttpClientService', IClientService::class); |
822
|
|
- $this->registerService(IEventLogger::class, function (ContainerInterface $c) { |
|
822
|
+ $this->registerService(IEventLogger::class, function(ContainerInterface $c) { |
823
|
823
|
$eventLogger = new EventLogger(); |
824
|
824
|
if ($c->get(SystemConfig::class)->getValue('debug', false)) { |
825
|
825
|
// In debug mode, module is being activated by default |
|
@@ -830,7 +830,7 @@ discard block |
|
|
block discarded – undo |
830
|
830
|
/** @deprecated 19.0.0 */ |
831
|
831
|
$this->registerDeprecatedAlias('EventLogger', IEventLogger::class); |
832
|
832
|
|
833
|
|
- $this->registerService(IQueryLogger::class, function (ContainerInterface $c) { |
|
833
|
+ $this->registerService(IQueryLogger::class, function(ContainerInterface $c) { |
834
|
834
|
$queryLogger = new QueryLogger(); |
835
|
835
|
if ($c->get(SystemConfig::class)->getValue('debug', false)) { |
836
|
836
|
// In debug mode, module is being activated by default |
|
@@ -845,7 +845,7 @@ discard block |
|
|
block discarded – undo |
845
|
845
|
$this->registerDeprecatedAlias('TempManager', TempManager::class); |
846
|
846
|
$this->registerAlias(ITempManager::class, TempManager::class); |
847
|
847
|
|
848
|
|
- $this->registerService(AppManager::class, function (ContainerInterface $c) { |
|
848
|
+ $this->registerService(AppManager::class, function(ContainerInterface $c) { |
849
|
849
|
// TODO: use auto-wiring |
850
|
850
|
return new \OC\App\AppManager( |
851
|
851
|
$c->get(IUserSession::class), |
|
@@ -865,7 +865,7 @@ discard block |
|
|
block discarded – undo |
865
|
865
|
/** @deprecated 19.0.0 */ |
866
|
866
|
$this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class); |
867
|
867
|
|
868
|
|
- $this->registerService(IDateTimeFormatter::class, function (Server $c) { |
|
868
|
+ $this->registerService(IDateTimeFormatter::class, function(Server $c) { |
869
|
869
|
$language = $c->get(\OCP\IConfig::class)->getUserValue($c->get(ISession::class)->get('user_id'), 'core', 'lang', null); |
870
|
870
|
|
871
|
871
|
return new DateTimeFormatter( |
|
@@ -876,7 +876,7 @@ discard block |
|
|
block discarded – undo |
876
|
876
|
/** @deprecated 19.0.0 */ |
877
|
877
|
$this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class); |
878
|
878
|
|
879
|
|
- $this->registerService(IUserMountCache::class, function (ContainerInterface $c) { |
|
879
|
+ $this->registerService(IUserMountCache::class, function(ContainerInterface $c) { |
880
|
880
|
$mountCache = new UserMountCache( |
881
|
881
|
$c->get(IDBConnection::class), |
882
|
882
|
$c->get(IUserManager::class), |
|
@@ -889,7 +889,7 @@ discard block |
|
|
block discarded – undo |
889
|
889
|
/** @deprecated 19.0.0 */ |
890
|
890
|
$this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class); |
891
|
891
|
|
892
|
|
- $this->registerService(IMountProviderCollection::class, function (ContainerInterface $c) { |
|
892
|
+ $this->registerService(IMountProviderCollection::class, function(ContainerInterface $c) { |
893
|
893
|
$loader = \OC\Files\Filesystem::getLoader(); |
894
|
894
|
$mountCache = $c->get(IUserMountCache::class); |
895
|
895
|
$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
|
@@ -910,7 +910,7 @@ discard block |
|
|
block discarded – undo |
910
|
910
|
|
911
|
911
|
/** @deprecated 20.0.0 */ |
912
|
912
|
$this->registerDeprecatedAlias('IniWrapper', IniGetWrapper::class); |
913
|
|
- $this->registerService(IBus::class, function (ContainerInterface $c) { |
|
913
|
+ $this->registerService(IBus::class, function(ContainerInterface $c) { |
914
|
914
|
$busClass = $c->get(\OCP\IConfig::class)->getSystemValue('commandbus'); |
915
|
915
|
if ($busClass) { |
916
|
916
|
[$app, $class] = explode('::', $busClass, 2); |
|
@@ -930,7 +930,7 @@ discard block |
|
|
block discarded – undo |
930
|
930
|
$this->registerDeprecatedAlias('TrustedDomainHelper', TrustedDomainHelper::class); |
931
|
931
|
/** @deprecated 19.0.0 */ |
932
|
932
|
$this->registerDeprecatedAlias('Throttler', Throttler::class); |
933
|
|
- $this->registerService('IntegrityCodeChecker', function (ContainerInterface $c) { |
|
933
|
+ $this->registerService('IntegrityCodeChecker', function(ContainerInterface $c) { |
934
|
934
|
// IConfig and IAppManager requires a working database. This code |
935
|
935
|
// might however be called when ownCloud is not yet setup. |
936
|
936
|
if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) { |
|
@@ -952,7 +952,7 @@ discard block |
|
|
block discarded – undo |
952
|
952
|
$c->get(IMimeTypeDetector::class) |
953
|
953
|
); |
954
|
954
|
}); |
955
|
|
- $this->registerService(\OCP\IRequest::class, function (ContainerInterface $c) { |
|
955
|
+ $this->registerService(\OCP\IRequest::class, function(ContainerInterface $c) { |
956
|
956
|
if (isset($this['urlParams'])) { |
957
|
957
|
$urlParams = $this['urlParams']; |
958
|
958
|
} else { |
|
@@ -989,7 +989,7 @@ discard block |
|
|
block discarded – undo |
989
|
989
|
/** @deprecated 19.0.0 */ |
990
|
990
|
$this->registerDeprecatedAlias('Request', \OCP\IRequest::class); |
991
|
991
|
|
992
|
|
- $this->registerService(IMailer::class, function (Server $c) { |
|
992
|
+ $this->registerService(IMailer::class, function(Server $c) { |
993
|
993
|
return new Mailer( |
994
|
994
|
$c->get(\OCP\IConfig::class), |
995
|
995
|
$c->get(ILogger::class), |
|
@@ -1003,7 +1003,7 @@ discard block |
|
|
block discarded – undo |
1003
|
1003
|
/** @deprecated 19.0.0 */ |
1004
|
1004
|
$this->registerDeprecatedAlias('Mailer', IMailer::class); |
1005
|
1005
|
|
1006
|
|
- $this->registerService('LDAPProvider', function (ContainerInterface $c) { |
|
1006
|
+ $this->registerService('LDAPProvider', function(ContainerInterface $c) { |
1007
|
1007
|
$config = $c->get(\OCP\IConfig::class); |
1008
|
1008
|
$factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
1009
|
1009
|
if (is_null($factoryClass)) { |
|
@@ -1013,7 +1013,7 @@ discard block |
|
|
block discarded – undo |
1013
|
1013
|
$factory = new $factoryClass($this); |
1014
|
1014
|
return $factory->getLDAPProvider(); |
1015
|
1015
|
}); |
1016
|
|
- $this->registerService(ILockingProvider::class, function (ContainerInterface $c) { |
|
1016
|
+ $this->registerService(ILockingProvider::class, function(ContainerInterface $c) { |
1017
|
1017
|
$ini = $c->get(IniGetWrapper::class); |
1018
|
1018
|
$config = $c->get(\OCP\IConfig::class); |
1019
|
1019
|
$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
|
@@ -1041,12 +1041,12 @@ discard block |
|
|
block discarded – undo |
1041
|
1041
|
/** @deprecated 19.0.0 */ |
1042
|
1042
|
$this->registerDeprecatedAlias('MountManager', IMountManager::class); |
1043
|
1043
|
|
1044
|
|
- $this->registerService(IMimeTypeDetector::class, function (ContainerInterface $c) { |
|
1044
|
+ $this->registerService(IMimeTypeDetector::class, function(ContainerInterface $c) { |
1045
|
1045
|
return new \OC\Files\Type\Detection( |
1046
|
1046
|
$c->get(IURLGenerator::class), |
1047
|
1047
|
$c->get(ILogger::class), |
1048
|
1048
|
\OC::$configDir, |
1049
|
|
- \OC::$SERVERROOT . '/resources/config/' |
|
1049
|
+ \OC::$SERVERROOT.'/resources/config/' |
1050
|
1050
|
); |
1051
|
1051
|
}); |
1052
|
1052
|
/** @deprecated 19.0.0 */ |
|
@@ -1055,19 +1055,19 @@ discard block |
|
|
block discarded – undo |
1055
|
1055
|
$this->registerAlias(IMimeTypeLoader::class, Loader::class); |
1056
|
1056
|
/** @deprecated 19.0.0 */ |
1057
|
1057
|
$this->registerDeprecatedAlias('MimeTypeLoader', IMimeTypeLoader::class); |
1058
|
|
- $this->registerService(BundleFetcher::class, function () { |
|
1058
|
+ $this->registerService(BundleFetcher::class, function() { |
1059
|
1059
|
return new BundleFetcher($this->getL10N('lib')); |
1060
|
1060
|
}); |
1061
|
1061
|
$this->registerAlias(\OCP\Notification\IManager::class, Manager::class); |
1062
|
1062
|
/** @deprecated 19.0.0 */ |
1063
|
1063
|
$this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class); |
1064
|
1064
|
|
1065
|
|
- $this->registerService(CapabilitiesManager::class, function (ContainerInterface $c) { |
|
1065
|
+ $this->registerService(CapabilitiesManager::class, function(ContainerInterface $c) { |
1066
|
1066
|
$manager = new CapabilitiesManager($c->get(ILogger::class)); |
1067
|
|
- $manager->registerCapability(function () use ($c) { |
|
1067
|
+ $manager->registerCapability(function() use ($c) { |
1068
|
1068
|
return new \OC\OCS\CoreCapabilities($c->get(\OCP\IConfig::class)); |
1069
|
1069
|
}); |
1070
|
|
- $manager->registerCapability(function () use ($c) { |
|
1070
|
+ $manager->registerCapability(function() use ($c) { |
1071
|
1071
|
return $c->get(\OC\Security\Bruteforce\Capabilities::class); |
1072
|
1072
|
}); |
1073
|
1073
|
return $manager; |
|
@@ -1075,14 +1075,14 @@ discard block |
|
|
block discarded – undo |
1075
|
1075
|
/** @deprecated 19.0.0 */ |
1076
|
1076
|
$this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class); |
1077
|
1077
|
|
1078
|
|
- $this->registerService(ICommentsManager::class, function (Server $c) { |
|
1078
|
+ $this->registerService(ICommentsManager::class, function(Server $c) { |
1079
|
1079
|
$config = $c->get(\OCP\IConfig::class); |
1080
|
1080
|
$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
1081
|
1081
|
/** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
1082
|
1082
|
$factory = new $factoryClass($this); |
1083
|
1083
|
$manager = $factory->getManager(); |
1084
|
1084
|
|
1085
|
|
- $manager->registerDisplayNameResolver('user', function ($id) use ($c) { |
|
1085
|
+ $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
1086
|
1086
|
$manager = $c->get(IUserManager::class); |
1087
|
1087
|
$user = $manager->get($id); |
1088
|
1088
|
if (is_null($user)) { |
|
@@ -1100,7 +1100,7 @@ discard block |
|
|
block discarded – undo |
1100
|
1100
|
$this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class); |
1101
|
1101
|
|
1102
|
1102
|
$this->registerAlias(\OC_Defaults::class, 'ThemingDefaults'); |
1103
|
|
- $this->registerService('ThemingDefaults', function (Server $c) { |
|
1103
|
+ $this->registerService('ThemingDefaults', function(Server $c) { |
1104
|
1104
|
/* |
1105
|
1105
|
* Dark magic for autoloader. |
1106
|
1106
|
* If we do a class_exists it will try to load the class which will |
|
@@ -1135,7 +1135,7 @@ discard block |
|
|
block discarded – undo |
1135
|
1135
|
} |
1136
|
1136
|
return new \OC_Defaults(); |
1137
|
1137
|
}); |
1138
|
|
- $this->registerService(JSCombiner::class, function (Server $c) { |
|
1138
|
+ $this->registerService(JSCombiner::class, function(Server $c) { |
1139
|
1139
|
return new JSCombiner( |
1140
|
1140
|
$c->getAppDataDir('js'), |
1141
|
1141
|
$c->get(IURLGenerator::class), |
|
@@ -1149,7 +1149,7 @@ discard block |
|
|
block discarded – undo |
1149
|
1149
|
$this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class); |
1150
|
1150
|
$this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class); |
1151
|
1151
|
|
1152
|
|
- $this->registerService('CryptoWrapper', function (ContainerInterface $c) { |
|
1152
|
+ $this->registerService('CryptoWrapper', function(ContainerInterface $c) { |
1153
|
1153
|
// FIXME: Instantiiated here due to cyclic dependency |
1154
|
1154
|
$request = new Request( |
1155
|
1155
|
[ |
|
@@ -1176,14 +1176,14 @@ discard block |
|
|
block discarded – undo |
1176
|
1176
|
}); |
1177
|
1177
|
/** @deprecated 19.0.0 */ |
1178
|
1178
|
$this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class); |
1179
|
|
- $this->registerService(SessionStorage::class, function (ContainerInterface $c) { |
|
1179
|
+ $this->registerService(SessionStorage::class, function(ContainerInterface $c) { |
1180
|
1180
|
return new SessionStorage($c->get(ISession::class)); |
1181
|
1181
|
}); |
1182
|
1182
|
$this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class); |
1183
|
1183
|
/** @deprecated 19.0.0 */ |
1184
|
1184
|
$this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class); |
1185
|
1185
|
|
1186
|
|
- $this->registerService(\OCP\Share\IManager::class, function (IServerContainer $c) { |
|
1186
|
+ $this->registerService(\OCP\Share\IManager::class, function(IServerContainer $c) { |
1187
|
1187
|
$config = $c->get(\OCP\IConfig::class); |
1188
|
1188
|
$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
1189
|
1189
|
/** @var \OCP\Share\IProviderFactory $factory */ |
|
@@ -1213,7 +1213,7 @@ discard block |
|
|
block discarded – undo |
1213
|
1213
|
/** @deprecated 19.0.0 */ |
1214
|
1214
|
$this->registerDeprecatedAlias('ShareManager', \OCP\Share\IManager::class); |
1215
|
1215
|
|
1216
|
|
- $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) { |
|
1216
|
+ $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function(Server $c) { |
1217
|
1217
|
$instance = new Collaboration\Collaborators\Search($c); |
1218
|
1218
|
|
1219
|
1219
|
// register default plugins |
|
@@ -1236,33 +1236,33 @@ discard block |
|
|
block discarded – undo |
1236
|
1236
|
|
1237
|
1237
|
$this->registerDeprecatedAlias('SettingsManager', \OC\Settings\Manager::class); |
1238
|
1238
|
$this->registerAlias(\OCP\Settings\IManager::class, \OC\Settings\Manager::class); |
1239
|
|
- $this->registerService(\OC\Files\AppData\Factory::class, function (ContainerInterface $c) { |
|
1239
|
+ $this->registerService(\OC\Files\AppData\Factory::class, function(ContainerInterface $c) { |
1240
|
1240
|
return new \OC\Files\AppData\Factory( |
1241
|
1241
|
$c->get(IRootFolder::class), |
1242
|
1242
|
$c->get(SystemConfig::class) |
1243
|
1243
|
); |
1244
|
1244
|
}); |
1245
|
1245
|
|
1246
|
|
- $this->registerService('LockdownManager', function (ContainerInterface $c) { |
1247
|
|
- return new LockdownManager(function () use ($c) { |
|
1246
|
+ $this->registerService('LockdownManager', function(ContainerInterface $c) { |
|
1247
|
+ return new LockdownManager(function() use ($c) { |
1248
|
1248
|
return $c->get(ISession::class); |
1249
|
1249
|
}); |
1250
|
1250
|
}); |
1251
|
1251
|
|
1252
|
|
- $this->registerService(\OCP\OCS\IDiscoveryService::class, function (ContainerInterface $c) { |
|
1252
|
+ $this->registerService(\OCP\OCS\IDiscoveryService::class, function(ContainerInterface $c) { |
1253
|
1253
|
return new DiscoveryService( |
1254
|
1254
|
$c->get(ICacheFactory::class), |
1255
|
1255
|
$c->get(IClientService::class) |
1256
|
1256
|
); |
1257
|
1257
|
}); |
1258
|
1258
|
|
1259
|
|
- $this->registerService(ICloudIdManager::class, function (ContainerInterface $c) { |
|
1259
|
+ $this->registerService(ICloudIdManager::class, function(ContainerInterface $c) { |
1260
|
1260
|
return new CloudIdManager($c->get(\OCP\Contacts\IManager::class)); |
1261
|
1261
|
}); |
1262
|
1262
|
|
1263
|
1263
|
$this->registerAlias(\OCP\GlobalScale\IConfig::class, \OC\GlobalScale\Config::class); |
1264
|
1264
|
|
1265
|
|
- $this->registerService(ICloudFederationProviderManager::class, function (ContainerInterface $c) { |
|
1265
|
+ $this->registerService(ICloudFederationProviderManager::class, function(ContainerInterface $c) { |
1266
|
1266
|
return new CloudFederationProviderManager( |
1267
|
1267
|
$c->get(IAppManager::class), |
1268
|
1268
|
$c->get(IClientService::class), |
|
@@ -1271,7 +1271,7 @@ discard block |
|
|
block discarded – undo |
1271
|
1271
|
); |
1272
|
1272
|
}); |
1273
|
1273
|
|
1274
|
|
- $this->registerService(ICloudFederationFactory::class, function (Server $c) { |
|
1274
|
+ $this->registerService(ICloudFederationFactory::class, function(Server $c) { |
1275
|
1275
|
return new CloudFederationFactory(); |
1276
|
1276
|
}); |
1277
|
1277
|
|
|
@@ -1283,7 +1283,7 @@ discard block |
|
|
block discarded – undo |
1283
|
1283
|
/** @deprecated 19.0.0 */ |
1284
|
1284
|
$this->registerDeprecatedAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
1285
|
1285
|
|
1286
|
|
- $this->registerService(Defaults::class, function (Server $c) { |
|
1286
|
+ $this->registerService(Defaults::class, function(Server $c) { |
1287
|
1287
|
return new Defaults( |
1288
|
1288
|
$c->getThemingDefaults() |
1289
|
1289
|
); |
|
@@ -1291,17 +1291,17 @@ discard block |
|
|
block discarded – undo |
1291
|
1291
|
/** @deprecated 19.0.0 */ |
1292
|
1292
|
$this->registerDeprecatedAlias('Defaults', \OCP\Defaults::class); |
1293
|
1293
|
|
1294
|
|
- $this->registerService(\OCP\ISession::class, function (ContainerInterface $c) { |
|
1294
|
+ $this->registerService(\OCP\ISession::class, function(ContainerInterface $c) { |
1295
|
1295
|
return $c->get(\OCP\IUserSession::class)->getSession(); |
1296
|
1296
|
}, false); |
1297
|
1297
|
|
1298
|
|
- $this->registerService(IShareHelper::class, function (ContainerInterface $c) { |
|
1298
|
+ $this->registerService(IShareHelper::class, function(ContainerInterface $c) { |
1299
|
1299
|
return new ShareHelper( |
1300
|
1300
|
$c->get(\OCP\Share\IManager::class) |
1301
|
1301
|
); |
1302
|
1302
|
}); |
1303
|
1303
|
|
1304
|
|
- $this->registerService(Installer::class, function (ContainerInterface $c) { |
|
1304
|
+ $this->registerService(Installer::class, function(ContainerInterface $c) { |
1305
|
1305
|
return new Installer( |
1306
|
1306
|
$c->get(AppFetcher::class), |
1307
|
1307
|
$c->get(IClientService::class), |
|
@@ -1312,11 +1312,11 @@ discard block |
|
|
block discarded – undo |
1312
|
1312
|
); |
1313
|
1313
|
}); |
1314
|
1314
|
|
1315
|
|
- $this->registerService(IApiFactory::class, function (ContainerInterface $c) { |
|
1315
|
+ $this->registerService(IApiFactory::class, function(ContainerInterface $c) { |
1316
|
1316
|
return new ApiFactory($c->get(IClientService::class)); |
1317
|
1317
|
}); |
1318
|
1318
|
|
1319
|
|
- $this->registerService(IInstanceFactory::class, function (ContainerInterface $c) { |
|
1319
|
+ $this->registerService(IInstanceFactory::class, function(ContainerInterface $c) { |
1320
|
1320
|
$memcacheFactory = $c->get(ICacheFactory::class); |
1321
|
1321
|
return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->get(IClientService::class)); |
1322
|
1322
|
}); |
|
@@ -1373,7 +1373,7 @@ discard block |
|
|
block discarded – undo |
1373
|
1373
|
$dispatcher = $this->get(SymfonyAdapter::class); |
1374
|
1374
|
|
1375
|
1375
|
// Delete avatar on user deletion |
1376
|
|
- $dispatcher->addListener('OCP\IUser::preDelete', function (GenericEvent $e) { |
|
1376
|
+ $dispatcher->addListener('OCP\IUser::preDelete', function(GenericEvent $e) { |
1377
|
1377
|
$logger = $this->get(ILogger::class); |
1378
|
1378
|
$manager = $this->getAvatarManager(); |
1379
|
1379
|
/** @var IUser $user */ |
|
@@ -1386,11 +1386,11 @@ discard block |
|
|
block discarded – undo |
1386
|
1386
|
// no avatar to remove |
1387
|
1387
|
} catch (\Exception $e) { |
1388
|
1388
|
// Ignore exceptions |
1389
|
|
- $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
1389
|
+ $logger->info('Could not cleanup avatar of '.$user->getUID()); |
1390
|
1390
|
} |
1391
|
1391
|
}); |
1392
|
1392
|
|
1393
|
|
- $dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) { |
|
1393
|
+ $dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) { |
1394
|
1394
|
$manager = $this->getAvatarManager(); |
1395
|
1395
|
/** @var IUser $user */ |
1396
|
1396
|
$user = $e->getSubject(); |
|
@@ -2281,11 +2281,11 @@ discard block |
|
|
block discarded – undo |
2281
|
2281
|
} |
2282
|
2282
|
|
2283
|
2283
|
private function registerDeprecatedAlias(string $alias, string $target) { |
2284
|
|
- $this->registerService($alias, function (ContainerInterface $container) use ($target, $alias) { |
|
2284
|
+ $this->registerService($alias, function(ContainerInterface $container) use ($target, $alias) { |
2285
|
2285
|
try { |
2286
|
2286
|
/** @var ILogger $logger */ |
2287
|
2287
|
$logger = $container->get(ILogger::class); |
2288
|
|
- $logger->debug('The requested alias "' . $alias . '" is deprecated. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); |
|
2288
|
+ $logger->debug('The requested alias "'.$alias.'" is deprecated. Please request "'.$target.'" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); |
2289
|
2289
|
} catch (ContainerExceptionInterface $e) { |
2290
|
2290
|
// Could not get logger. Continue |
2291
|
2291
|
} |