|
@@ -182,7 +182,7 @@ discard block |
|
|
block discarded – undo |
|
182
|
182
|
// To find out if we are running from CLI or not |
|
183
|
183
|
$this->registerParameter('isCLI', \OC::$CLI); |
|
184
|
184
|
|
|
185
|
|
- $this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) { |
|
|
185
|
+ $this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) { |
|
186
|
186
|
return $c; |
|
187
|
187
|
}); |
|
188
|
188
|
|
|
@@ -201,7 +201,7 @@ discard block |
|
|
block discarded – undo |
|
201
|
201
|
$this->registerAlias(IActionFactory::class, ActionFactory::class); |
|
202
|
202
|
|
|
203
|
203
|
|
|
204
|
|
- $this->registerService(\OCP\IPreview::class, function (Server $c) { |
|
|
204
|
+ $this->registerService(\OCP\IPreview::class, function(Server $c) { |
|
205
|
205
|
return new PreviewManager( |
|
206
|
206
|
$c->getConfig(), |
|
207
|
207
|
$c->getRootFolder(), |
|
@@ -213,13 +213,13 @@ discard block |
|
|
block discarded – undo |
|
213
|
213
|
}); |
|
214
|
214
|
$this->registerAlias('PreviewManager', \OCP\IPreview::class); |
|
215
|
215
|
|
|
216
|
|
- $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
|
216
|
+ $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
217
|
217
|
return new \OC\Preview\Watcher( |
|
218
|
218
|
$c->getAppDataDir('preview') |
|
219
|
219
|
); |
|
220
|
220
|
}); |
|
221
|
221
|
|
|
222
|
|
- $this->registerService(\OCP\Encryption\IManager::class, function (Server $c) { |
|
|
222
|
+ $this->registerService(\OCP\Encryption\IManager::class, function(Server $c) { |
|
223
|
223
|
$view = new View(); |
|
224
|
224
|
$util = new Encryption\Util( |
|
225
|
225
|
$view, |
|
@@ -238,7 +238,7 @@ discard block |
|
|
block discarded – undo |
|
238
|
238
|
}); |
|
239
|
239
|
$this->registerAlias('EncryptionManager', \OCP\Encryption\IManager::class); |
|
240
|
240
|
|
|
241
|
|
- $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
|
241
|
+ $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
242
|
242
|
$util = new Encryption\Util( |
|
243
|
243
|
new View(), |
|
244
|
244
|
$c->getUserManager(), |
|
@@ -252,7 +252,7 @@ discard block |
|
|
block discarded – undo |
|
252
|
252
|
); |
|
253
|
253
|
}); |
|
254
|
254
|
|
|
255
|
|
- $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
|
255
|
+ $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
256
|
256
|
$view = new View(); |
|
257
|
257
|
$util = new Encryption\Util( |
|
258
|
258
|
$view, |
|
@@ -263,30 +263,30 @@ discard block |
|
|
block discarded – undo |
|
263
|
263
|
|
|
264
|
264
|
return new Encryption\Keys\Storage($view, $util); |
|
265
|
265
|
}); |
|
266
|
|
- $this->registerService('TagMapper', function (Server $c) { |
|
|
266
|
+ $this->registerService('TagMapper', function(Server $c) { |
|
267
|
267
|
return new TagMapper($c->getDatabaseConnection()); |
|
268
|
268
|
}); |
|
269
|
269
|
|
|
270
|
|
- $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
|
270
|
+ $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
271
|
271
|
$tagMapper = $c->query('TagMapper'); |
|
272
|
272
|
return new TagManager($tagMapper, $c->getUserSession()); |
|
273
|
273
|
}); |
|
274
|
274
|
$this->registerAlias('TagManager', \OCP\ITagManager::class); |
|
275
|
275
|
|
|
276
|
|
- $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
|
276
|
+ $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
277
|
277
|
$config = $c->getConfig(); |
|
278
|
278
|
$factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
|
279
|
279
|
return new $factoryClass($this); |
|
280
|
280
|
}); |
|
281
|
|
- $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) { |
|
|
281
|
+ $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) { |
|
282
|
282
|
return $c->query('SystemTagManagerFactory')->getManager(); |
|
283
|
283
|
}); |
|
284
|
284
|
$this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class); |
|
285
|
285
|
|
|
286
|
|
- $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) { |
|
|
286
|
+ $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) { |
|
287
|
287
|
return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
|
288
|
288
|
}); |
|
289
|
|
- $this->registerService('RootFolder', function (Server $c) { |
|
|
289
|
+ $this->registerService('RootFolder', function(Server $c) { |
|
290
|
290
|
$manager = \OC\Files\Filesystem::getMountManager(null); |
|
291
|
291
|
$view = new View(); |
|
292
|
292
|
$root = new Root( |
|
@@ -307,37 +307,37 @@ discard block |
|
|
block discarded – undo |
|
307
|
307
|
}); |
|
308
|
308
|
$this->registerAlias('SystemTagObjectMapper', \OCP\SystemTag\ISystemTagObjectMapper::class); |
|
309
|
309
|
|
|
310
|
|
- $this->registerService(\OCP\Files\IRootFolder::class, function (Server $c) { |
|
311
|
|
- return new LazyRoot(function () use ($c) { |
|
|
310
|
+ $this->registerService(\OCP\Files\IRootFolder::class, function(Server $c) { |
|
|
311
|
+ return new LazyRoot(function() use ($c) { |
|
312
|
312
|
return $c->query('RootFolder'); |
|
313
|
313
|
}); |
|
314
|
314
|
}); |
|
315
|
315
|
$this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class); |
|
316
|
316
|
|
|
317
|
|
- $this->registerService(\OC\User\Manager::class, function (Server $c) { |
|
|
317
|
+ $this->registerService(\OC\User\Manager::class, function(Server $c) { |
|
318
|
318
|
return new \OC\User\Manager($c->getConfig(), $c->getEventDispatcher()); |
|
319
|
319
|
}); |
|
320
|
320
|
$this->registerAlias('UserManager', \OC\User\Manager::class); |
|
321
|
321
|
$this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
|
322
|
322
|
|
|
323
|
|
- $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
|
323
|
+ $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
324
|
324
|
$groupManager = new \OC\Group\Manager($this->getUserManager(), $c->getEventDispatcher(), $this->getLogger()); |
|
325
|
|
- $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
|
325
|
+ $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
326
|
326
|
\OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid)); |
|
327
|
327
|
}); |
|
328
|
|
- $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { |
|
|
328
|
+ $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) { |
|
329
|
329
|
\OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID())); |
|
330
|
330
|
}); |
|
331
|
|
- $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
|
331
|
+ $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
332
|
332
|
\OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID())); |
|
333
|
333
|
}); |
|
334
|
|
- $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
|
334
|
+ $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
335
|
335
|
\OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID())); |
|
336
|
336
|
}); |
|
337
|
|
- $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
|
337
|
+ $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
338
|
338
|
\OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID())); |
|
339
|
339
|
}); |
|
340
|
|
- $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
|
340
|
+ $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
341
|
341
|
\OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
|
342
|
342
|
//Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
|
343
|
343
|
\OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
|
@@ -346,7 +346,7 @@ discard block |
|
|
block discarded – undo |
|
346
|
346
|
}); |
|
347
|
347
|
$this->registerAlias('GroupManager', \OCP\IGroupManager::class); |
|
348
|
348
|
|
|
349
|
|
- $this->registerService(Store::class, function (Server $c) { |
|
|
349
|
+ $this->registerService(Store::class, function(Server $c) { |
|
350
|
350
|
$session = $c->getSession(); |
|
351
|
351
|
if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
352
|
352
|
$tokenProvider = $c->query(IProvider::class); |
|
@@ -357,13 +357,13 @@ discard block |
|
|
block discarded – undo |
|
357
|
357
|
return new Store($session, $logger, $tokenProvider); |
|
358
|
358
|
}); |
|
359
|
359
|
$this->registerAlias(IStore::class, Store::class); |
|
360
|
|
- $this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) { |
|
|
360
|
+ $this->registerService(Authentication\Token\DefaultTokenMapper::class, function(Server $c) { |
|
361
|
361
|
$dbConnection = $c->getDatabaseConnection(); |
|
362
|
362
|
return new Authentication\Token\DefaultTokenMapper($dbConnection); |
|
363
|
363
|
}); |
|
364
|
364
|
$this->registerAlias(IProvider::class, Authentication\Token\Manager::class); |
|
365
|
365
|
|
|
366
|
|
- $this->registerService(\OC\User\Session::class, function (Server $c) { |
|
|
366
|
+ $this->registerService(\OC\User\Session::class, function(Server $c) { |
|
367
|
367
|
$manager = $c->getUserManager(); |
|
368
|
368
|
$session = new \OC\Session\Memory(''); |
|
369
|
369
|
$timeFactory = new TimeFactory(); |
|
@@ -387,45 +387,45 @@ discard block |
|
|
block discarded – undo |
|
387
|
387
|
$c->getLockdownManager(), |
|
388
|
388
|
$c->getLogger() |
|
389
|
389
|
); |
|
390
|
|
- $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
|
390
|
+ $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
391
|
391
|
\OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
|
392
|
392
|
}); |
|
393
|
|
- $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
|
393
|
+ $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
394
|
394
|
/** @var $user \OC\User\User */ |
|
395
|
395
|
\OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
|
396
|
396
|
}); |
|
397
|
|
- $userSession->listen('\OC\User', 'preDelete', function ($user) use ($dispatcher) { |
|
|
397
|
+ $userSession->listen('\OC\User', 'preDelete', function($user) use ($dispatcher) { |
|
398
|
398
|
/** @var $user \OC\User\User */ |
|
399
|
399
|
\OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
|
400
|
400
|
$dispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
|
401
|
401
|
}); |
|
402
|
|
- $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
|
402
|
+ $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
403
|
403
|
/** @var $user \OC\User\User */ |
|
404
|
404
|
\OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
|
405
|
405
|
}); |
|
406
|
|
- $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
|
406
|
+ $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
407
|
407
|
/** @var $user \OC\User\User */ |
|
408
|
408
|
\OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
|
409
|
409
|
}); |
|
410
|
|
- $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
|
410
|
+ $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
411
|
411
|
/** @var $user \OC\User\User */ |
|
412
|
412
|
\OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
|
413
|
413
|
}); |
|
414
|
|
- $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
|
414
|
+ $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
415
|
415
|
\OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
|
416
|
416
|
}); |
|
417
|
|
- $userSession->listen('\OC\User', 'postLogin', function ($user, $password, $isTokenLogin) { |
|
|
417
|
+ $userSession->listen('\OC\User', 'postLogin', function($user, $password, $isTokenLogin) { |
|
418
|
418
|
/** @var $user \OC\User\User */ |
|
419
|
419
|
\OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'isTokenLogin' => $isTokenLogin)); |
|
420
|
420
|
}); |
|
421
|
|
- $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
|
421
|
+ $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
422
|
422
|
/** @var $user \OC\User\User */ |
|
423
|
423
|
\OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
|
424
|
424
|
}); |
|
425
|
|
- $userSession->listen('\OC\User', 'logout', function () { |
|
|
425
|
+ $userSession->listen('\OC\User', 'logout', function() { |
|
426
|
426
|
\OC_Hook::emit('OC_User', 'logout', array()); |
|
427
|
427
|
}); |
|
428
|
|
- $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
|
|
428
|
+ $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) { |
|
429
|
429
|
/** @var $user \OC\User\User */ |
|
430
|
430
|
\OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); |
|
431
|
431
|
}); |
|
@@ -439,7 +439,7 @@ discard block |
|
|
block discarded – undo |
|
439
|
439
|
$this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); |
|
440
|
440
|
$this->registerAlias('NavigationManager', \OCP\INavigationManager::class); |
|
441
|
441
|
|
|
442
|
|
- $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
|
442
|
+ $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
443
|
443
|
return new \OC\AllConfig( |
|
444
|
444
|
$c->getSystemConfig() |
|
445
|
445
|
); |
|
@@ -447,17 +447,17 @@ discard block |
|
|
block discarded – undo |
|
447
|
447
|
$this->registerAlias('AllConfig', \OC\AllConfig::class); |
|
448
|
448
|
$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
|
449
|
449
|
|
|
450
|
|
- $this->registerService('SystemConfig', function ($c) use ($config) { |
|
|
450
|
+ $this->registerService('SystemConfig', function($c) use ($config) { |
|
451
|
451
|
return new \OC\SystemConfig($config); |
|
452
|
452
|
}); |
|
453
|
453
|
|
|
454
|
|
- $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
|
454
|
+ $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
455
|
455
|
return new \OC\AppConfig($c->getDatabaseConnection()); |
|
456
|
456
|
}); |
|
457
|
457
|
$this->registerAlias('AppConfig', \OC\AppConfig::class); |
|
458
|
458
|
$this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class); |
|
459
|
459
|
|
|
460
|
|
- $this->registerService(\OCP\L10N\IFactory::class, function (Server $c) { |
|
|
460
|
+ $this->registerService(\OCP\L10N\IFactory::class, function(Server $c) { |
|
461
|
461
|
return new \OC\L10N\Factory( |
|
462
|
462
|
$c->getConfig(), |
|
463
|
463
|
$c->getRequest(), |
|
@@ -467,7 +467,7 @@ discard block |
|
|
block discarded – undo |
|
467
|
467
|
}); |
|
468
|
468
|
$this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class); |
|
469
|
469
|
|
|
470
|
|
- $this->registerService(\OCP\IURLGenerator::class, function (Server $c) { |
|
|
470
|
+ $this->registerService(\OCP\IURLGenerator::class, function(Server $c) { |
|
471
|
471
|
$config = $c->getConfig(); |
|
472
|
472
|
$cacheFactory = $c->getMemCacheFactory(); |
|
473
|
473
|
$request = $c->getRequest(); |
|
@@ -482,12 +482,12 @@ discard block |
|
|
block discarded – undo |
|
482
|
482
|
$this->registerAlias('AppFetcher', AppFetcher::class); |
|
483
|
483
|
$this->registerAlias('CategoryFetcher', CategoryFetcher::class); |
|
484
|
484
|
|
|
485
|
|
- $this->registerService(\OCP\ICache::class, function ($c) { |
|
|
485
|
+ $this->registerService(\OCP\ICache::class, function($c) { |
|
486
|
486
|
return new Cache\File(); |
|
487
|
487
|
}); |
|
488
|
488
|
$this->registerAlias('UserCache', \OCP\ICache::class); |
|
489
|
489
|
|
|
490
|
|
- $this->registerService(Factory::class, function (Server $c) { |
|
|
490
|
+ $this->registerService(Factory::class, function(Server $c) { |
|
491
|
491
|
|
|
492
|
492
|
$arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
|
493
|
493
|
ArrayCache::class, |
|
@@ -502,7 +502,7 @@ discard block |
|
|
block discarded – undo |
|
502
|
502
|
$version = implode(',', $v); |
|
503
|
503
|
$instanceId = \OC_Util::getInstanceId(); |
|
504
|
504
|
$path = \OC::$SERVERROOT; |
|
505
|
|
- $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
|
505
|
+ $prefix = md5($instanceId.'-'.$version.'-'.$path); |
|
506
|
506
|
return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
|
507
|
507
|
$config->getSystemValue('memcache.local', null), |
|
508
|
508
|
$config->getSystemValue('memcache.distributed', null), |
|
@@ -515,12 +515,12 @@ discard block |
|
|
block discarded – undo |
|
515
|
515
|
$this->registerAlias('MemCacheFactory', Factory::class); |
|
516
|
516
|
$this->registerAlias(ICacheFactory::class, Factory::class); |
|
517
|
517
|
|
|
518
|
|
- $this->registerService('RedisFactory', function (Server $c) { |
|
|
518
|
+ $this->registerService('RedisFactory', function(Server $c) { |
|
519
|
519
|
$systemConfig = $c->getSystemConfig(); |
|
520
|
520
|
return new RedisFactory($systemConfig); |
|
521
|
521
|
}); |
|
522
|
522
|
|
|
523
|
|
- $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
|
523
|
+ $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
524
|
524
|
return new \OC\Activity\Manager( |
|
525
|
525
|
$c->getRequest(), |
|
526
|
526
|
$c->getUserSession(), |
|
@@ -530,7 +530,7 @@ discard block |
|
|
block discarded – undo |
|
530
|
530
|
}); |
|
531
|
531
|
$this->registerAlias('ActivityManager', \OCP\Activity\IManager::class); |
|
532
|
532
|
|
|
533
|
|
- $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
|
533
|
+ $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
534
|
534
|
return new \OC\Activity\EventMerger( |
|
535
|
535
|
$c->getL10N('lib') |
|
536
|
536
|
); |
|
@@ -552,7 +552,7 @@ discard block |
|
|
block discarded – undo |
|
552
|
552
|
$this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
|
553
|
553
|
$this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class); |
|
554
|
554
|
|
|
555
|
|
- $this->registerService(\OC\Log::class, function (Server $c) { |
|
|
555
|
+ $this->registerService(\OC\Log::class, function(Server $c) { |
|
556
|
556
|
$logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); |
|
557
|
557
|
$factory = new LogFactory($c, $this->getSystemConfig()); |
|
558
|
558
|
$logger = $factory->get($logType); |
|
@@ -563,11 +563,11 @@ discard block |
|
|
block discarded – undo |
|
563
|
563
|
$this->registerAlias(\OCP\ILogger::class, \OC\Log::class); |
|
564
|
564
|
$this->registerAlias('Logger', \OC\Log::class); |
|
565
|
565
|
|
|
566
|
|
- $this->registerService(ILogFactory::class, function (Server $c) { |
|
|
566
|
+ $this->registerService(ILogFactory::class, function(Server $c) { |
|
567
|
567
|
return new LogFactory($c, $this->getSystemConfig()); |
|
568
|
568
|
}); |
|
569
|
569
|
|
|
570
|
|
- $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { |
|
|
570
|
+ $this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) { |
|
571
|
571
|
$config = $c->getConfig(); |
|
572
|
572
|
return new \OC\BackgroundJob\JobList( |
|
573
|
573
|
$c->getDatabaseConnection(), |
|
@@ -577,7 +577,7 @@ discard block |
|
|
block discarded – undo |
|
577
|
577
|
}); |
|
578
|
578
|
$this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class); |
|
579
|
579
|
|
|
580
|
|
- $this->registerService(\OCP\Route\IRouter::class, function (Server $c) { |
|
|
580
|
+ $this->registerService(\OCP\Route\IRouter::class, function(Server $c) { |
|
581
|
581
|
$cacheFactory = $c->getMemCacheFactory(); |
|
582
|
582
|
$logger = $c->getLogger(); |
|
583
|
583
|
if ($cacheFactory->isLocalCacheAvailable()) { |
|
@@ -589,12 +589,12 @@ discard block |
|
|
block discarded – undo |
|
589
|
589
|
}); |
|
590
|
590
|
$this->registerAlias('Router', \OCP\Route\IRouter::class); |
|
591
|
591
|
|
|
592
|
|
- $this->registerService(\OCP\ISearch::class, function ($c) { |
|
|
592
|
+ $this->registerService(\OCP\ISearch::class, function($c) { |
|
593
|
593
|
return new Search(); |
|
594
|
594
|
}); |
|
595
|
595
|
$this->registerAlias('Search', \OCP\ISearch::class); |
|
596
|
596
|
|
|
597
|
|
- $this->registerService(\OC\Security\RateLimiting\Limiter::class, function (Server $c) { |
|
|
597
|
+ $this->registerService(\OC\Security\RateLimiting\Limiter::class, function(Server $c) { |
|
598
|
598
|
return new \OC\Security\RateLimiting\Limiter( |
|
599
|
599
|
$this->getUserSession(), |
|
600
|
600
|
$this->getRequest(), |
|
@@ -602,34 +602,34 @@ discard block |
|
|
block discarded – undo |
|
602
|
602
|
$c->query(\OC\Security\RateLimiting\Backend\IBackend::class) |
|
603
|
603
|
); |
|
604
|
604
|
}); |
|
605
|
|
- $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
|
605
|
+ $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
606
|
606
|
return new \OC\Security\RateLimiting\Backend\MemoryCache( |
|
607
|
607
|
$this->getMemCacheFactory(), |
|
608
|
608
|
new \OC\AppFramework\Utility\TimeFactory() |
|
609
|
609
|
); |
|
610
|
610
|
}); |
|
611
|
611
|
|
|
612
|
|
- $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
|
612
|
+ $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
613
|
613
|
return new SecureRandom(); |
|
614
|
614
|
}); |
|
615
|
615
|
$this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
|
616
|
616
|
|
|
617
|
|
- $this->registerService(\OCP\Security\ICrypto::class, function (Server $c) { |
|
|
617
|
+ $this->registerService(\OCP\Security\ICrypto::class, function(Server $c) { |
|
618
|
618
|
return new Crypto($c->getConfig(), $c->getSecureRandom()); |
|
619
|
619
|
}); |
|
620
|
620
|
$this->registerAlias('Crypto', \OCP\Security\ICrypto::class); |
|
621
|
621
|
|
|
622
|
|
- $this->registerService(\OCP\Security\IHasher::class, function (Server $c) { |
|
|
622
|
+ $this->registerService(\OCP\Security\IHasher::class, function(Server $c) { |
|
623
|
623
|
return new Hasher($c->getConfig()); |
|
624
|
624
|
}); |
|
625
|
625
|
$this->registerAlias('Hasher', \OCP\Security\IHasher::class); |
|
626
|
626
|
|
|
627
|
|
- $this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) { |
|
|
627
|
+ $this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) { |
|
628
|
628
|
return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
|
629
|
629
|
}); |
|
630
|
630
|
$this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class); |
|
631
|
631
|
|
|
632
|
|
- $this->registerService(IDBConnection::class, function (Server $c) { |
|
|
632
|
+ $this->registerService(IDBConnection::class, function(Server $c) { |
|
633
|
633
|
$systemConfig = $c->getSystemConfig(); |
|
634
|
634
|
$factory = new \OC\DB\ConnectionFactory($systemConfig); |
|
635
|
635
|
$type = $systemConfig->getValue('dbtype', 'sqlite'); |
|
@@ -644,7 +644,7 @@ discard block |
|
|
block discarded – undo |
|
644
|
644
|
$this->registerAlias('DatabaseConnection', IDBConnection::class); |
|
645
|
645
|
|
|
646
|
646
|
|
|
647
|
|
- $this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) { |
|
|
647
|
+ $this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) { |
|
648
|
648
|
$user = \OC_User::getUser(); |
|
649
|
649
|
$uid = $user ? $user : null; |
|
650
|
650
|
return new ClientService( |
|
@@ -659,7 +659,7 @@ discard block |
|
|
block discarded – undo |
|
659
|
659
|
); |
|
660
|
660
|
}); |
|
661
|
661
|
$this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class); |
|
662
|
|
- $this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) { |
|
|
662
|
+ $this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) { |
|
663
|
663
|
$eventLogger = new EventLogger(); |
|
664
|
664
|
if ($c->getSystemConfig()->getValue('debug', false)) { |
|
665
|
665
|
// In debug mode, module is being activated by default |
|
@@ -669,7 +669,7 @@ discard block |
|
|
block discarded – undo |
|
669
|
669
|
}); |
|
670
|
670
|
$this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class); |
|
671
|
671
|
|
|
672
|
|
- $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) { |
|
|
672
|
+ $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) { |
|
673
|
673
|
$queryLogger = new QueryLogger(); |
|
674
|
674
|
if ($c->getSystemConfig()->getValue('debug', false)) { |
|
675
|
675
|
// In debug mode, module is being activated by default |
|
@@ -679,7 +679,7 @@ discard block |
|
|
block discarded – undo |
|
679
|
679
|
}); |
|
680
|
680
|
$this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class); |
|
681
|
681
|
|
|
682
|
|
- $this->registerService(TempManager::class, function (Server $c) { |
|
|
682
|
+ $this->registerService(TempManager::class, function(Server $c) { |
|
683
|
683
|
return new TempManager( |
|
684
|
684
|
$c->getLogger(), |
|
685
|
685
|
$c->getConfig() |
|
@@ -688,7 +688,7 @@ discard block |
|
|
block discarded – undo |
|
688
|
688
|
$this->registerAlias('TempManager', TempManager::class); |
|
689
|
689
|
$this->registerAlias(ITempManager::class, TempManager::class); |
|
690
|
690
|
|
|
691
|
|
- $this->registerService(AppManager::class, function (Server $c) { |
|
|
691
|
+ $this->registerService(AppManager::class, function(Server $c) { |
|
692
|
692
|
return new \OC\App\AppManager( |
|
693
|
693
|
$c->getUserSession(), |
|
694
|
694
|
$c->query(\OC\AppConfig::class), |
|
@@ -700,7 +700,7 @@ discard block |
|
|
block discarded – undo |
|
700
|
700
|
$this->registerAlias('AppManager', AppManager::class); |
|
701
|
701
|
$this->registerAlias(IAppManager::class, AppManager::class); |
|
702
|
702
|
|
|
703
|
|
- $this->registerService(\OCP\IDateTimeZone::class, function (Server $c) { |
|
|
703
|
+ $this->registerService(\OCP\IDateTimeZone::class, function(Server $c) { |
|
704
|
704
|
return new DateTimeZone( |
|
705
|
705
|
$c->getConfig(), |
|
706
|
706
|
$c->getSession() |
|
@@ -708,7 +708,7 @@ discard block |
|
|
block discarded – undo |
|
708
|
708
|
}); |
|
709
|
709
|
$this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class); |
|
710
|
710
|
|
|
711
|
|
- $this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) { |
|
|
711
|
+ $this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) { |
|
712
|
712
|
$language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
|
713
|
713
|
|
|
714
|
714
|
return new DateTimeFormatter( |
|
@@ -718,7 +718,7 @@ discard block |
|
|
block discarded – undo |
|
718
|
718
|
}); |
|
719
|
719
|
$this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class); |
|
720
|
720
|
|
|
721
|
|
- $this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) { |
|
|
721
|
+ $this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) { |
|
722
|
722
|
$mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
|
723
|
723
|
$listener = new UserMountCacheListener($mountCache); |
|
724
|
724
|
$listener->listen($c->getUserManager()); |
|
@@ -726,7 +726,7 @@ discard block |
|
|
block discarded – undo |
|
726
|
726
|
}); |
|
727
|
727
|
$this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class); |
|
728
|
728
|
|
|
729
|
|
- $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) { |
|
|
729
|
+ $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) { |
|
730
|
730
|
$loader = \OC\Files\Filesystem::getLoader(); |
|
731
|
731
|
$mountCache = $c->query('UserMountCache'); |
|
732
|
732
|
$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
|
@@ -742,10 +742,10 @@ discard block |
|
|
block discarded – undo |
|
742
|
742
|
}); |
|
743
|
743
|
$this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class); |
|
744
|
744
|
|
|
745
|
|
- $this->registerService('IniWrapper', function ($c) { |
|
|
745
|
+ $this->registerService('IniWrapper', function($c) { |
|
746
|
746
|
return new IniGetWrapper(); |
|
747
|
747
|
}); |
|
748
|
|
- $this->registerService('AsyncCommandBus', function (Server $c) { |
|
|
748
|
+ $this->registerService('AsyncCommandBus', function(Server $c) { |
|
749
|
749
|
$busClass = $c->getConfig()->getSystemValue('commandbus'); |
|
750
|
750
|
if ($busClass) { |
|
751
|
751
|
list($app, $class) = explode('::', $busClass, 2); |
|
@@ -760,10 +760,10 @@ discard block |
|
|
block discarded – undo |
|
760
|
760
|
return new CronBus($jobList); |
|
761
|
761
|
} |
|
762
|
762
|
}); |
|
763
|
|
- $this->registerService('TrustedDomainHelper', function ($c) { |
|
|
763
|
+ $this->registerService('TrustedDomainHelper', function($c) { |
|
764
|
764
|
return new TrustedDomainHelper($this->getConfig()); |
|
765
|
765
|
}); |
|
766
|
|
- $this->registerService(Throttler::class, function (Server $c) { |
|
|
766
|
+ $this->registerService(Throttler::class, function(Server $c) { |
|
767
|
767
|
return new Throttler( |
|
768
|
768
|
$c->getDatabaseConnection(), |
|
769
|
769
|
new TimeFactory(), |
|
@@ -772,7 +772,7 @@ discard block |
|
|
block discarded – undo |
|
772
|
772
|
); |
|
773
|
773
|
}); |
|
774
|
774
|
$this->registerAlias('Throttler', Throttler::class); |
|
775
|
|
- $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
|
775
|
+ $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
776
|
776
|
// IConfig and IAppManager requires a working database. This code |
|
777
|
777
|
// might however be called when ownCloud is not yet setup. |
|
778
|
778
|
if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
@@ -794,7 +794,7 @@ discard block |
|
|
block discarded – undo |
|
794
|
794
|
$c->getMimeTypeDetector() |
|
795
|
795
|
); |
|
796
|
796
|
}); |
|
797
|
|
- $this->registerService(\OCP\IRequest::class, function ($c) { |
|
|
797
|
+ $this->registerService(\OCP\IRequest::class, function($c) { |
|
798
|
798
|
if (isset($this['urlParams'])) { |
|
799
|
799
|
$urlParams = $this['urlParams']; |
|
800
|
800
|
} else { |
|
@@ -830,7 +830,7 @@ discard block |
|
|
block discarded – undo |
|
830
|
830
|
}); |
|
831
|
831
|
$this->registerAlias('Request', \OCP\IRequest::class); |
|
832
|
832
|
|
|
833
|
|
- $this->registerService(\OCP\Mail\IMailer::class, function (Server $c) { |
|
|
833
|
+ $this->registerService(\OCP\Mail\IMailer::class, function(Server $c) { |
|
834
|
834
|
return new Mailer( |
|
835
|
835
|
$c->getConfig(), |
|
836
|
836
|
$c->getLogger(), |
|
@@ -841,7 +841,7 @@ discard block |
|
|
block discarded – undo |
|
841
|
841
|
}); |
|
842
|
842
|
$this->registerAlias('Mailer', \OCP\Mail\IMailer::class); |
|
843
|
843
|
|
|
844
|
|
- $this->registerService('LDAPProvider', function (Server $c) { |
|
|
844
|
+ $this->registerService('LDAPProvider', function(Server $c) { |
|
845
|
845
|
$config = $c->getConfig(); |
|
846
|
846
|
$factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
|
847
|
847
|
if (is_null($factoryClass)) { |
|
@@ -851,7 +851,7 @@ discard block |
|
|
block discarded – undo |
|
851
|
851
|
$factory = new $factoryClass($this); |
|
852
|
852
|
return $factory->getLDAPProvider(); |
|
853
|
853
|
}); |
|
854
|
|
- $this->registerService(ILockingProvider::class, function (Server $c) { |
|
|
854
|
+ $this->registerService(ILockingProvider::class, function(Server $c) { |
|
855
|
855
|
$ini = $c->getIniWrapper(); |
|
856
|
856
|
$config = $c->getConfig(); |
|
857
|
857
|
$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
|
@@ -874,49 +874,49 @@ discard block |
|
|
block discarded – undo |
|
874
|
874
|
}); |
|
875
|
875
|
$this->registerAlias('LockingProvider', ILockingProvider::class); |
|
876
|
876
|
|
|
877
|
|
- $this->registerService(\OCP\Files\Mount\IMountManager::class, function () { |
|
|
877
|
+ $this->registerService(\OCP\Files\Mount\IMountManager::class, function() { |
|
878
|
878
|
return new \OC\Files\Mount\Manager(); |
|
879
|
879
|
}); |
|
880
|
880
|
$this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class); |
|
881
|
881
|
|
|
882
|
|
- $this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) { |
|
|
882
|
+ $this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) { |
|
883
|
883
|
return new \OC\Files\Type\Detection( |
|
884
|
884
|
$c->getURLGenerator(), |
|
885
|
885
|
\OC::$configDir, |
|
886
|
|
- \OC::$SERVERROOT . '/resources/config/' |
|
|
886
|
+ \OC::$SERVERROOT.'/resources/config/' |
|
887
|
887
|
); |
|
888
|
888
|
}); |
|
889
|
889
|
$this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class); |
|
890
|
890
|
|
|
891
|
|
- $this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) { |
|
|
891
|
+ $this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) { |
|
892
|
892
|
return new \OC\Files\Type\Loader( |
|
893
|
893
|
$c->getDatabaseConnection() |
|
894
|
894
|
); |
|
895
|
895
|
}); |
|
896
|
896
|
$this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class); |
|
897
|
|
- $this->registerService(BundleFetcher::class, function () { |
|
|
897
|
+ $this->registerService(BundleFetcher::class, function() { |
|
898
|
898
|
return new BundleFetcher($this->getL10N('lib')); |
|
899
|
899
|
}); |
|
900
|
|
- $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
|
900
|
+ $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
901
|
901
|
return new Manager( |
|
902
|
902
|
$c->query(IValidator::class) |
|
903
|
903
|
); |
|
904
|
904
|
}); |
|
905
|
905
|
$this->registerAlias('NotificationManager', \OCP\Notification\IManager::class); |
|
906
|
906
|
|
|
907
|
|
- $this->registerService(\OC\CapabilitiesManager::class, function (Server $c) { |
|
|
907
|
+ $this->registerService(\OC\CapabilitiesManager::class, function(Server $c) { |
|
908
|
908
|
$manager = new \OC\CapabilitiesManager($c->getLogger()); |
|
909
|
|
- $manager->registerCapability(function () use ($c) { |
|
|
909
|
+ $manager->registerCapability(function() use ($c) { |
|
910
|
910
|
return new \OC\OCS\CoreCapabilities($c->getConfig()); |
|
911
|
911
|
}); |
|
912
|
|
- $manager->registerCapability(function () use ($c) { |
|
|
912
|
+ $manager->registerCapability(function() use ($c) { |
|
913
|
913
|
return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
|
914
|
914
|
}); |
|
915
|
915
|
return $manager; |
|
916
|
916
|
}); |
|
917
|
917
|
$this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class); |
|
918
|
918
|
|
|
919
|
|
- $this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) { |
|
|
919
|
+ $this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) { |
|
920
|
920
|
$config = $c->getConfig(); |
|
921
|
921
|
$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
|
922
|
922
|
/** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
|
@@ -926,7 +926,7 @@ discard block |
|
|
block discarded – undo |
|
926
|
926
|
$manager->registerDisplayNameResolver('user', function($id) use ($c) { |
|
927
|
927
|
$manager = $c->getUserManager(); |
|
928
|
928
|
$user = $manager->get($id); |
|
929
|
|
- if(is_null($user)) { |
|
|
929
|
+ if (is_null($user)) { |
|
930
|
930
|
$l = $c->getL10N('core'); |
|
931
|
931
|
$displayName = $l->t('Unknown user'); |
|
932
|
932
|
} else { |
|
@@ -939,7 +939,7 @@ discard block |
|
|
block discarded – undo |
|
939
|
939
|
}); |
|
940
|
940
|
$this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class); |
|
941
|
941
|
|
|
942
|
|
- $this->registerService('ThemingDefaults', function (Server $c) { |
|
|
942
|
+ $this->registerService('ThemingDefaults', function(Server $c) { |
|
943
|
943
|
/* |
|
944
|
944
|
* Dark magic for autoloader. |
|
945
|
945
|
* If we do a class_exists it will try to load the class which will |
|
@@ -967,7 +967,7 @@ discard block |
|
|
block discarded – undo |
|
967
|
967
|
} |
|
968
|
968
|
return new \OC_Defaults(); |
|
969
|
969
|
}); |
|
970
|
|
- $this->registerService(SCSSCacher::class, function (Server $c) { |
|
|
970
|
+ $this->registerService(SCSSCacher::class, function(Server $c) { |
|
971
|
971
|
return new SCSSCacher( |
|
972
|
972
|
$c->getLogger(), |
|
973
|
973
|
$c->query(\OC\Files\AppData\Factory::class), |
|
@@ -980,7 +980,7 @@ discard block |
|
|
block discarded – undo |
|
980
|
980
|
new TimeFactory() |
|
981
|
981
|
); |
|
982
|
982
|
}); |
|
983
|
|
- $this->registerService(JSCombiner::class, function (Server $c) { |
|
|
983
|
+ $this->registerService(JSCombiner::class, function(Server $c) { |
|
984
|
984
|
return new JSCombiner( |
|
985
|
985
|
$c->getAppDataDir('js'), |
|
986
|
986
|
$c->getURLGenerator(), |
|
@@ -993,7 +993,7 @@ discard block |
|
|
block discarded – undo |
|
993
|
993
|
$this->registerAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class); |
|
994
|
994
|
$this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class); |
|
995
|
995
|
|
|
996
|
|
- $this->registerService('CryptoWrapper', function (Server $c) { |
|
|
996
|
+ $this->registerService('CryptoWrapper', function(Server $c) { |
|
997
|
997
|
// FIXME: Instantiiated here due to cyclic dependency |
|
998
|
998
|
$request = new Request( |
|
999
|
999
|
[ |
|
@@ -1018,7 +1018,7 @@ discard block |
|
|
block discarded – undo |
|
1018
|
1018
|
$request |
|
1019
|
1019
|
); |
|
1020
|
1020
|
}); |
|
1021
|
|
- $this->registerService(CsrfTokenManager::class, function (Server $c) { |
|
|
1021
|
+ $this->registerService(CsrfTokenManager::class, function(Server $c) { |
|
1022
|
1022
|
$tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
|
1023
|
1023
|
|
|
1024
|
1024
|
return new CsrfTokenManager( |
|
@@ -1027,22 +1027,22 @@ discard block |
|
|
block discarded – undo |
|
1027
|
1027
|
); |
|
1028
|
1028
|
}); |
|
1029
|
1029
|
$this->registerAlias('CsrfTokenManager', CsrfTokenManager::class); |
|
1030
|
|
- $this->registerService(SessionStorage::class, function (Server $c) { |
|
|
1030
|
+ $this->registerService(SessionStorage::class, function(Server $c) { |
|
1031
|
1031
|
return new SessionStorage($c->getSession()); |
|
1032
|
1032
|
}); |
|
1033
|
|
- $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) { |
|
|
1033
|
+ $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) { |
|
1034
|
1034
|
return new ContentSecurityPolicyManager(); |
|
1035
|
1035
|
}); |
|
1036
|
1036
|
$this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class); |
|
1037
|
1037
|
|
|
1038
|
|
- $this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) { |
|
|
1038
|
+ $this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) { |
|
1039
|
1039
|
return new ContentSecurityPolicyNonceManager( |
|
1040
|
1040
|
$c->getCsrfTokenManager(), |
|
1041
|
1041
|
$c->getRequest() |
|
1042
|
1042
|
); |
|
1043
|
1043
|
}); |
|
1044
|
1044
|
|
|
1045
|
|
- $this->registerService(\OCP\Share\IManager::class, function (Server $c) { |
|
|
1045
|
+ $this->registerService(\OCP\Share\IManager::class, function(Server $c) { |
|
1046
|
1046
|
$config = $c->getConfig(); |
|
1047
|
1047
|
$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
|
1048
|
1048
|
/** @var \OCP\Share\IProviderFactory $factory */ |
|
@@ -1089,7 +1089,7 @@ discard block |
|
|
block discarded – undo |
|
1089
|
1089
|
|
|
1090
|
1090
|
$this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\Manager::class); |
|
1091
|
1091
|
|
|
1092
|
|
- $this->registerService('SettingsManager', function (Server $c) { |
|
|
1092
|
+ $this->registerService('SettingsManager', function(Server $c) { |
|
1093
|
1093
|
$manager = new \OC\Settings\Manager( |
|
1094
|
1094
|
$c->getLogger(), |
|
1095
|
1095
|
$c->getL10NFactory(), |
|
@@ -1098,36 +1098,36 @@ discard block |
|
|
block discarded – undo |
|
1098
|
1098
|
); |
|
1099
|
1099
|
return $manager; |
|
1100
|
1100
|
}); |
|
1101
|
|
- $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
|
1101
|
+ $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
1102
|
1102
|
return new \OC\Files\AppData\Factory( |
|
1103
|
1103
|
$c->getRootFolder(), |
|
1104
|
1104
|
$c->getSystemConfig() |
|
1105
|
1105
|
); |
|
1106
|
1106
|
}); |
|
1107
|
1107
|
|
|
1108
|
|
- $this->registerService('LockdownManager', function (Server $c) { |
|
1109
|
|
- return new LockdownManager(function () use ($c) { |
|
|
1108
|
+ $this->registerService('LockdownManager', function(Server $c) { |
|
|
1109
|
+ return new LockdownManager(function() use ($c) { |
|
1110
|
1110
|
return $c->getSession(); |
|
1111
|
1111
|
}); |
|
1112
|
1112
|
}); |
|
1113
|
1113
|
|
|
1114
|
|
- $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
|
1114
|
+ $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
1115
|
1115
|
return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
|
1116
|
1116
|
}); |
|
1117
|
1117
|
|
|
1118
|
|
- $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
|
1118
|
+ $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
1119
|
1119
|
return new CloudIdManager(); |
|
1120
|
1120
|
}); |
|
1121
|
1121
|
|
|
1122
|
|
- $this->registerService(IConfig::class, function (Server $c) { |
|
|
1122
|
+ $this->registerService(IConfig::class, function(Server $c) { |
|
1123
|
1123
|
return new GlobalScale\Config($c->getConfig()); |
|
1124
|
1124
|
}); |
|
1125
|
1125
|
|
|
1126
|
|
- $this->registerService(ICloudFederationProviderManager::class, function (Server $c) { |
|
|
1126
|
+ $this->registerService(ICloudFederationProviderManager::class, function(Server $c) { |
|
1127
|
1127
|
return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger()); |
|
1128
|
1128
|
}); |
|
1129
|
1129
|
|
|
1130
|
|
- $this->registerService(ICloudFederationFactory::class, function (Server $c) { |
|
|
1130
|
+ $this->registerService(ICloudFederationFactory::class, function(Server $c) { |
|
1131
|
1131
|
return new CloudFederationFactory(); |
|
1132
|
1132
|
}); |
|
1133
|
1133
|
|
|
@@ -1137,18 +1137,18 @@ discard block |
|
|
block discarded – undo |
|
1137
|
1137
|
$this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
|
1138
|
1138
|
$this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
|
1139
|
1139
|
|
|
1140
|
|
- $this->registerService(Defaults::class, function (Server $c) { |
|
|
1140
|
+ $this->registerService(Defaults::class, function(Server $c) { |
|
1141
|
1141
|
return new Defaults( |
|
1142
|
1142
|
$c->getThemingDefaults() |
|
1143
|
1143
|
); |
|
1144
|
1144
|
}); |
|
1145
|
1145
|
$this->registerAlias('Defaults', \OCP\Defaults::class); |
|
1146
|
1146
|
|
|
1147
|
|
- $this->registerService(\OCP\ISession::class, function (SimpleContainer $c) { |
|
|
1147
|
+ $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { |
|
1148
|
1148
|
return $c->query(\OCP\IUserSession::class)->getSession(); |
|
1149
|
1149
|
}); |
|
1150
|
1150
|
|
|
1151
|
|
- $this->registerService(IShareHelper::class, function (Server $c) { |
|
|
1151
|
+ $this->registerService(IShareHelper::class, function(Server $c) { |
|
1152
|
1152
|
return new ShareHelper( |
|
1153
|
1153
|
$c->query(\OCP\Share\IManager::class) |
|
1154
|
1154
|
); |
|
@@ -1191,7 +1191,7 @@ discard block |
|
|
block discarded – undo |
|
1191
|
1191
|
$this->registerAlias(IDashboardManager::class, DashboardManager::class); |
|
1192
|
1192
|
$this->registerAlias(IFullTextSearchManager::class, FullTextSearchManager::class); |
|
1193
|
1193
|
|
|
1194
|
|
- $this->registerService(\OC\Security\IdentityProof\Manager::class, function (Server $c) { |
|
|
1194
|
+ $this->registerService(\OC\Security\IdentityProof\Manager::class, function(Server $c) { |
|
1195
|
1195
|
return new \OC\Security\IdentityProof\Manager( |
|
1196
|
1196
|
$c->query(\OC\Files\AppData\Factory::class), |
|
1197
|
1197
|
$c->getCrypto(), |
|
@@ -1244,11 +1244,11 @@ discard block |
|
|
block discarded – undo |
|
1244
|
1244
|
// no avatar to remove |
|
1245
|
1245
|
} catch (\Exception $e) { |
|
1246
|
1246
|
// Ignore exceptions |
|
1247
|
|
- $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
|
1247
|
+ $logger->info('Could not cleanup avatar of '.$user->getUID()); |
|
1248
|
1248
|
} |
|
1249
|
1249
|
}); |
|
1250
|
1250
|
|
|
1251
|
|
- $dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) { |
|
|
1251
|
+ $dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) { |
|
1252
|
1252
|
$manager = $this->getAvatarManager(); |
|
1253
|
1253
|
/** @var IUser $user */ |
|
1254
|
1254
|
$user = $e->getSubject(); |
|
@@ -1404,7 +1404,7 @@ discard block |
|
|
block discarded – undo |
|
1404
|
1404
|
* @deprecated since 9.2.0 use IAppData |
|
1405
|
1405
|
*/ |
|
1406
|
1406
|
public function getAppFolder() { |
|
1407
|
|
- $dir = '/' . \OC_App::getCurrentApp(); |
|
|
1407
|
+ $dir = '/'.\OC_App::getCurrentApp(); |
|
1408
|
1408
|
$root = $this->getRootFolder(); |
|
1409
|
1409
|
if (!$root->nodeExists($dir)) { |
|
1410
|
1410
|
$folder = $root->newFolder($dir); |
|
@@ -1979,7 +1979,7 @@ discard block |
|
|
block discarded – undo |
|
1979
|
1979
|
/** |
|
1980
|
1980
|
* @return \OCP\Collaboration\AutoComplete\IManager |
|
1981
|
1981
|
*/ |
|
1982
|
|
- public function getAutoCompleteManager(){ |
|
|
1982
|
+ public function getAutoCompleteManager() { |
|
1983
|
1983
|
return $this->query(IManager::class); |
|
1984
|
1984
|
} |
|
1985
|
1985
|
|