|
@@ -258,10 +258,10 @@ discard block |
|
|
block discarded – undo |
|
258
|
258
|
$this->registerParameter('isCLI', \OC::$CLI); |
|
259
|
259
|
$this->registerParameter('serverRoot', \OC::$SERVERROOT); |
|
260
|
260
|
|
|
261
|
|
- $this->registerService(ContainerInterface::class, function (ContainerInterface $c) { |
|
|
261
|
+ $this->registerService(ContainerInterface::class, function(ContainerInterface $c) { |
|
262
|
262
|
return $c; |
|
263
|
263
|
}); |
|
264
|
|
- $this->registerService(\OCP\IServerContainer::class, function (ContainerInterface $c) { |
|
|
264
|
+ $this->registerService(\OCP\IServerContainer::class, function(ContainerInterface $c) { |
|
265
|
265
|
return $c; |
|
266
|
266
|
}); |
|
267
|
267
|
|
|
@@ -286,7 +286,7 @@ discard block |
|
|
block discarded – undo |
|
286
|
286
|
$this->registerAlias(IActionFactory::class, ActionFactory::class); |
|
287
|
287
|
|
|
288
|
288
|
|
|
289
|
|
- $this->registerService(IPreview::class, function (Server $c) { |
|
|
289
|
+ $this->registerService(IPreview::class, function(Server $c) { |
|
290
|
290
|
return new PreviewManager( |
|
291
|
291
|
$c->getConfig(), |
|
292
|
292
|
$c->getRootFolder(), |
|
@@ -299,13 +299,13 @@ discard block |
|
|
block discarded – undo |
|
299
|
299
|
/** @deprecated 19.0.0 */ |
|
300
|
300
|
$this->registerDeprecatedAlias('PreviewManager', IPreview::class); |
|
301
|
301
|
|
|
302
|
|
- $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
|
302
|
+ $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
303
|
303
|
return new \OC\Preview\Watcher( |
|
304
|
304
|
new \OC\Preview\Storage\Root($c->getRootFolder(), $c->getSystemConfig()) |
|
305
|
305
|
); |
|
306
|
306
|
}); |
|
307
|
307
|
|
|
308
|
|
- $this->registerService(\OCP\Encryption\IManager::class, function (Server $c) { |
|
|
308
|
+ $this->registerService(\OCP\Encryption\IManager::class, function(Server $c) { |
|
309
|
309
|
$view = new View(); |
|
310
|
310
|
$util = new Encryption\Util( |
|
311
|
311
|
$view, |
|
@@ -325,7 +325,7 @@ discard block |
|
|
block discarded – undo |
|
325
|
325
|
/** @deprecated 19.0.0 */ |
|
326
|
326
|
$this->registerDeprecatedAlias('EncryptionManager', \OCP\Encryption\IManager::class); |
|
327
|
327
|
|
|
328
|
|
- $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
|
328
|
+ $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
329
|
329
|
$util = new Encryption\Util( |
|
330
|
330
|
new View(), |
|
331
|
331
|
$c->getUserManager(), |
|
@@ -339,7 +339,7 @@ discard block |
|
|
block discarded – undo |
|
339
|
339
|
); |
|
340
|
340
|
}); |
|
341
|
341
|
|
|
342
|
|
- $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
|
342
|
+ $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
343
|
343
|
$view = new View(); |
|
344
|
344
|
$util = new Encryption\Util( |
|
345
|
345
|
$view, |
|
@@ -357,21 +357,21 @@ discard block |
|
|
block discarded – undo |
|
357
|
357
|
/** @deprecated 19.0.0 */ |
|
358
|
358
|
$this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class); |
|
359
|
359
|
|
|
360
|
|
- $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
|
360
|
+ $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
361
|
361
|
$config = $c->getConfig(); |
|
362
|
362
|
$factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
|
363
|
363
|
return new $factoryClass($this); |
|
364
|
364
|
}); |
|
365
|
|
- $this->registerService(ISystemTagManager::class, function (Server $c) { |
|
|
365
|
+ $this->registerService(ISystemTagManager::class, function(Server $c) { |
|
366
|
366
|
return $c->query('SystemTagManagerFactory')->getManager(); |
|
367
|
367
|
}); |
|
368
|
368
|
/** @deprecated 19.0.0 */ |
|
369
|
369
|
$this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class); |
|
370
|
370
|
|
|
371
|
|
- $this->registerService(ISystemTagObjectMapper::class, function (Server $c) { |
|
|
371
|
+ $this->registerService(ISystemTagObjectMapper::class, function(Server $c) { |
|
372
|
372
|
return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
|
373
|
373
|
}); |
|
374
|
|
- $this->registerService('RootFolder', function (Server $c) { |
|
|
374
|
+ $this->registerService('RootFolder', function(Server $c) { |
|
375
|
375
|
$manager = \OC\Files\Filesystem::getMountManager(null); |
|
376
|
376
|
$view = new View(); |
|
377
|
377
|
$root = new Root( |
|
@@ -388,7 +388,7 @@ discard block |
|
|
block discarded – undo |
|
388
|
388
|
|
|
389
|
389
|
return $root; |
|
390
|
390
|
}); |
|
391
|
|
- $this->registerService(HookConnector::class, function (Server $c) { |
|
|
391
|
+ $this->registerService(HookConnector::class, function(Server $c) { |
|
392
|
392
|
return new HookConnector( |
|
393
|
393
|
$c->query(IRootFolder::class), |
|
394
|
394
|
new View(), |
|
@@ -400,8 +400,8 @@ discard block |
|
|
block discarded – undo |
|
400
|
400
|
/** @deprecated 19.0.0 */ |
|
401
|
401
|
$this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class); |
|
402
|
402
|
|
|
403
|
|
- $this->registerService(IRootFolder::class, function (Server $c) { |
|
404
|
|
- return new LazyRoot(function () use ($c) { |
|
|
403
|
+ $this->registerService(IRootFolder::class, function(Server $c) { |
|
|
404
|
+ return new LazyRoot(function() use ($c) { |
|
405
|
405
|
return $c->query('RootFolder'); |
|
406
|
406
|
}); |
|
407
|
407
|
}); |
|
@@ -412,44 +412,44 @@ discard block |
|
|
block discarded – undo |
|
412
|
412
|
$this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class); |
|
413
|
413
|
$this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
|
414
|
414
|
|
|
415
|
|
- $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
|
415
|
+ $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
416
|
416
|
$groupManager = new \OC\Group\Manager($this->getUserManager(), $c->getEventDispatcher(), $this->getLogger()); |
|
417
|
|
- $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
|
417
|
+ $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
418
|
418
|
\OC_Hook::emit('OC_Group', 'pre_createGroup', ['run' => true, 'gid' => $gid]); |
|
419
|
419
|
|
|
420
|
420
|
/** @var IEventDispatcher $dispatcher */ |
|
421
|
421
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
422
|
422
|
$dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid)); |
|
423
|
423
|
}); |
|
424
|
|
- $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) { |
|
|
424
|
+ $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $group) { |
|
425
|
425
|
\OC_Hook::emit('OC_User', 'post_createGroup', ['gid' => $group->getGID()]); |
|
426
|
426
|
|
|
427
|
427
|
/** @var IEventDispatcher $dispatcher */ |
|
428
|
428
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
429
|
429
|
$dispatcher->dispatchTyped(new GroupCreatedEvent($group)); |
|
430
|
430
|
}); |
|
431
|
|
- $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
|
431
|
+ $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
432
|
432
|
\OC_Hook::emit('OC_Group', 'pre_deleteGroup', ['run' => true, 'gid' => $group->getGID()]); |
|
433
|
433
|
|
|
434
|
434
|
/** @var IEventDispatcher $dispatcher */ |
|
435
|
435
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
436
|
436
|
$dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group)); |
|
437
|
437
|
}); |
|
438
|
|
- $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
|
438
|
+ $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
439
|
439
|
\OC_Hook::emit('OC_User', 'post_deleteGroup', ['gid' => $group->getGID()]); |
|
440
|
440
|
|
|
441
|
441
|
/** @var IEventDispatcher $dispatcher */ |
|
442
|
442
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
443
|
443
|
$dispatcher->dispatchTyped(new GroupDeletedEvent($group)); |
|
444
|
444
|
}); |
|
445
|
|
- $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
|
445
|
+ $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
446
|
446
|
\OC_Hook::emit('OC_Group', 'pre_addToGroup', ['run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()]); |
|
447
|
447
|
|
|
448
|
448
|
/** @var IEventDispatcher $dispatcher */ |
|
449
|
449
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
450
|
450
|
$dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user)); |
|
451
|
451
|
}); |
|
452
|
|
- $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
|
452
|
+ $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
453
|
453
|
\OC_Hook::emit('OC_Group', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]); |
|
454
|
454
|
//Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
|
455
|
455
|
\OC_Hook::emit('OC_User', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]); |
|
@@ -458,12 +458,12 @@ discard block |
|
|
block discarded – undo |
|
458
|
458
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
459
|
459
|
$dispatcher->dispatchTyped(new UserAddedEvent($group, $user)); |
|
460
|
460
|
}); |
|
461
|
|
- $groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
|
461
|
+ $groupManager->listen('\OC\Group', 'preRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
462
|
462
|
/** @var IEventDispatcher $dispatcher */ |
|
463
|
463
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
464
|
464
|
$dispatcher->dispatchTyped(new BeforeUserRemovedEvent($group, $user)); |
|
465
|
465
|
}); |
|
466
|
|
- $groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
|
466
|
+ $groupManager->listen('\OC\Group', 'postRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
467
|
467
|
/** @var IEventDispatcher $dispatcher */ |
|
468
|
468
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
469
|
469
|
$dispatcher->dispatchTyped(new UserRemovedEvent($group, $user)); |
|
@@ -473,7 +473,7 @@ discard block |
|
|
block discarded – undo |
|
473
|
473
|
/** @deprecated 19.0.0 */ |
|
474
|
474
|
$this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class); |
|
475
|
475
|
|
|
476
|
|
- $this->registerService(Store::class, function (Server $c) { |
|
|
476
|
+ $this->registerService(Store::class, function(Server $c) { |
|
477
|
477
|
$session = $c->getSession(); |
|
478
|
478
|
if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
479
|
479
|
$tokenProvider = $c->query(IProvider::class); |
|
@@ -486,7 +486,7 @@ discard block |
|
|
block discarded – undo |
|
486
|
486
|
$this->registerAlias(IStore::class, Store::class); |
|
487
|
487
|
$this->registerAlias(IProvider::class, Authentication\Token\Manager::class); |
|
488
|
488
|
|
|
489
|
|
- $this->registerService(\OC\User\Session::class, function (Server $c) { |
|
|
489
|
+ $this->registerService(\OC\User\Session::class, function(Server $c) { |
|
490
|
490
|
$manager = $c->getUserManager(); |
|
491
|
491
|
$session = new \OC\Session\Memory(''); |
|
492
|
492
|
$timeFactory = new TimeFactory(); |
|
@@ -511,14 +511,14 @@ discard block |
|
|
block discarded – undo |
|
511
|
511
|
$c->getLogger(), |
|
512
|
512
|
$c->query(IEventDispatcher::class) |
|
513
|
513
|
); |
|
514
|
|
- $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
|
514
|
+ $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
515
|
515
|
\OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]); |
|
516
|
516
|
|
|
517
|
517
|
/** @var IEventDispatcher $dispatcher */ |
|
518
|
518
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
519
|
519
|
$dispatcher->dispatchTyped(new BeforeUserCreatedEvent($uid, $password)); |
|
520
|
520
|
}); |
|
521
|
|
- $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
|
521
|
+ $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
522
|
522
|
/** @var \OC\User\User $user */ |
|
523
|
523
|
\OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]); |
|
524
|
524
|
|
|
@@ -526,7 +526,7 @@ discard block |
|
|
block discarded – undo |
|
526
|
526
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
527
|
527
|
$dispatcher->dispatchTyped(new UserCreatedEvent($user, $password)); |
|
528
|
528
|
}); |
|
529
|
|
- $userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) { |
|
|
529
|
+ $userSession->listen('\OC\User', 'preDelete', function($user) use ($legacyDispatcher) { |
|
530
|
530
|
/** @var \OC\User\User $user */ |
|
531
|
531
|
\OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]); |
|
532
|
532
|
$legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
|
@@ -535,7 +535,7 @@ discard block |
|
|
block discarded – undo |
|
535
|
535
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
536
|
536
|
$dispatcher->dispatchTyped(new BeforeUserDeletedEvent($user)); |
|
537
|
537
|
}); |
|
538
|
|
- $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
|
538
|
+ $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
539
|
539
|
/** @var \OC\User\User $user */ |
|
540
|
540
|
\OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]); |
|
541
|
541
|
|
|
@@ -543,7 +543,7 @@ discard block |
|
|
block discarded – undo |
|
543
|
543
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
544
|
544
|
$dispatcher->dispatchTyped(new UserDeletedEvent($user)); |
|
545
|
545
|
}); |
|
546
|
|
- $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
|
546
|
+ $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
547
|
547
|
/** @var \OC\User\User $user */ |
|
548
|
548
|
\OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]); |
|
549
|
549
|
|
|
@@ -551,7 +551,7 @@ discard block |
|
|
block discarded – undo |
|
551
|
551
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
552
|
552
|
$dispatcher->dispatchTyped(new BeforePasswordUpdatedEvent($user, $password, $recoveryPassword)); |
|
553
|
553
|
}); |
|
554
|
|
- $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
|
554
|
+ $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
555
|
555
|
/** @var \OC\User\User $user */ |
|
556
|
556
|
\OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]); |
|
557
|
557
|
|
|
@@ -559,14 +559,14 @@ discard block |
|
|
block discarded – undo |
|
559
|
559
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
560
|
560
|
$dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword)); |
|
561
|
561
|
}); |
|
562
|
|
- $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
|
562
|
+ $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
563
|
563
|
\OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]); |
|
564
|
564
|
|
|
565
|
565
|
/** @var IEventDispatcher $dispatcher */ |
|
566
|
566
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
567
|
567
|
$dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password)); |
|
568
|
568
|
}); |
|
569
|
|
- $userSession->listen('\OC\User', 'postLogin', function ($user, $password, $isTokenLogin) { |
|
|
569
|
+ $userSession->listen('\OC\User', 'postLogin', function($user, $password, $isTokenLogin) { |
|
570
|
570
|
/** @var \OC\User\User $user */ |
|
571
|
571
|
\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'isTokenLogin' => $isTokenLogin]); |
|
572
|
572
|
|
|
@@ -574,12 +574,12 @@ discard block |
|
|
block discarded – undo |
|
574
|
574
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
575
|
575
|
$dispatcher->dispatchTyped(new UserLoggedInEvent($user, $password, $isTokenLogin)); |
|
576
|
576
|
}); |
|
577
|
|
- $userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) { |
|
|
577
|
+ $userSession->listen('\OC\User', 'preRememberedLogin', function($uid) { |
|
578
|
578
|
/** @var IEventDispatcher $dispatcher */ |
|
579
|
579
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
580
|
580
|
$dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid)); |
|
581
|
581
|
}); |
|
582
|
|
- $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
|
582
|
+ $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
583
|
583
|
/** @var \OC\User\User $user */ |
|
584
|
584
|
\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]); |
|
585
|
585
|
|
|
@@ -587,19 +587,19 @@ discard block |
|
|
block discarded – undo |
|
587
|
587
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
588
|
588
|
$dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password)); |
|
589
|
589
|
}); |
|
590
|
|
- $userSession->listen('\OC\User', 'logout', function ($user) { |
|
|
590
|
+ $userSession->listen('\OC\User', 'logout', function($user) { |
|
591
|
591
|
\OC_Hook::emit('OC_User', 'logout', []); |
|
592
|
592
|
|
|
593
|
593
|
/** @var IEventDispatcher $dispatcher */ |
|
594
|
594
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
595
|
595
|
$dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user)); |
|
596
|
596
|
}); |
|
597
|
|
- $userSession->listen('\OC\User', 'postLogout', function ($user) { |
|
|
597
|
+ $userSession->listen('\OC\User', 'postLogout', function($user) { |
|
598
|
598
|
/** @var IEventDispatcher $dispatcher */ |
|
599
|
599
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
600
|
600
|
$dispatcher->dispatchTyped(new UserLoggedOutEvent($user)); |
|
601
|
601
|
}); |
|
602
|
|
- $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
|
|
602
|
+ $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) { |
|
603
|
603
|
/** @var \OC\User\User $user */ |
|
604
|
604
|
\OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]); |
|
605
|
605
|
|
|
@@ -623,7 +623,7 @@ discard block |
|
|
block discarded – undo |
|
623
|
623
|
$this->registerDeprecatedAlias('AllConfig', \OC\AllConfig::class); |
|
624
|
624
|
$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
|
625
|
625
|
|
|
626
|
|
- $this->registerService(\OC\SystemConfig::class, function ($c) use ($config) { |
|
|
626
|
+ $this->registerService(\OC\SystemConfig::class, function($c) use ($config) { |
|
627
|
627
|
return new \OC\SystemConfig($config); |
|
628
|
628
|
}); |
|
629
|
629
|
/** @deprecated 19.0.0 */ |
|
@@ -633,7 +633,7 @@ discard block |
|
|
block discarded – undo |
|
633
|
633
|
$this->registerDeprecatedAlias('AppConfig', \OC\AppConfig::class); |
|
634
|
634
|
$this->registerAlias(IAppConfig::class, \OC\AppConfig::class); |
|
635
|
635
|
|
|
636
|
|
- $this->registerService(IFactory::class, function (Server $c) { |
|
|
636
|
+ $this->registerService(IFactory::class, function(Server $c) { |
|
637
|
637
|
return new \OC\L10N\Factory( |
|
638
|
638
|
$c->getConfig(), |
|
639
|
639
|
$c->getRequest(), |
|
@@ -653,13 +653,13 @@ discard block |
|
|
block discarded – undo |
|
653
|
653
|
/** @deprecated 19.0.0 */ |
|
654
|
654
|
$this->registerDeprecatedAlias('CategoryFetcher', CategoryFetcher::class); |
|
655
|
655
|
|
|
656
|
|
- $this->registerService(ICache::class, function ($c) { |
|
|
656
|
+ $this->registerService(ICache::class, function($c) { |
|
657
|
657
|
return new Cache\File(); |
|
658
|
658
|
}); |
|
659
|
659
|
/** @deprecated 19.0.0 */ |
|
660
|
660
|
$this->registerDeprecatedAlias('UserCache', ICache::class); |
|
661
|
661
|
|
|
662
|
|
- $this->registerService(Factory::class, function (Server $c) { |
|
|
662
|
+ $this->registerService(Factory::class, function(Server $c) { |
|
663
|
663
|
$arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
|
664
|
664
|
ArrayCache::class, |
|
665
|
665
|
ArrayCache::class, |
|
@@ -673,7 +673,7 @@ discard block |
|
|
block discarded – undo |
|
673
|
673
|
$version = implode(',', $v); |
|
674
|
674
|
$instanceId = \OC_Util::getInstanceId(); |
|
675
|
675
|
$path = \OC::$SERVERROOT; |
|
676
|
|
- $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
|
676
|
+ $prefix = md5($instanceId.'-'.$version.'-'.$path); |
|
677
|
677
|
return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
|
678
|
678
|
$config->getSystemValue('memcache.local', null), |
|
679
|
679
|
$config->getSystemValue('memcache.distributed', null), |
|
@@ -686,12 +686,12 @@ discard block |
|
|
block discarded – undo |
|
686
|
686
|
$this->registerDeprecatedAlias('MemCacheFactory', Factory::class); |
|
687
|
687
|
$this->registerAlias(ICacheFactory::class, Factory::class); |
|
688
|
688
|
|
|
689
|
|
- $this->registerService('RedisFactory', function (Server $c) { |
|
|
689
|
+ $this->registerService('RedisFactory', function(Server $c) { |
|
690
|
690
|
$systemConfig = $c->getSystemConfig(); |
|
691
|
691
|
return new RedisFactory($systemConfig); |
|
692
|
692
|
}); |
|
693
|
693
|
|
|
694
|
|
- $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
|
694
|
+ $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
695
|
695
|
$l10n = $this->get(IFactory::class)->get('activity'); |
|
696
|
696
|
return new \OC\Activity\Manager( |
|
697
|
697
|
$c->getRequest(), |
|
@@ -704,14 +704,14 @@ discard block |
|
|
block discarded – undo |
|
704
|
704
|
/** @deprecated 19.0.0 */ |
|
705
|
705
|
$this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class); |
|
706
|
706
|
|
|
707
|
|
- $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
|
707
|
+ $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
708
|
708
|
return new \OC\Activity\EventMerger( |
|
709
|
709
|
$c->getL10N('lib') |
|
710
|
710
|
); |
|
711
|
711
|
}); |
|
712
|
712
|
$this->registerAlias(IValidator::class, Validator::class); |
|
713
|
713
|
|
|
714
|
|
- $this->registerService(AvatarManager::class, function (Server $c) { |
|
|
714
|
+ $this->registerService(AvatarManager::class, function(Server $c) { |
|
715
|
715
|
return new AvatarManager( |
|
716
|
716
|
$c->query(\OC\User\Manager::class), |
|
717
|
717
|
$c->getAppDataDir('avatar'), |
|
@@ -727,7 +727,7 @@ discard block |
|
|
block discarded – undo |
|
727
|
727
|
$this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
|
728
|
728
|
$this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class); |
|
729
|
729
|
|
|
730
|
|
- $this->registerService(\OC\Log::class, function (Server $c) { |
|
|
730
|
+ $this->registerService(\OC\Log::class, function(Server $c) { |
|
731
|
731
|
$logType = $c->query(AllConfig::class)->getSystemValue('log_type', 'file'); |
|
732
|
732
|
$factory = new LogFactory($c, $this->getSystemConfig()); |
|
733
|
733
|
$logger = $factory->get($logType); |
|
@@ -741,7 +741,7 @@ discard block |
|
|
block discarded – undo |
|
741
|
741
|
// PSR-3 logger |
|
742
|
742
|
$this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class); |
|
743
|
743
|
|
|
744
|
|
- $this->registerService(ILogFactory::class, function (Server $c) { |
|
|
744
|
+ $this->registerService(ILogFactory::class, function(Server $c) { |
|
745
|
745
|
return new LogFactory($c, $this->getSystemConfig()); |
|
746
|
746
|
}); |
|
747
|
747
|
|
|
@@ -749,7 +749,7 @@ discard block |
|
|
block discarded – undo |
|
749
|
749
|
/** @deprecated 19.0.0 */ |
|
750
|
750
|
$this->registerDeprecatedAlias('JobList', IJobList::class); |
|
751
|
751
|
|
|
752
|
|
- $this->registerService(IRouter::class, function (Server $c) { |
|
|
752
|
+ $this->registerService(IRouter::class, function(Server $c) { |
|
753
|
753
|
$cacheFactory = $c->getMemCacheFactory(); |
|
754
|
754
|
$logger = $c->getLogger(); |
|
755
|
755
|
if ($cacheFactory->isLocalCacheAvailable()) { |
|
@@ -766,7 +766,7 @@ discard block |
|
|
block discarded – undo |
|
766
|
766
|
/** @deprecated 19.0.0 */ |
|
767
|
767
|
$this->registerDeprecatedAlias('Search', ISearch::class); |
|
768
|
768
|
|
|
769
|
|
- $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
|
769
|
+ $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
770
|
770
|
return new \OC\Security\RateLimiting\Backend\MemoryCache( |
|
771
|
771
|
$this->getMemCacheFactory(), |
|
772
|
772
|
new \OC\AppFramework\Utility\TimeFactory() |
|
@@ -789,7 +789,7 @@ discard block |
|
|
block discarded – undo |
|
789
|
789
|
/** @deprecated 19.0.0 */ |
|
790
|
790
|
$this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class); |
|
791
|
791
|
|
|
792
|
|
- $this->registerService(IDBConnection::class, function (Server $c) { |
|
|
792
|
+ $this->registerService(IDBConnection::class, function(Server $c) { |
|
793
|
793
|
$systemConfig = $c->getSystemConfig(); |
|
794
|
794
|
$factory = new \OC\DB\ConnectionFactory($systemConfig); |
|
795
|
795
|
$type = $systemConfig->getValue('dbtype', 'sqlite'); |
|
@@ -805,7 +805,7 @@ discard block |
|
|
block discarded – undo |
|
805
|
805
|
$this->registerDeprecatedAlias('DatabaseConnection', IDBConnection::class); |
|
806
|
806
|
|
|
807
|
807
|
|
|
808
|
|
- $this->registerService(IClientService::class, function (Server $c) { |
|
|
808
|
+ $this->registerService(IClientService::class, function(Server $c) { |
|
809
|
809
|
$user = \OC_User::getUser(); |
|
810
|
810
|
$uid = $user ? $user : null; |
|
811
|
811
|
return new ClientService( |
|
@@ -822,7 +822,7 @@ discard block |
|
|
block discarded – undo |
|
822
|
822
|
}); |
|
823
|
823
|
/** @deprecated 19.0.0 */ |
|
824
|
824
|
$this->registerDeprecatedAlias('HttpClientService', IClientService::class); |
|
825
|
|
- $this->registerService(IEventLogger::class, function (Server $c) { |
|
|
825
|
+ $this->registerService(IEventLogger::class, function(Server $c) { |
|
826
|
826
|
$eventLogger = new EventLogger(); |
|
827
|
827
|
if ($c->getSystemConfig()->getValue('debug', false)) { |
|
828
|
828
|
// In debug mode, module is being activated by default |
|
@@ -833,7 +833,7 @@ discard block |
|
|
block discarded – undo |
|
833
|
833
|
/** @deprecated 19.0.0 */ |
|
834
|
834
|
$this->registerDeprecatedAlias('EventLogger', IEventLogger::class); |
|
835
|
835
|
|
|
836
|
|
- $this->registerService(IQueryLogger::class, function (Server $c) { |
|
|
836
|
+ $this->registerService(IQueryLogger::class, function(Server $c) { |
|
837
|
837
|
$queryLogger = new QueryLogger(); |
|
838
|
838
|
if ($c->getSystemConfig()->getValue('debug', false)) { |
|
839
|
839
|
// In debug mode, module is being activated by default |
|
@@ -848,7 +848,7 @@ discard block |
|
|
block discarded – undo |
|
848
|
848
|
$this->registerDeprecatedAlias('TempManager', TempManager::class); |
|
849
|
849
|
$this->registerAlias(ITempManager::class, TempManager::class); |
|
850
|
850
|
|
|
851
|
|
- $this->registerService(AppManager::class, function (Server $c) { |
|
|
851
|
+ $this->registerService(AppManager::class, function(Server $c) { |
|
852
|
852
|
return new \OC\App\AppManager( |
|
853
|
853
|
$c->getUserSession(), |
|
854
|
854
|
$c->getConfig(), |
|
@@ -867,7 +867,7 @@ discard block |
|
|
block discarded – undo |
|
867
|
867
|
/** @deprecated 19.0.0 */ |
|
868
|
868
|
$this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class); |
|
869
|
869
|
|
|
870
|
|
- $this->registerService(IDateTimeFormatter::class, function (Server $c) { |
|
|
870
|
+ $this->registerService(IDateTimeFormatter::class, function(Server $c) { |
|
871
|
871
|
$language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
|
872
|
872
|
|
|
873
|
873
|
return new DateTimeFormatter( |
|
@@ -878,7 +878,7 @@ discard block |
|
|
block discarded – undo |
|
878
|
878
|
/** @deprecated 19.0.0 */ |
|
879
|
879
|
$this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class); |
|
880
|
880
|
|
|
881
|
|
- $this->registerService(IUserMountCache::class, function (Server $c) { |
|
|
881
|
+ $this->registerService(IUserMountCache::class, function(Server $c) { |
|
882
|
882
|
$mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
|
883
|
883
|
$listener = new UserMountCacheListener($mountCache); |
|
884
|
884
|
$listener->listen($c->getUserManager()); |
|
@@ -887,7 +887,7 @@ discard block |
|
|
block discarded – undo |
|
887
|
887
|
/** @deprecated 19.0.0 */ |
|
888
|
888
|
$this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class); |
|
889
|
889
|
|
|
890
|
|
- $this->registerService(IMountProviderCollection::class, function (Server $c) { |
|
|
890
|
+ $this->registerService(IMountProviderCollection::class, function(Server $c) { |
|
891
|
891
|
$loader = \OC\Files\Filesystem::getLoader(); |
|
892
|
892
|
$mountCache = $c->query(IUserMountCache::class); |
|
893
|
893
|
$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
|
@@ -908,7 +908,7 @@ discard block |
|
|
block discarded – undo |
|
908
|
908
|
|
|
909
|
909
|
/** @deprecated 20.0.0 */ |
|
910
|
910
|
$this->registerDeprecatedAlias('IniWrapper', IniGetWrapper::class); |
|
911
|
|
- $this->registerService('AsyncCommandBus', function (Server $c) { |
|
|
911
|
+ $this->registerService('AsyncCommandBus', function(Server $c) { |
|
912
|
912
|
$busClass = $c->getConfig()->getSystemValue('commandbus'); |
|
913
|
913
|
if ($busClass) { |
|
914
|
914
|
[$app, $class] = explode('::', $busClass, 2); |
|
@@ -928,7 +928,7 @@ discard block |
|
|
block discarded – undo |
|
928
|
928
|
$this->registerDeprecatedAlias('TrustedDomainHelper', TrustedDomainHelper::class); |
|
929
|
929
|
/** @deprecated 19.0.0 */ |
|
930
|
930
|
$this->registerDeprecatedAlias('Throttler', Throttler::class); |
|
931
|
|
- $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
|
931
|
+ $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
932
|
932
|
// IConfig and IAppManager requires a working database. This code |
|
933
|
933
|
// might however be called when ownCloud is not yet setup. |
|
934
|
934
|
if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
@@ -950,7 +950,7 @@ discard block |
|
|
block discarded – undo |
|
950
|
950
|
$c->getMimeTypeDetector() |
|
951
|
951
|
); |
|
952
|
952
|
}); |
|
953
|
|
- $this->registerService(\OCP\IRequest::class, function ($c) { |
|
|
953
|
+ $this->registerService(\OCP\IRequest::class, function($c) { |
|
954
|
954
|
if (isset($this['urlParams'])) { |
|
955
|
955
|
$urlParams = $this['urlParams']; |
|
956
|
956
|
} else { |
|
@@ -987,7 +987,7 @@ discard block |
|
|
block discarded – undo |
|
987
|
987
|
/** @deprecated 19.0.0 */ |
|
988
|
988
|
$this->registerDeprecatedAlias('Request', \OCP\IRequest::class); |
|
989
|
989
|
|
|
990
|
|
- $this->registerService(IMailer::class, function (Server $c) { |
|
|
990
|
+ $this->registerService(IMailer::class, function(Server $c) { |
|
991
|
991
|
return new Mailer( |
|
992
|
992
|
$c->getConfig(), |
|
993
|
993
|
$c->getLogger(), |
|
@@ -1001,7 +1001,7 @@ discard block |
|
|
block discarded – undo |
|
1001
|
1001
|
/** @deprecated 19.0.0 */ |
|
1002
|
1002
|
$this->registerDeprecatedAlias('Mailer', IMailer::class); |
|
1003
|
1003
|
|
|
1004
|
|
- $this->registerService('LDAPProvider', function (Server $c) { |
|
|
1004
|
+ $this->registerService('LDAPProvider', function(Server $c) { |
|
1005
|
1005
|
$config = $c->getConfig(); |
|
1006
|
1006
|
$factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
|
1007
|
1007
|
if (is_null($factoryClass)) { |
|
@@ -1011,7 +1011,7 @@ discard block |
|
|
block discarded – undo |
|
1011
|
1011
|
$factory = new $factoryClass($this); |
|
1012
|
1012
|
return $factory->getLDAPProvider(); |
|
1013
|
1013
|
}); |
|
1014
|
|
- $this->registerService(ILockingProvider::class, function (Server $c) { |
|
|
1014
|
+ $this->registerService(ILockingProvider::class, function(Server $c) { |
|
1015
|
1015
|
$ini = $c->getIniWrapper(); |
|
1016
|
1016
|
$config = $c->getConfig(); |
|
1017
|
1017
|
$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
|
@@ -1039,12 +1039,12 @@ discard block |
|
|
block discarded – undo |
|
1039
|
1039
|
/** @deprecated 19.0.0 */ |
|
1040
|
1040
|
$this->registerDeprecatedAlias('MountManager', IMountManager::class); |
|
1041
|
1041
|
|
|
1042
|
|
- $this->registerService(IMimeTypeDetector::class, function (Server $c) { |
|
|
1042
|
+ $this->registerService(IMimeTypeDetector::class, function(Server $c) { |
|
1043
|
1043
|
return new \OC\Files\Type\Detection( |
|
1044
|
1044
|
$c->getURLGenerator(), |
|
1045
|
1045
|
$c->getLogger(), |
|
1046
|
1046
|
\OC::$configDir, |
|
1047
|
|
- \OC::$SERVERROOT . '/resources/config/' |
|
|
1047
|
+ \OC::$SERVERROOT.'/resources/config/' |
|
1048
|
1048
|
); |
|
1049
|
1049
|
}); |
|
1050
|
1050
|
/** @deprecated 19.0.0 */ |
|
@@ -1053,19 +1053,19 @@ discard block |
|
|
block discarded – undo |
|
1053
|
1053
|
$this->registerAlias(IMimeTypeLoader::class, Loader::class); |
|
1054
|
1054
|
/** @deprecated 19.0.0 */ |
|
1055
|
1055
|
$this->registerDeprecatedAlias('MimeTypeLoader', IMimeTypeLoader::class); |
|
1056
|
|
- $this->registerService(BundleFetcher::class, function () { |
|
|
1056
|
+ $this->registerService(BundleFetcher::class, function() { |
|
1057
|
1057
|
return new BundleFetcher($this->getL10N('lib')); |
|
1058
|
1058
|
}); |
|
1059
|
1059
|
$this->registerAlias(\OCP\Notification\IManager::class, Manager::class); |
|
1060
|
1060
|
/** @deprecated 19.0.0 */ |
|
1061
|
1061
|
$this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class); |
|
1062
|
1062
|
|
|
1063
|
|
- $this->registerService(CapabilitiesManager::class, function (Server $c) { |
|
|
1063
|
+ $this->registerService(CapabilitiesManager::class, function(Server $c) { |
|
1064
|
1064
|
$manager = new CapabilitiesManager($c->getLogger()); |
|
1065
|
|
- $manager->registerCapability(function () use ($c) { |
|
|
1065
|
+ $manager->registerCapability(function() use ($c) { |
|
1066
|
1066
|
return new \OC\OCS\CoreCapabilities($c->getConfig()); |
|
1067
|
1067
|
}); |
|
1068
|
|
- $manager->registerCapability(function () use ($c) { |
|
|
1068
|
+ $manager->registerCapability(function() use ($c) { |
|
1069
|
1069
|
return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
|
1070
|
1070
|
}); |
|
1071
|
1071
|
return $manager; |
|
@@ -1073,14 +1073,14 @@ discard block |
|
|
block discarded – undo |
|
1073
|
1073
|
/** @deprecated 19.0.0 */ |
|
1074
|
1074
|
$this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class); |
|
1075
|
1075
|
|
|
1076
|
|
- $this->registerService(ICommentsManager::class, function (Server $c) { |
|
|
1076
|
+ $this->registerService(ICommentsManager::class, function(Server $c) { |
|
1077
|
1077
|
$config = $c->getConfig(); |
|
1078
|
1078
|
$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
|
1079
|
1079
|
/** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
|
1080
|
1080
|
$factory = new $factoryClass($this); |
|
1081
|
1081
|
$manager = $factory->getManager(); |
|
1082
|
1082
|
|
|
1083
|
|
- $manager->registerDisplayNameResolver('user', function ($id) use ($c) { |
|
|
1083
|
+ $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
|
1084
|
1084
|
$manager = $c->getUserManager(); |
|
1085
|
1085
|
$user = $manager->get($id); |
|
1086
|
1086
|
if (is_null($user)) { |
|
@@ -1098,7 +1098,7 @@ discard block |
|
|
block discarded – undo |
|
1098
|
1098
|
$this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class); |
|
1099
|
1099
|
|
|
1100
|
1100
|
$this->registerAlias(\OC_Defaults::class, 'ThemingDefaults'); |
|
1101
|
|
- $this->registerService('ThemingDefaults', function (Server $c) { |
|
|
1101
|
+ $this->registerService('ThemingDefaults', function(Server $c) { |
|
1102
|
1102
|
/* |
|
1103
|
1103
|
* Dark magic for autoloader. |
|
1104
|
1104
|
* If we do a class_exists it will try to load the class which will |
|
@@ -1126,7 +1126,7 @@ discard block |
|
|
block discarded – undo |
|
1126
|
1126
|
} |
|
1127
|
1127
|
return new \OC_Defaults(); |
|
1128
|
1128
|
}); |
|
1129
|
|
- $this->registerService(JSCombiner::class, function (Server $c) { |
|
|
1129
|
+ $this->registerService(JSCombiner::class, function(Server $c) { |
|
1130
|
1130
|
return new JSCombiner( |
|
1131
|
1131
|
$c->getAppDataDir('js'), |
|
1132
|
1132
|
$c->getURLGenerator(), |
|
@@ -1140,7 +1140,7 @@ discard block |
|
|
block discarded – undo |
|
1140
|
1140
|
$this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class); |
|
1141
|
1141
|
$this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class); |
|
1142
|
1142
|
|
|
1143
|
|
- $this->registerService('CryptoWrapper', function (Server $c) { |
|
|
1143
|
+ $this->registerService('CryptoWrapper', function(Server $c) { |
|
1144
|
1144
|
// FIXME: Instantiiated here due to cyclic dependency |
|
1145
|
1145
|
$request = new Request( |
|
1146
|
1146
|
[ |
|
@@ -1167,14 +1167,14 @@ discard block |
|
|
block discarded – undo |
|
1167
|
1167
|
}); |
|
1168
|
1168
|
/** @deprecated 19.0.0 */ |
|
1169
|
1169
|
$this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class); |
|
1170
|
|
- $this->registerService(SessionStorage::class, function (Server $c) { |
|
|
1170
|
+ $this->registerService(SessionStorage::class, function(Server $c) { |
|
1171
|
1171
|
return new SessionStorage($c->getSession()); |
|
1172
|
1172
|
}); |
|
1173
|
1173
|
$this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class); |
|
1174
|
1174
|
/** @deprecated 19.0.0 */ |
|
1175
|
1175
|
$this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class); |
|
1176
|
1176
|
|
|
1177
|
|
- $this->registerService(\OCP\Share\IManager::class, function (Server $c) { |
|
|
1177
|
+ $this->registerService(\OCP\Share\IManager::class, function(Server $c) { |
|
1178
|
1178
|
$config = $c->getConfig(); |
|
1179
|
1179
|
$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
|
1180
|
1180
|
/** @var \OCP\Share\IProviderFactory $factory */ |
|
@@ -1204,7 +1204,7 @@ discard block |
|
|
block discarded – undo |
|
1204
|
1204
|
/** @deprecated 19.0.0 */ |
|
1205
|
1205
|
$this->registerDeprecatedAlias('ShareManager', \OCP\Share\IManager::class); |
|
1206
|
1206
|
|
|
1207
|
|
- $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) { |
|
|
1207
|
+ $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function(Server $c) { |
|
1208
|
1208
|
$instance = new Collaboration\Collaborators\Search($c); |
|
1209
|
1209
|
|
|
1210
|
1210
|
// register default plugins |
|
@@ -1225,7 +1225,7 @@ discard block |
|
|
block discarded – undo |
|
1225
|
1225
|
$this->registerAlias(\OCP\Collaboration\Resources\IProviderManager::class, \OC\Collaboration\Resources\ProviderManager::class); |
|
1226
|
1226
|
$this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\Manager::class); |
|
1227
|
1227
|
|
|
1228
|
|
- $this->registerService('SettingsManager', function (Server $c) { |
|
|
1228
|
+ $this->registerService('SettingsManager', function(Server $c) { |
|
1229
|
1229
|
$manager = new \OC\Settings\Manager( |
|
1230
|
1230
|
$c->getLogger(), |
|
1231
|
1231
|
$c->getL10NFactory(), |
|
@@ -1234,34 +1234,34 @@ discard block |
|
|
block discarded – undo |
|
1234
|
1234
|
); |
|
1235
|
1235
|
return $manager; |
|
1236
|
1236
|
}); |
|
1237
|
|
- $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
|
1237
|
+ $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
1238
|
1238
|
return new \OC\Files\AppData\Factory( |
|
1239
|
1239
|
$c->getRootFolder(), |
|
1240
|
1240
|
$c->getSystemConfig() |
|
1241
|
1241
|
); |
|
1242
|
1242
|
}); |
|
1243
|
1243
|
|
|
1244
|
|
- $this->registerService('LockdownManager', function (Server $c) { |
|
1245
|
|
- return new LockdownManager(function () use ($c) { |
|
|
1244
|
+ $this->registerService('LockdownManager', function(Server $c) { |
|
|
1245
|
+ return new LockdownManager(function() use ($c) { |
|
1246
|
1246
|
return $c->getSession(); |
|
1247
|
1247
|
}); |
|
1248
|
1248
|
}); |
|
1249
|
1249
|
|
|
1250
|
|
- $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
|
1250
|
+ $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
1251
|
1251
|
return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
|
1252
|
1252
|
}); |
|
1253
|
1253
|
|
|
1254
|
|
- $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
|
1254
|
+ $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
1255
|
1255
|
return new CloudIdManager(); |
|
1256
|
1256
|
}); |
|
1257
|
1257
|
|
|
1258
|
1258
|
$this->registerAlias(\OCP\GlobalScale\IConfig::class, \OC\GlobalScale\Config::class); |
|
1259
|
1259
|
|
|
1260
|
|
- $this->registerService(ICloudFederationProviderManager::class, function (Server $c) { |
|
|
1260
|
+ $this->registerService(ICloudFederationProviderManager::class, function(Server $c) { |
|
1261
|
1261
|
return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger()); |
|
1262
|
1262
|
}); |
|
1263
|
1263
|
|
|
1264
|
|
- $this->registerService(ICloudFederationFactory::class, function (Server $c) { |
|
|
1264
|
+ $this->registerService(ICloudFederationFactory::class, function(Server $c) { |
|
1265
|
1265
|
return new CloudFederationFactory(); |
|
1266
|
1266
|
}); |
|
1267
|
1267
|
|
|
@@ -1273,7 +1273,7 @@ discard block |
|
|
block discarded – undo |
|
1273
|
1273
|
/** @deprecated 19.0.0 */ |
|
1274
|
1274
|
$this->registerDeprecatedAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
|
1275
|
1275
|
|
|
1276
|
|
- $this->registerService(Defaults::class, function (Server $c) { |
|
|
1276
|
+ $this->registerService(Defaults::class, function(Server $c) { |
|
1277
|
1277
|
return new Defaults( |
|
1278
|
1278
|
$c->getThemingDefaults() |
|
1279
|
1279
|
); |
|
@@ -1281,17 +1281,17 @@ discard block |
|
|
block discarded – undo |
|
1281
|
1281
|
/** @deprecated 19.0.0 */ |
|
1282
|
1282
|
$this->registerDeprecatedAlias('Defaults', \OCP\Defaults::class); |
|
1283
|
1283
|
|
|
1284
|
|
- $this->registerService(\OCP\ISession::class, function (SimpleContainer $c) { |
|
|
1284
|
+ $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { |
|
1285
|
1285
|
return $c->query(\OCP\IUserSession::class)->getSession(); |
|
1286
|
1286
|
}); |
|
1287
|
1287
|
|
|
1288
|
|
- $this->registerService(IShareHelper::class, function (Server $c) { |
|
|
1288
|
+ $this->registerService(IShareHelper::class, function(Server $c) { |
|
1289
|
1289
|
return new ShareHelper( |
|
1290
|
1290
|
$c->query(\OCP\Share\IManager::class) |
|
1291
|
1291
|
); |
|
1292
|
1292
|
}); |
|
1293
|
1293
|
|
|
1294
|
|
- $this->registerService(Installer::class, function (Server $c) { |
|
|
1294
|
+ $this->registerService(Installer::class, function(Server $c) { |
|
1295
|
1295
|
return new Installer( |
|
1296
|
1296
|
$c->getAppFetcher(), |
|
1297
|
1297
|
$c->getHTTPClientService(), |
|
@@ -1302,11 +1302,11 @@ discard block |
|
|
block discarded – undo |
|
1302
|
1302
|
); |
|
1303
|
1303
|
}); |
|
1304
|
1304
|
|
|
1305
|
|
- $this->registerService(IApiFactory::class, function (Server $c) { |
|
|
1305
|
+ $this->registerService(IApiFactory::class, function(Server $c) { |
|
1306
|
1306
|
return new ApiFactory($c->getHTTPClientService()); |
|
1307
|
1307
|
}); |
|
1308
|
1308
|
|
|
1309
|
|
- $this->registerService(IInstanceFactory::class, function (Server $c) { |
|
|
1309
|
+ $this->registerService(IInstanceFactory::class, function(Server $c) { |
|
1310
|
1310
|
$memcacheFactory = $c->getMemCacheFactory(); |
|
1311
|
1311
|
return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->getHTTPClientService()); |
|
1312
|
1312
|
}); |
|
@@ -1363,7 +1363,7 @@ discard block |
|
|
block discarded – undo |
|
1363
|
1363
|
$dispatcher = $this->getEventDispatcher(); |
|
1364
|
1364
|
|
|
1365
|
1365
|
// Delete avatar on user deletion |
|
1366
|
|
- $dispatcher->addListener('OCP\IUser::preDelete', function (GenericEvent $e) { |
|
|
1366
|
+ $dispatcher->addListener('OCP\IUser::preDelete', function(GenericEvent $e) { |
|
1367
|
1367
|
$logger = $this->getLogger(); |
|
1368
|
1368
|
$manager = $this->getAvatarManager(); |
|
1369
|
1369
|
/** @var IUser $user */ |
|
@@ -1376,11 +1376,11 @@ discard block |
|
|
block discarded – undo |
|
1376
|
1376
|
// no avatar to remove |
|
1377
|
1377
|
} catch (\Exception $e) { |
|
1378
|
1378
|
// Ignore exceptions |
|
1379
|
|
- $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
|
1379
|
+ $logger->info('Could not cleanup avatar of '.$user->getUID()); |
|
1380
|
1380
|
} |
|
1381
|
1381
|
}); |
|
1382
|
1382
|
|
|
1383
|
|
- $dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) { |
|
|
1383
|
+ $dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) { |
|
1384
|
1384
|
$manager = $this->getAvatarManager(); |
|
1385
|
1385
|
/** @var IUser $user */ |
|
1386
|
1386
|
$user = $e->getSubject(); |
|
@@ -2285,11 +2285,11 @@ discard block |
|
|
block discarded – undo |
|
2285
|
2285
|
} |
|
2286
|
2286
|
|
|
2287
|
2287
|
private function registerDeprecatedAlias(string $alias, string $target) { |
|
2288
|
|
- $this->registerService($alias, function (ContainerInterface $container) use ($target, $alias) { |
|
|
2288
|
+ $this->registerService($alias, function(ContainerInterface $container) use ($target, $alias) { |
|
2289
|
2289
|
try { |
|
2290
|
2290
|
/** @var ILogger $logger */ |
|
2291
|
2291
|
$logger = $container->get(ILogger::class); |
|
2292
|
|
- $logger->debug('The requested alias "' . $alias . '" is depreacted. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); |
|
|
2292
|
+ $logger->debug('The requested alias "'.$alias.'" is depreacted. Please request "'.$target.'" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); |
|
2293
|
2293
|
} catch (ContainerExceptionInterface $e) { |
|
2294
|
2294
|
// Could not get logger. Continue |
|
2295
|
2295
|
} |