|
@@ -256,7 +256,7 @@ discard block |
|
|
block discarded – undo |
|
256
|
256
|
// To find out if we are running from CLI or not |
|
257
|
257
|
$this->registerParameter('isCLI', \OC::$CLI); |
|
258
|
258
|
|
|
259
|
|
- $this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) { |
|
|
259
|
+ $this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) { |
|
260
|
260
|
return $c; |
|
261
|
261
|
}); |
|
262
|
262
|
|
|
@@ -277,7 +277,7 @@ discard block |
|
|
block discarded – undo |
|
277
|
277
|
$this->registerAlias(IActionFactory::class, ActionFactory::class); |
|
278
|
278
|
|
|
279
|
279
|
|
|
280
|
|
- $this->registerService(IPreview::class, function (Server $c) { |
|
|
280
|
+ $this->registerService(IPreview::class, function(Server $c) { |
|
281
|
281
|
return new PreviewManager( |
|
282
|
282
|
$c->getConfig(), |
|
283
|
283
|
$c->getRootFolder(), |
|
@@ -289,13 +289,13 @@ discard block |
|
|
block discarded – undo |
|
289
|
289
|
}); |
|
290
|
290
|
$this->registerDeprecatedAlias('PreviewManager', IPreview::class); |
|
291
|
291
|
|
|
292
|
|
- $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
|
292
|
+ $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
293
|
293
|
return new \OC\Preview\Watcher( |
|
294
|
294
|
$c->getAppDataDir('preview') |
|
295
|
295
|
); |
|
296
|
296
|
}); |
|
297
|
297
|
|
|
298
|
|
- $this->registerService(\OCP\Encryption\IManager::class, function (Server $c) { |
|
|
298
|
+ $this->registerService(\OCP\Encryption\IManager::class, function(Server $c) { |
|
299
|
299
|
$view = new View(); |
|
300
|
300
|
$util = new Encryption\Util( |
|
301
|
301
|
$view, |
|
@@ -314,7 +314,7 @@ discard block |
|
|
block discarded – undo |
|
314
|
314
|
}); |
|
315
|
315
|
$this->registerDeprecatedAlias('EncryptionManager', \OCP\Encryption\IManager::class); |
|
316
|
316
|
|
|
317
|
|
- $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
|
317
|
+ $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
318
|
318
|
$util = new Encryption\Util( |
|
319
|
319
|
new View(), |
|
320
|
320
|
$c->getUserManager(), |
|
@@ -328,7 +328,7 @@ discard block |
|
|
block discarded – undo |
|
328
|
328
|
); |
|
329
|
329
|
}); |
|
330
|
330
|
|
|
331
|
|
- $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
|
331
|
+ $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
332
|
332
|
$view = new View(); |
|
333
|
333
|
$util = new Encryption\Util( |
|
334
|
334
|
$view, |
|
@@ -339,30 +339,30 @@ discard block |
|
|
block discarded – undo |
|
339
|
339
|
|
|
340
|
340
|
return new Encryption\Keys\Storage($view, $util); |
|
341
|
341
|
}); |
|
342
|
|
- $this->registerService('TagMapper', function (Server $c) { |
|
|
342
|
+ $this->registerService('TagMapper', function(Server $c) { |
|
343
|
343
|
return new TagMapper($c->getDatabaseConnection()); |
|
344
|
344
|
}); |
|
345
|
345
|
|
|
346
|
|
- $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
|
346
|
+ $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
347
|
347
|
$tagMapper = $c->query('TagMapper'); |
|
348
|
348
|
return new TagManager($tagMapper, $c->getUserSession()); |
|
349
|
349
|
}); |
|
350
|
350
|
$this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class); |
|
351
|
351
|
|
|
352
|
|
- $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
|
352
|
+ $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
353
|
353
|
$config = $c->getConfig(); |
|
354
|
354
|
$factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
|
355
|
355
|
return new $factoryClass($this); |
|
356
|
356
|
}); |
|
357
|
|
- $this->registerService(ISystemTagManager::class, function (Server $c) { |
|
|
357
|
+ $this->registerService(ISystemTagManager::class, function(Server $c) { |
|
358
|
358
|
return $c->query('SystemTagManagerFactory')->getManager(); |
|
359
|
359
|
}); |
|
360
|
360
|
$this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class); |
|
361
|
361
|
|
|
362
|
|
- $this->registerService(ISystemTagObjectMapper::class, function (Server $c) { |
|
|
362
|
+ $this->registerService(ISystemTagObjectMapper::class, function(Server $c) { |
|
363
|
363
|
return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
|
364
|
364
|
}); |
|
365
|
|
- $this->registerService('RootFolder', function (Server $c) { |
|
|
365
|
+ $this->registerService('RootFolder', function(Server $c) { |
|
366
|
366
|
$manager = \OC\Files\Filesystem::getMountManager(null); |
|
367
|
367
|
$view = new View(); |
|
368
|
368
|
$root = new Root( |
|
@@ -383,8 +383,8 @@ discard block |
|
|
block discarded – undo |
|
383
|
383
|
}); |
|
384
|
384
|
$this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class); |
|
385
|
385
|
|
|
386
|
|
- $this->registerService(IRootFolder::class, function (Server $c) { |
|
387
|
|
- return new LazyRoot(function () use ($c) { |
|
|
386
|
+ $this->registerService(IRootFolder::class, function(Server $c) { |
|
|
387
|
+ return new LazyRoot(function() use ($c) { |
|
388
|
388
|
return $c->query('RootFolder'); |
|
389
|
389
|
}); |
|
390
|
390
|
}); |
|
@@ -393,44 +393,44 @@ discard block |
|
|
block discarded – undo |
|
393
|
393
|
$this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class); |
|
394
|
394
|
$this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
|
395
|
395
|
|
|
396
|
|
- $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
|
396
|
+ $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
397
|
397
|
$groupManager = new \OC\Group\Manager($this->getUserManager(), $c->getEventDispatcher(), $this->getLogger()); |
|
398
|
|
- $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
|
398
|
+ $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
399
|
399
|
\OC_Hook::emit('OC_Group', 'pre_createGroup', ['run' => true, 'gid' => $gid]); |
|
400
|
400
|
|
|
401
|
401
|
/** @var IEventDispatcher $dispatcher */ |
|
402
|
402
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
403
|
403
|
$dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid)); |
|
404
|
404
|
}); |
|
405
|
|
- $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) { |
|
|
405
|
+ $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $group) { |
|
406
|
406
|
\OC_Hook::emit('OC_User', 'post_createGroup', ['gid' => $group->getGID()]); |
|
407
|
407
|
|
|
408
|
408
|
/** @var IEventDispatcher $dispatcher */ |
|
409
|
409
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
410
|
410
|
$dispatcher->dispatchTyped(new GroupCreatedEvent($group)); |
|
411
|
411
|
}); |
|
412
|
|
- $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
|
412
|
+ $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
413
|
413
|
\OC_Hook::emit('OC_Group', 'pre_deleteGroup', ['run' => true, 'gid' => $group->getGID()]); |
|
414
|
414
|
|
|
415
|
415
|
/** @var IEventDispatcher $dispatcher */ |
|
416
|
416
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
417
|
417
|
$dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group)); |
|
418
|
418
|
}); |
|
419
|
|
- $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
|
419
|
+ $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
420
|
420
|
\OC_Hook::emit('OC_User', 'post_deleteGroup', ['gid' => $group->getGID()]); |
|
421
|
421
|
|
|
422
|
422
|
/** @var IEventDispatcher $dispatcher */ |
|
423
|
423
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
424
|
424
|
$dispatcher->dispatchTyped(new GroupDeletedEvent($group)); |
|
425
|
425
|
}); |
|
426
|
|
- $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
|
426
|
+ $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
427
|
427
|
\OC_Hook::emit('OC_Group', 'pre_addToGroup', ['run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()]); |
|
428
|
428
|
|
|
429
|
429
|
/** @var IEventDispatcher $dispatcher */ |
|
430
|
430
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
431
|
431
|
$dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user)); |
|
432
|
432
|
}); |
|
433
|
|
- $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
|
433
|
+ $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
434
|
434
|
\OC_Hook::emit('OC_Group', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]); |
|
435
|
435
|
//Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
|
436
|
436
|
\OC_Hook::emit('OC_User', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]); |
|
@@ -439,12 +439,12 @@ discard block |
|
|
block discarded – undo |
|
439
|
439
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
440
|
440
|
$dispatcher->dispatchTyped(new UserAddedEvent($group, $user)); |
|
441
|
441
|
}); |
|
442
|
|
- $groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
|
442
|
+ $groupManager->listen('\OC\Group', 'preRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
443
|
443
|
/** @var IEventDispatcher $dispatcher */ |
|
444
|
444
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
445
|
445
|
$dispatcher->dispatchTyped(new BeforeUserRemovedEvent($group, $user)); |
|
446
|
446
|
}); |
|
447
|
|
- $groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
|
447
|
+ $groupManager->listen('\OC\Group', 'postRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
448
|
448
|
/** @var IEventDispatcher $dispatcher */ |
|
449
|
449
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
450
|
450
|
$dispatcher->dispatchTyped(new UserRemovedEvent($group, $user)); |
|
@@ -453,7 +453,7 @@ discard block |
|
|
block discarded – undo |
|
453
|
453
|
}); |
|
454
|
454
|
$this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class); |
|
455
|
455
|
|
|
456
|
|
- $this->registerService(Store::class, function (Server $c) { |
|
|
456
|
+ $this->registerService(Store::class, function(Server $c) { |
|
457
|
457
|
$session = $c->getSession(); |
|
458
|
458
|
if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
459
|
459
|
$tokenProvider = $c->query(IProvider::class); |
|
@@ -464,13 +464,13 @@ discard block |
|
|
block discarded – undo |
|
464
|
464
|
return new Store($session, $logger, $tokenProvider); |
|
465
|
465
|
}); |
|
466
|
466
|
$this->registerAlias(IStore::class, Store::class); |
|
467
|
|
- $this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) { |
|
|
467
|
+ $this->registerService(Authentication\Token\DefaultTokenMapper::class, function(Server $c) { |
|
468
|
468
|
$dbConnection = $c->getDatabaseConnection(); |
|
469
|
469
|
return new Authentication\Token\DefaultTokenMapper($dbConnection); |
|
470
|
470
|
}); |
|
471
|
471
|
$this->registerAlias(IProvider::class, Authentication\Token\Manager::class); |
|
472
|
472
|
|
|
473
|
|
- $this->registerService(\OC\User\Session::class, function (Server $c) { |
|
|
473
|
+ $this->registerService(\OC\User\Session::class, function(Server $c) { |
|
474
|
474
|
$manager = $c->getUserManager(); |
|
475
|
475
|
$session = new \OC\Session\Memory(''); |
|
476
|
476
|
$timeFactory = new TimeFactory(); |
|
@@ -495,14 +495,14 @@ discard block |
|
|
block discarded – undo |
|
495
|
495
|
$c->getLogger(), |
|
496
|
496
|
$c->query(IEventDispatcher::class) |
|
497
|
497
|
); |
|
498
|
|
- $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
|
498
|
+ $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
499
|
499
|
\OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]); |
|
500
|
500
|
|
|
501
|
501
|
/** @var IEventDispatcher $dispatcher */ |
|
502
|
502
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
503
|
503
|
$dispatcher->dispatchTyped(new BeforeUserCreatedEvent($uid, $password)); |
|
504
|
504
|
}); |
|
505
|
|
- $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
|
505
|
+ $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
506
|
506
|
/** @var $user \OC\User\User */ |
|
507
|
507
|
\OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]); |
|
508
|
508
|
|
|
@@ -510,7 +510,7 @@ discard block |
|
|
block discarded – undo |
|
510
|
510
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
511
|
511
|
$dispatcher->dispatchTyped(new UserCreatedEvent($user, $password)); |
|
512
|
512
|
}); |
|
513
|
|
- $userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) { |
|
|
513
|
+ $userSession->listen('\OC\User', 'preDelete', function($user) use ($legacyDispatcher) { |
|
514
|
514
|
/** @var $user \OC\User\User */ |
|
515
|
515
|
\OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]); |
|
516
|
516
|
$legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
|
@@ -519,7 +519,7 @@ discard block |
|
|
block discarded – undo |
|
519
|
519
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
520
|
520
|
$dispatcher->dispatchTyped(new BeforeUserDeletedEvent($user)); |
|
521
|
521
|
}); |
|
522
|
|
- $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
|
522
|
+ $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
523
|
523
|
/** @var $user \OC\User\User */ |
|
524
|
524
|
\OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]); |
|
525
|
525
|
|
|
@@ -527,7 +527,7 @@ discard block |
|
|
block discarded – undo |
|
527
|
527
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
528
|
528
|
$dispatcher->dispatchTyped(new UserDeletedEvent($user)); |
|
529
|
529
|
}); |
|
530
|
|
- $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
|
530
|
+ $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
531
|
531
|
/** @var $user \OC\User\User */ |
|
532
|
532
|
\OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]); |
|
533
|
533
|
|
|
@@ -535,7 +535,7 @@ discard block |
|
|
block discarded – undo |
|
535
|
535
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
536
|
536
|
$dispatcher->dispatchTyped(new BeforePasswordUpdatedEvent($user, $password, $recoveryPassword)); |
|
537
|
537
|
}); |
|
538
|
|
- $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
|
538
|
+ $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
539
|
539
|
/** @var $user \OC\User\User */ |
|
540
|
540
|
\OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]); |
|
541
|
541
|
|
|
@@ -543,14 +543,14 @@ discard block |
|
|
block discarded – undo |
|
543
|
543
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
544
|
544
|
$dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword)); |
|
545
|
545
|
}); |
|
546
|
|
- $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
|
546
|
+ $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
547
|
547
|
\OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]); |
|
548
|
548
|
|
|
549
|
549
|
/** @var IEventDispatcher $dispatcher */ |
|
550
|
550
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
551
|
551
|
$dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password)); |
|
552
|
552
|
}); |
|
553
|
|
- $userSession->listen('\OC\User', 'postLogin', function ($user, $password, $isTokenLogin) { |
|
|
553
|
+ $userSession->listen('\OC\User', 'postLogin', function($user, $password, $isTokenLogin) { |
|
554
|
554
|
/** @var $user \OC\User\User */ |
|
555
|
555
|
\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'isTokenLogin' => $isTokenLogin]); |
|
556
|
556
|
|
|
@@ -558,12 +558,12 @@ discard block |
|
|
block discarded – undo |
|
558
|
558
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
559
|
559
|
$dispatcher->dispatchTyped(new UserLoggedInEvent($user, $password, $isTokenLogin)); |
|
560
|
560
|
}); |
|
561
|
|
- $userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) { |
|
|
561
|
+ $userSession->listen('\OC\User', 'preRememberedLogin', function($uid) { |
|
562
|
562
|
/** @var IEventDispatcher $dispatcher */ |
|
563
|
563
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
564
|
564
|
$dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid)); |
|
565
|
565
|
}); |
|
566
|
|
- $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
|
566
|
+ $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
567
|
567
|
/** @var $user \OC\User\User */ |
|
568
|
568
|
\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]); |
|
569
|
569
|
|
|
@@ -571,19 +571,19 @@ discard block |
|
|
block discarded – undo |
|
571
|
571
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
572
|
572
|
$dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password)); |
|
573
|
573
|
}); |
|
574
|
|
- $userSession->listen('\OC\User', 'logout', function ($user) { |
|
|
574
|
+ $userSession->listen('\OC\User', 'logout', function($user) { |
|
575
|
575
|
\OC_Hook::emit('OC_User', 'logout', []); |
|
576
|
576
|
|
|
577
|
577
|
/** @var IEventDispatcher $dispatcher */ |
|
578
|
578
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
579
|
579
|
$dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user)); |
|
580
|
580
|
}); |
|
581
|
|
- $userSession->listen('\OC\User', 'postLogout', function ($user) { |
|
|
581
|
+ $userSession->listen('\OC\User', 'postLogout', function($user) { |
|
582
|
582
|
/** @var IEventDispatcher $dispatcher */ |
|
583
|
583
|
$dispatcher = $this->query(IEventDispatcher::class); |
|
584
|
584
|
$dispatcher->dispatchTyped(new UserLoggedOutEvent($user)); |
|
585
|
585
|
}); |
|
586
|
|
- $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
|
|
586
|
+ $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) { |
|
587
|
587
|
/** @var $user \OC\User\User */ |
|
588
|
588
|
\OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]); |
|
589
|
589
|
|
|
@@ -601,7 +601,7 @@ discard block |
|
|
block discarded – undo |
|
601
|
601
|
$this->registerAlias(INavigationManager::class, \OC\NavigationManager::class); |
|
602
|
602
|
$this->registerDeprecatedAlias('NavigationManager', INavigationManager::class); |
|
603
|
603
|
|
|
604
|
|
- $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
|
604
|
+ $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
605
|
605
|
return new \OC\AllConfig( |
|
606
|
606
|
$c->getSystemConfig() |
|
607
|
607
|
); |
|
@@ -609,18 +609,18 @@ discard block |
|
|
block discarded – undo |
|
609
|
609
|
$this->registerDeprecatedAlias('AllConfig', \OC\AllConfig::class); |
|
610
|
610
|
$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
|
611
|
611
|
|
|
612
|
|
- $this->registerService(\OC\SystemConfig::class, function ($c) use ($config) { |
|
|
612
|
+ $this->registerService(\OC\SystemConfig::class, function($c) use ($config) { |
|
613
|
613
|
return new \OC\SystemConfig($config); |
|
614
|
614
|
}); |
|
615
|
615
|
$this->registerDeprecatedAlias('SystemConfig', \OC\SystemConfig::class); |
|
616
|
616
|
|
|
617
|
|
- $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
|
617
|
+ $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
618
|
618
|
return new \OC\AppConfig($c->getDatabaseConnection()); |
|
619
|
619
|
}); |
|
620
|
620
|
$this->registerDeprecatedAlias('AppConfig', \OC\AppConfig::class); |
|
621
|
621
|
$this->registerAlias(IAppConfig::class, \OC\AppConfig::class); |
|
622
|
622
|
|
|
623
|
|
- $this->registerService(IFactory::class, function (Server $c) { |
|
|
623
|
+ $this->registerService(IFactory::class, function(Server $c) { |
|
624
|
624
|
return new \OC\L10N\Factory( |
|
625
|
625
|
$c->getConfig(), |
|
626
|
626
|
$c->getRequest(), |
|
@@ -630,7 +630,7 @@ discard block |
|
|
block discarded – undo |
|
630
|
630
|
}); |
|
631
|
631
|
$this->registerDeprecatedAlias('L10NFactory', IFactory::class); |
|
632
|
632
|
|
|
633
|
|
- $this->registerService(IURLGenerator::class, function (Server $c) { |
|
|
633
|
+ $this->registerService(IURLGenerator::class, function(Server $c) { |
|
634
|
634
|
$config = $c->getConfig(); |
|
635
|
635
|
$cacheFactory = $c->getMemCacheFactory(); |
|
636
|
636
|
$request = $c->getRequest(); |
|
@@ -645,12 +645,12 @@ discard block |
|
|
block discarded – undo |
|
645
|
645
|
$this->registerDeprecatedAlias('AppFetcher', AppFetcher::class); |
|
646
|
646
|
$this->registerDeprecatedAlias('CategoryFetcher', CategoryFetcher::class); |
|
647
|
647
|
|
|
648
|
|
- $this->registerService(ICache::class, function ($c) { |
|
|
648
|
+ $this->registerService(ICache::class, function($c) { |
|
649
|
649
|
return new Cache\File(); |
|
650
|
650
|
}); |
|
651
|
651
|
$this->registerDeprecatedAlias('UserCache', ICache::class); |
|
652
|
652
|
|
|
653
|
|
- $this->registerService(Factory::class, function (Server $c) { |
|
|
653
|
+ $this->registerService(Factory::class, function(Server $c) { |
|
654
|
654
|
|
|
655
|
655
|
$arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
|
656
|
656
|
ArrayCache::class, |
|
@@ -665,7 +665,7 @@ discard block |
|
|
block discarded – undo |
|
665
|
665
|
$version = implode(',', $v); |
|
666
|
666
|
$instanceId = \OC_Util::getInstanceId(); |
|
667
|
667
|
$path = \OC::$SERVERROOT; |
|
668
|
|
- $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
|
668
|
+ $prefix = md5($instanceId.'-'.$version.'-'.$path); |
|
669
|
669
|
return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
|
670
|
670
|
$config->getSystemValue('memcache.local', null), |
|
671
|
671
|
$config->getSystemValue('memcache.distributed', null), |
|
@@ -678,12 +678,12 @@ discard block |
|
|
block discarded – undo |
|
678
|
678
|
$this->registerDeprecatedAlias('MemCacheFactory', Factory::class); |
|
679
|
679
|
$this->registerAlias(ICacheFactory::class, Factory::class); |
|
680
|
680
|
|
|
681
|
|
- $this->registerService('RedisFactory', function (Server $c) { |
|
|
681
|
+ $this->registerService('RedisFactory', function(Server $c) { |
|
682
|
682
|
$systemConfig = $c->getSystemConfig(); |
|
683
|
683
|
return new RedisFactory($systemConfig); |
|
684
|
684
|
}); |
|
685
|
685
|
|
|
686
|
|
- $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
|
686
|
+ $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
687
|
687
|
return new \OC\Activity\Manager( |
|
688
|
688
|
$c->getRequest(), |
|
689
|
689
|
$c->getUserSession(), |
|
@@ -693,7 +693,7 @@ discard block |
|
|
block discarded – undo |
|
693
|
693
|
}); |
|
694
|
694
|
$this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class); |
|
695
|
695
|
|
|
696
|
|
- $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
|
696
|
+ $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
697
|
697
|
return new \OC\Activity\EventMerger( |
|
698
|
698
|
$c->getL10N('lib') |
|
699
|
699
|
); |
|
@@ -715,7 +715,7 @@ discard block |
|
|
block discarded – undo |
|
715
|
715
|
$this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
|
716
|
716
|
$this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class); |
|
717
|
717
|
|
|
718
|
|
- $this->registerService(\OC\Log::class, function (Server $c) { |
|
|
718
|
+ $this->registerService(\OC\Log::class, function(Server $c) { |
|
719
|
719
|
$logType = $c->query(AllConfig::class)->getSystemValue('log_type', 'file'); |
|
720
|
720
|
$factory = new LogFactory($c, $this->getSystemConfig()); |
|
721
|
721
|
$logger = $factory->get($logType); |
|
@@ -728,11 +728,11 @@ discard block |
|
|
block discarded – undo |
|
728
|
728
|
// PSR-3 logger |
|
729
|
729
|
$this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class); |
|
730
|
730
|
|
|
731
|
|
- $this->registerService(ILogFactory::class, function (Server $c) { |
|
|
731
|
+ $this->registerService(ILogFactory::class, function(Server $c) { |
|
732
|
732
|
return new LogFactory($c, $this->getSystemConfig()); |
|
733
|
733
|
}); |
|
734
|
734
|
|
|
735
|
|
- $this->registerService(IJobList::class, function (Server $c) { |
|
|
735
|
+ $this->registerService(IJobList::class, function(Server $c) { |
|
736
|
736
|
$config = $c->getConfig(); |
|
737
|
737
|
return new \OC\BackgroundJob\JobList( |
|
738
|
738
|
$c->getDatabaseConnection(), |
|
@@ -742,7 +742,7 @@ discard block |
|
|
block discarded – undo |
|
742
|
742
|
}); |
|
743
|
743
|
$this->registerDeprecatedAlias('JobList', IJobList::class); |
|
744
|
744
|
|
|
745
|
|
- $this->registerService(IRouter::class, function (Server $c) { |
|
|
745
|
+ $this->registerService(IRouter::class, function(Server $c) { |
|
746
|
746
|
$cacheFactory = $c->getMemCacheFactory(); |
|
747
|
747
|
$logger = $c->getLogger(); |
|
748
|
748
|
if ($cacheFactory->isLocalCacheAvailable()) { |
|
@@ -754,39 +754,39 @@ discard block |
|
|
block discarded – undo |
|
754
|
754
|
}); |
|
755
|
755
|
$this->registerDeprecatedAlias('Router', IRouter::class); |
|
756
|
756
|
|
|
757
|
|
- $this->registerService(ISearch::class, function ($c) { |
|
|
757
|
+ $this->registerService(ISearch::class, function($c) { |
|
758
|
758
|
return new Search(); |
|
759
|
759
|
}); |
|
760
|
760
|
$this->registerDeprecatedAlias('Search', ISearch::class); |
|
761
|
761
|
|
|
762
|
|
- $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
|
762
|
+ $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
763
|
763
|
return new \OC\Security\RateLimiting\Backend\MemoryCache( |
|
764
|
764
|
$this->getMemCacheFactory(), |
|
765
|
765
|
new \OC\AppFramework\Utility\TimeFactory() |
|
766
|
766
|
); |
|
767
|
767
|
}); |
|
768
|
768
|
|
|
769
|
|
- $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
|
769
|
+ $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
770
|
770
|
return new SecureRandom(); |
|
771
|
771
|
}); |
|
772
|
772
|
$this->registerDeprecatedAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
|
773
|
773
|
|
|
774
|
|
- $this->registerService(ICrypto::class, function (Server $c) { |
|
|
774
|
+ $this->registerService(ICrypto::class, function(Server $c) { |
|
775
|
775
|
return new Crypto($c->getConfig(), $c->getSecureRandom()); |
|
776
|
776
|
}); |
|
777
|
777
|
$this->registerDeprecatedAlias('Crypto', ICrypto::class); |
|
778
|
778
|
|
|
779
|
|
- $this->registerService(IHasher::class, function (Server $c) { |
|
|
779
|
+ $this->registerService(IHasher::class, function(Server $c) { |
|
780
|
780
|
return new Hasher($c->getConfig()); |
|
781
|
781
|
}); |
|
782
|
782
|
$this->registerDeprecatedAlias('Hasher', IHasher::class); |
|
783
|
783
|
|
|
784
|
|
- $this->registerService(ICredentialsManager::class, function (Server $c) { |
|
|
784
|
+ $this->registerService(ICredentialsManager::class, function(Server $c) { |
|
785
|
785
|
return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
|
786
|
786
|
}); |
|
787
|
787
|
$this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class); |
|
788
|
788
|
|
|
789
|
|
- $this->registerService(IDBConnection::class, function (Server $c) { |
|
|
789
|
+ $this->registerService(IDBConnection::class, function(Server $c) { |
|
790
|
790
|
$systemConfig = $c->getSystemConfig(); |
|
791
|
791
|
$factory = new \OC\DB\ConnectionFactory($systemConfig); |
|
792
|
792
|
$type = $systemConfig->getValue('dbtype', 'sqlite'); |
|
@@ -801,7 +801,7 @@ discard block |
|
|
block discarded – undo |
|
801
|
801
|
$this->registerDeprecatedAlias('DatabaseConnection', IDBConnection::class); |
|
802
|
802
|
|
|
803
|
803
|
|
|
804
|
|
- $this->registerService(IClientService::class, function (Server $c) { |
|
|
804
|
+ $this->registerService(IClientService::class, function(Server $c) { |
|
805
|
805
|
$user = \OC_User::getUser(); |
|
806
|
806
|
$uid = $user ? $user : null; |
|
807
|
807
|
return new ClientService( |
|
@@ -816,7 +816,7 @@ discard block |
|
|
block discarded – undo |
|
816
|
816
|
); |
|
817
|
817
|
}); |
|
818
|
818
|
$this->registerDeprecatedAlias('HttpClientService', IClientService::class); |
|
819
|
|
- $this->registerService(IEventLogger::class, function (Server $c) { |
|
|
819
|
+ $this->registerService(IEventLogger::class, function(Server $c) { |
|
820
|
820
|
$eventLogger = new EventLogger(); |
|
821
|
821
|
if ($c->getSystemConfig()->getValue('debug', false)) { |
|
822
|
822
|
// In debug mode, module is being activated by default |
|
@@ -826,7 +826,7 @@ discard block |
|
|
block discarded – undo |
|
826
|
826
|
}); |
|
827
|
827
|
$this->registerDeprecatedAlias('EventLogger', IEventLogger::class); |
|
828
|
828
|
|
|
829
|
|
- $this->registerService(IQueryLogger::class, function (Server $c) { |
|
|
829
|
+ $this->registerService(IQueryLogger::class, function(Server $c) { |
|
830
|
830
|
$queryLogger = new QueryLogger(); |
|
831
|
831
|
if ($c->getSystemConfig()->getValue('debug', false)) { |
|
832
|
832
|
// In debug mode, module is being activated by default |
|
@@ -836,7 +836,7 @@ discard block |
|
|
block discarded – undo |
|
836
|
836
|
}); |
|
837
|
837
|
$this->registerDeprecatedAlias('QueryLogger', IQueryLogger::class); |
|
838
|
838
|
|
|
839
|
|
- $this->registerService(TempManager::class, function (Server $c) { |
|
|
839
|
+ $this->registerService(TempManager::class, function(Server $c) { |
|
840
|
840
|
return new TempManager( |
|
841
|
841
|
$c->getLogger(), |
|
842
|
842
|
$c->getConfig() |
|
@@ -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 (Server $c) { |
|
|
848
|
+ $this->registerService(AppManager::class, function(Server $c) { |
|
849
|
849
|
return new \OC\App\AppManager( |
|
850
|
850
|
$c->getUserSession(), |
|
851
|
851
|
$c->getConfig(), |
|
@@ -859,7 +859,7 @@ discard block |
|
|
block discarded – undo |
|
859
|
859
|
$this->registerDeprecatedAlias('AppManager', AppManager::class); |
|
860
|
860
|
$this->registerAlias(IAppManager::class, AppManager::class); |
|
861
|
861
|
|
|
862
|
|
- $this->registerService(IDateTimeZone::class, function (Server $c) { |
|
|
862
|
+ $this->registerService(IDateTimeZone::class, function(Server $c) { |
|
863
|
863
|
return new DateTimeZone( |
|
864
|
864
|
$c->getConfig(), |
|
865
|
865
|
$c->getSession() |
|
@@ -867,7 +867,7 @@ discard block |
|
|
block discarded – undo |
|
867
|
867
|
}); |
|
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( |
|
@@ -877,7 +877,7 @@ discard block |
|
|
block discarded – undo |
|
877
|
877
|
}); |
|
878
|
878
|
$this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class); |
|
879
|
879
|
|
|
880
|
|
- $this->registerService(IUserMountCache::class, function (Server $c) { |
|
|
880
|
+ $this->registerService(IUserMountCache::class, function(Server $c) { |
|
881
|
881
|
$mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
|
882
|
882
|
$listener = new UserMountCacheListener($mountCache); |
|
883
|
883
|
$listener->listen($c->getUserManager()); |
|
@@ -885,7 +885,7 @@ discard block |
|
|
block discarded – undo |
|
885
|
885
|
}); |
|
886
|
886
|
$this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class); |
|
887
|
887
|
|
|
888
|
|
- $this->registerService(IMountProviderCollection::class, function (Server $c) { |
|
|
888
|
+ $this->registerService(IMountProviderCollection::class, function(Server $c) { |
|
889
|
889
|
$loader = \OC\Files\Filesystem::getLoader(); |
|
890
|
890
|
$mountCache = $c->query(IUserMountCache::class); |
|
891
|
891
|
$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
|
@@ -901,10 +901,10 @@ discard block |
|
|
block discarded – undo |
|
901
|
901
|
}); |
|
902
|
902
|
$this->registerDeprecatedAlias('MountConfigManager', IMountProviderCollection::class); |
|
903
|
903
|
|
|
904
|
|
- $this->registerService('IniWrapper', function ($c) { |
|
|
904
|
+ $this->registerService('IniWrapper', function($c) { |
|
905
|
905
|
return new IniGetWrapper(); |
|
906
|
906
|
}); |
|
907
|
|
- $this->registerService('AsyncCommandBus', function (Server $c) { |
|
|
907
|
+ $this->registerService('AsyncCommandBus', function(Server $c) { |
|
908
|
908
|
$busClass = $c->getConfig()->getSystemValue('commandbus'); |
|
909
|
909
|
if ($busClass) { |
|
910
|
910
|
list($app, $class) = explode('::', $busClass, 2); |
|
@@ -919,10 +919,10 @@ discard block |
|
|
block discarded – undo |
|
919
|
919
|
return new CronBus($jobList); |
|
920
|
920
|
} |
|
921
|
921
|
}); |
|
922
|
|
- $this->registerService('TrustedDomainHelper', function ($c) { |
|
|
922
|
+ $this->registerService('TrustedDomainHelper', function($c) { |
|
923
|
923
|
return new TrustedDomainHelper($this->getConfig()); |
|
924
|
924
|
}); |
|
925
|
|
- $this->registerService(Throttler::class, function (Server $c) { |
|
|
925
|
+ $this->registerService(Throttler::class, function(Server $c) { |
|
926
|
926
|
return new Throttler( |
|
927
|
927
|
$c->getDatabaseConnection(), |
|
928
|
928
|
new TimeFactory(), |
|
@@ -931,7 +931,7 @@ discard block |
|
|
block discarded – undo |
|
931
|
931
|
); |
|
932
|
932
|
}); |
|
933
|
933
|
$this->registerDeprecatedAlias('Throttler', Throttler::class); |
|
934
|
|
- $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
|
934
|
+ $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
935
|
935
|
// IConfig and IAppManager requires a working database. This code |
|
936
|
936
|
// might however be called when ownCloud is not yet setup. |
|
937
|
937
|
if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
@@ -953,7 +953,7 @@ discard block |
|
|
block discarded – undo |
|
953
|
953
|
$c->getMimeTypeDetector() |
|
954
|
954
|
); |
|
955
|
955
|
}); |
|
956
|
|
- $this->registerService(\OCP\IRequest::class, function ($c) { |
|
|
956
|
+ $this->registerService(\OCP\IRequest::class, function($c) { |
|
957
|
957
|
if (isset($this['urlParams'])) { |
|
958
|
958
|
$urlParams = $this['urlParams']; |
|
959
|
959
|
} else { |
|
@@ -989,7 +989,7 @@ discard block |
|
|
block discarded – undo |
|
989
|
989
|
}); |
|
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->getConfig(), |
|
995
|
995
|
$c->getLogger(), |
|
@@ -1001,7 +1001,7 @@ discard block |
|
|
block discarded – undo |
|
1001
|
1001
|
}); |
|
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'))); |
|
@@ -1034,31 +1034,31 @@ discard block |
|
|
block discarded – undo |
|
1034
|
1034
|
}); |
|
1035
|
1035
|
$this->registerDeprecatedAlias('LockingProvider', ILockingProvider::class); |
|
1036
|
1036
|
|
|
1037
|
|
- $this->registerService(IMountManager::class, function () { |
|
|
1037
|
+ $this->registerService(IMountManager::class, function() { |
|
1038
|
1038
|
return new \OC\Files\Mount\Manager(); |
|
1039
|
1039
|
}); |
|
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
|
$this->registerDeprecatedAlias('MimeTypeDetector', IMimeTypeDetector::class); |
|
1051
|
1051
|
|
|
1052
|
|
- $this->registerService(IMimeTypeLoader::class, function (Server $c) { |
|
|
1052
|
+ $this->registerService(IMimeTypeLoader::class, function(Server $c) { |
|
1053
|
1053
|
return new \OC\Files\Type\Loader( |
|
1054
|
1054
|
$c->getDatabaseConnection() |
|
1055
|
1055
|
); |
|
1056
|
1056
|
}); |
|
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
|
|
- $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
|
1061
|
+ $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
1062
|
1062
|
return new Manager( |
|
1063
|
1063
|
$c->query(IValidator::class), |
|
1064
|
1064
|
$c->getLogger() |
|
@@ -1066,19 +1066,19 @@ discard block |
|
|
block discarded – undo |
|
1066
|
1066
|
}); |
|
1067
|
1067
|
$this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class); |
|
1068
|
1068
|
|
|
1069
|
|
- $this->registerService(CapabilitiesManager::class, function (Server $c) { |
|
|
1069
|
+ $this->registerService(CapabilitiesManager::class, function(Server $c) { |
|
1070
|
1070
|
$manager = new CapabilitiesManager($c->getLogger()); |
|
1071
|
|
- $manager->registerCapability(function () use ($c) { |
|
|
1071
|
+ $manager->registerCapability(function() use ($c) { |
|
1072
|
1072
|
return new \OC\OCS\CoreCapabilities($c->getConfig()); |
|
1073
|
1073
|
}); |
|
1074
|
|
- $manager->registerCapability(function () use ($c) { |
|
|
1074
|
+ $manager->registerCapability(function() use ($c) { |
|
1075
|
1075
|
return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
|
1076
|
1076
|
}); |
|
1077
|
1077
|
return $manager; |
|
1078
|
1078
|
}); |
|
1079
|
1079
|
$this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class); |
|
1080
|
1080
|
|
|
1081
|
|
- $this->registerService(ICommentsManager::class, function (Server $c) { |
|
|
1081
|
+ $this->registerService(ICommentsManager::class, function(Server $c) { |
|
1082
|
1082
|
$config = $c->getConfig(); |
|
1083
|
1083
|
$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
|
1084
|
1084
|
/** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
|
@@ -1088,7 +1088,7 @@ discard block |
|
|
block discarded – undo |
|
1088
|
1088
|
$manager->registerDisplayNameResolver('user', function($id) use ($c) { |
|
1089
|
1089
|
$manager = $c->getUserManager(); |
|
1090
|
1090
|
$user = $manager->get($id); |
|
1091
|
|
- if(is_null($user)) { |
|
|
1091
|
+ if (is_null($user)) { |
|
1092
|
1092
|
$l = $c->getL10N('core'); |
|
1093
|
1093
|
$displayName = $l->t('Unknown user'); |
|
1094
|
1094
|
} else { |
|
@@ -1101,7 +1101,7 @@ discard block |
|
|
block discarded – undo |
|
1101
|
1101
|
}); |
|
1102
|
1102
|
$this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class); |
|
1103
|
1103
|
|
|
1104
|
|
- $this->registerService('ThemingDefaults', function (Server $c) { |
|
|
1104
|
+ $this->registerService('ThemingDefaults', function(Server $c) { |
|
1105
|
1105
|
/* |
|
1106
|
1106
|
* Dark magic for autoloader. |
|
1107
|
1107
|
* If we do a class_exists it will try to load the class which will |
|
@@ -1129,7 +1129,7 @@ discard block |
|
|
block discarded – undo |
|
1129
|
1129
|
} |
|
1130
|
1130
|
return new \OC_Defaults(); |
|
1131
|
1131
|
}); |
|
1132
|
|
- $this->registerService(SCSSCacher::class, function (Server $c) { |
|
|
1132
|
+ $this->registerService(SCSSCacher::class, function(Server $c) { |
|
1133
|
1133
|
return new SCSSCacher( |
|
1134
|
1134
|
$c->getLogger(), |
|
1135
|
1135
|
$c->query(\OC\Files\AppData\Factory::class), |
|
@@ -1142,7 +1142,7 @@ discard block |
|
|
block discarded – undo |
|
1142
|
1142
|
new TimeFactory() |
|
1143
|
1143
|
); |
|
1144
|
1144
|
}); |
|
1145
|
|
- $this->registerService(JSCombiner::class, function (Server $c) { |
|
|
1145
|
+ $this->registerService(JSCombiner::class, function(Server $c) { |
|
1146
|
1146
|
return new JSCombiner( |
|
1147
|
1147
|
$c->getAppDataDir('js'), |
|
1148
|
1148
|
$c->getURLGenerator(), |
|
@@ -1155,7 +1155,7 @@ discard block |
|
|
block discarded – undo |
|
1155
|
1155
|
$this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class); |
|
1156
|
1156
|
$this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class); |
|
1157
|
1157
|
|
|
1158
|
|
- $this->registerService('CryptoWrapper', function (Server $c) { |
|
|
1158
|
+ $this->registerService('CryptoWrapper', function(Server $c) { |
|
1159
|
1159
|
// FIXME: Instantiiated here due to cyclic dependency |
|
1160
|
1160
|
$request = new Request( |
|
1161
|
1161
|
[ |
|
@@ -1180,7 +1180,7 @@ discard block |
|
|
block discarded – undo |
|
1180
|
1180
|
$request |
|
1181
|
1181
|
); |
|
1182
|
1182
|
}); |
|
1183
|
|
- $this->registerService(CsrfTokenManager::class, function (Server $c) { |
|
|
1183
|
+ $this->registerService(CsrfTokenManager::class, function(Server $c) { |
|
1184
|
1184
|
$tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
|
1185
|
1185
|
|
|
1186
|
1186
|
return new CsrfTokenManager( |
|
@@ -1189,20 +1189,20 @@ discard block |
|
|
block discarded – undo |
|
1189
|
1189
|
); |
|
1190
|
1190
|
}); |
|
1191
|
1191
|
$this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class); |
|
1192
|
|
- $this->registerService(SessionStorage::class, function (Server $c) { |
|
|
1192
|
+ $this->registerService(SessionStorage::class, function(Server $c) { |
|
1193
|
1193
|
return new SessionStorage($c->getSession()); |
|
1194
|
1194
|
}); |
|
1195
|
1195
|
$this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class); |
|
1196
|
1196
|
$this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class); |
|
1197
|
1197
|
|
|
1198
|
|
- $this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) { |
|
|
1198
|
+ $this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) { |
|
1199
|
1199
|
return new ContentSecurityPolicyNonceManager( |
|
1200
|
1200
|
$c->getCsrfTokenManager(), |
|
1201
|
1201
|
$c->getRequest() |
|
1202
|
1202
|
); |
|
1203
|
1203
|
}); |
|
1204
|
1204
|
|
|
1205
|
|
- $this->registerService(\OCP\Share\IManager::class, function (Server $c) { |
|
|
1205
|
+ $this->registerService(\OCP\Share\IManager::class, function(Server $c) { |
|
1206
|
1206
|
$config = $c->getConfig(); |
|
1207
|
1207
|
$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
|
1208
|
1208
|
/** @var \OCP\Share\IProviderFactory $factory */ |
|
@@ -1251,7 +1251,7 @@ discard block |
|
|
block discarded – undo |
|
1251
|
1251
|
$this->registerAlias(\OCP\Collaboration\Resources\IProviderManager::class, \OC\Collaboration\Resources\ProviderManager::class); |
|
1252
|
1252
|
$this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\Manager::class); |
|
1253
|
1253
|
|
|
1254
|
|
- $this->registerService('SettingsManager', function (Server $c) { |
|
|
1254
|
+ $this->registerService('SettingsManager', function(Server $c) { |
|
1255
|
1255
|
$manager = new \OC\Settings\Manager( |
|
1256
|
1256
|
$c->getLogger(), |
|
1257
|
1257
|
$c->getL10NFactory(), |
|
@@ -1260,36 +1260,36 @@ discard block |
|
|
block discarded – undo |
|
1260
|
1260
|
); |
|
1261
|
1261
|
return $manager; |
|
1262
|
1262
|
}); |
|
1263
|
|
- $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
|
1263
|
+ $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
1264
|
1264
|
return new \OC\Files\AppData\Factory( |
|
1265
|
1265
|
$c->getRootFolder(), |
|
1266
|
1266
|
$c->getSystemConfig() |
|
1267
|
1267
|
); |
|
1268
|
1268
|
}); |
|
1269
|
1269
|
|
|
1270
|
|
- $this->registerService('LockdownManager', function (Server $c) { |
|
1271
|
|
- return new LockdownManager(function () use ($c) { |
|
|
1270
|
+ $this->registerService('LockdownManager', function(Server $c) { |
|
|
1271
|
+ return new LockdownManager(function() use ($c) { |
|
1272
|
1272
|
return $c->getSession(); |
|
1273
|
1273
|
}); |
|
1274
|
1274
|
}); |
|
1275
|
1275
|
|
|
1276
|
|
- $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
|
1276
|
+ $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
1277
|
1277
|
return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
|
1278
|
1278
|
}); |
|
1279
|
1279
|
|
|
1280
|
|
- $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
|
1280
|
+ $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
1281
|
1281
|
return new CloudIdManager(); |
|
1282
|
1282
|
}); |
|
1283
|
1283
|
|
|
1284
|
|
- $this->registerService(IConfig::class, function (Server $c) { |
|
|
1284
|
+ $this->registerService(IConfig::class, function(Server $c) { |
|
1285
|
1285
|
return new GlobalScale\Config($c->getConfig()); |
|
1286
|
1286
|
}); |
|
1287
|
1287
|
|
|
1288
|
|
- $this->registerService(ICloudFederationProviderManager::class, function (Server $c) { |
|
|
1288
|
+ $this->registerService(ICloudFederationProviderManager::class, function(Server $c) { |
|
1289
|
1289
|
return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger()); |
|
1290
|
1290
|
}); |
|
1291
|
1291
|
|
|
1292
|
|
- $this->registerService(ICloudFederationFactory::class, function (Server $c) { |
|
|
1292
|
+ $this->registerService(ICloudFederationFactory::class, function(Server $c) { |
|
1293
|
1293
|
return new CloudFederationFactory(); |
|
1294
|
1294
|
}); |
|
1295
|
1295
|
|
|
@@ -1299,18 +1299,18 @@ discard block |
|
|
block discarded – undo |
|
1299
|
1299
|
$this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
|
1300
|
1300
|
$this->registerDeprecatedAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
|
1301
|
1301
|
|
|
1302
|
|
- $this->registerService(Defaults::class, function (Server $c) { |
|
|
1302
|
+ $this->registerService(Defaults::class, function(Server $c) { |
|
1303
|
1303
|
return new Defaults( |
|
1304
|
1304
|
$c->getThemingDefaults() |
|
1305
|
1305
|
); |
|
1306
|
1306
|
}); |
|
1307
|
1307
|
$this->registerDeprecatedAlias('Defaults', \OCP\Defaults::class); |
|
1308
|
1308
|
|
|
1309
|
|
- $this->registerService(\OCP\ISession::class, function (SimpleContainer $c) { |
|
|
1309
|
+ $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { |
|
1310
|
1310
|
return $c->query(\OCP\IUserSession::class)->getSession(); |
|
1311
|
1311
|
}); |
|
1312
|
1312
|
|
|
1313
|
|
- $this->registerService(IShareHelper::class, function (Server $c) { |
|
|
1313
|
+ $this->registerService(IShareHelper::class, function(Server $c) { |
|
1314
|
1314
|
return new ShareHelper( |
|
1315
|
1315
|
$c->query(\OCP\Share\IManager::class) |
|
1316
|
1316
|
); |
|
@@ -1399,11 +1399,11 @@ discard block |
|
|
block discarded – undo |
|
1399
|
1399
|
// no avatar to remove |
|
1400
|
1400
|
} catch (\Exception $e) { |
|
1401
|
1401
|
// Ignore exceptions |
|
1402
|
|
- $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
|
1402
|
+ $logger->info('Could not cleanup avatar of '.$user->getUID()); |
|
1403
|
1403
|
} |
|
1404
|
1404
|
}); |
|
1405
|
1405
|
|
|
1406
|
|
- $dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) { |
|
|
1406
|
+ $dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) { |
|
1407
|
1407
|
$manager = $this->getAvatarManager(); |
|
1408
|
1408
|
/** @var IUser $user */ |
|
1409
|
1409
|
$user = $e->getSubject(); |
|
@@ -1563,7 +1563,7 @@ discard block |
|
|
block discarded – undo |
|
1563
|
1563
|
* @deprecated since 9.2.0 use IAppData |
|
1564
|
1564
|
*/ |
|
1565
|
1565
|
public function getAppFolder() { |
|
1566
|
|
- $dir = '/' . \OC_App::getCurrentApp(); |
|
|
1566
|
+ $dir = '/'.\OC_App::getCurrentApp(); |
|
1567
|
1567
|
$root = $this->getRootFolder(); |
|
1568
|
1568
|
if (!$root->nodeExists($dir)) { |
|
1569
|
1569
|
$folder = $root->newFolder($dir); |
|
@@ -2141,7 +2141,7 @@ discard block |
|
|
block discarded – undo |
|
2141
|
2141
|
/** |
|
2142
|
2142
|
* @return \OCP\Collaboration\AutoComplete\IManager |
|
2143
|
2143
|
*/ |
|
2144
|
|
- public function getAutoCompleteManager(){ |
|
|
2144
|
+ public function getAutoCompleteManager() { |
|
2145
|
2145
|
return $this->query(IManager::class); |
|
2146
|
2146
|
} |
|
2147
|
2147
|
|
|
@@ -2237,11 +2237,11 @@ discard block |
|
|
block discarded – undo |
|
2237
|
2237
|
} |
|
2238
|
2238
|
|
|
2239
|
2239
|
private function registerDeprecatedAlias(string $alias, string $target) { |
|
2240
|
|
- $this->registerService($alias, function (IContainer $container) use ($target, $alias) { |
|
|
2240
|
+ $this->registerService($alias, function(IContainer $container) use ($target, $alias) { |
|
2241
|
2241
|
try { |
|
2242
|
2242
|
/** @var ILogger $logger */ |
|
2243
|
2243
|
$logger = $container->query(ILogger::class); |
|
2244
|
|
- $logger->debug('The requested alias "' . $alias . '" is depreacted. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); |
|
|
2244
|
+ $logger->debug('The requested alias "'.$alias.'" is depreacted. Please request "'.$target.'" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); |
|
2245
|
2245
|
} catch (QueryException $e) { |
|
2246
|
2246
|
// Could not get logger. Continue |
|
2247
|
2247
|
} |