@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | |
| 151 | 151 | |
| 152 | - $this->registerService(\OCP\IPreview::class, function (Server $c) { |
|
| 152 | + $this->registerService(\OCP\IPreview::class, function(Server $c) { |
|
| 153 | 153 | return new PreviewManager( |
| 154 | 154 | $c->getConfig(), |
| 155 | 155 | $c->getRootFolder(), |
@@ -160,13 +160,13 @@ discard block |
||
| 160 | 160 | }); |
| 161 | 161 | $this->registerAlias('PreviewManager', \OCP\IPreview::class); |
| 162 | 162 | |
| 163 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
| 163 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
| 164 | 164 | return new \OC\Preview\Watcher( |
| 165 | 165 | $c->getAppDataDir('preview') |
| 166 | 166 | ); |
| 167 | 167 | }); |
| 168 | 168 | |
| 169 | - $this->registerService('EncryptionManager', function (Server $c) { |
|
| 169 | + $this->registerService('EncryptionManager', function(Server $c) { |
|
| 170 | 170 | $view = new View(); |
| 171 | 171 | $util = new Encryption\Util( |
| 172 | 172 | $view, |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | ); |
| 185 | 185 | }); |
| 186 | 186 | |
| 187 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
| 187 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
| 188 | 188 | $util = new Encryption\Util( |
| 189 | 189 | new View(), |
| 190 | 190 | $c->getUserManager(), |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | ); |
| 199 | 199 | }); |
| 200 | 200 | |
| 201 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
| 201 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
| 202 | 202 | $view = new View(); |
| 203 | 203 | $util = new Encryption\Util( |
| 204 | 204 | $view, |
@@ -209,32 +209,32 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | return new Encryption\Keys\Storage($view, $util); |
| 211 | 211 | }); |
| 212 | - $this->registerService('TagMapper', function (Server $c) { |
|
| 212 | + $this->registerService('TagMapper', function(Server $c) { |
|
| 213 | 213 | return new TagMapper($c->getDatabaseConnection()); |
| 214 | 214 | }); |
| 215 | 215 | |
| 216 | - $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
| 216 | + $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
| 217 | 217 | $tagMapper = $c->query('TagMapper'); |
| 218 | 218 | return new TagManager($tagMapper, $c->getUserSession()); |
| 219 | 219 | }); |
| 220 | 220 | $this->registerAlias('TagManager', \OCP\ITagManager::class); |
| 221 | 221 | |
| 222 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
| 222 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
| 223 | 223 | $config = $c->getConfig(); |
| 224 | 224 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', '\OC\SystemTag\ManagerFactory'); |
| 225 | 225 | /** @var \OC\SystemTag\ManagerFactory $factory */ |
| 226 | 226 | $factory = new $factoryClass($this); |
| 227 | 227 | return $factory; |
| 228 | 228 | }); |
| 229 | - $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) { |
|
| 229 | + $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) { |
|
| 230 | 230 | return $c->query('SystemTagManagerFactory')->getManager(); |
| 231 | 231 | }); |
| 232 | 232 | $this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class); |
| 233 | 233 | |
| 234 | - $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) { |
|
| 234 | + $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) { |
|
| 235 | 235 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
| 236 | 236 | }); |
| 237 | - $this->registerService('RootFolder', function (Server $c) { |
|
| 237 | + $this->registerService('RootFolder', function(Server $c) { |
|
| 238 | 238 | $manager = \OC\Files\Filesystem::getMountManager(null); |
| 239 | 239 | $view = new View(); |
| 240 | 240 | $root = new Root( |
@@ -262,30 +262,30 @@ discard block |
||
| 262 | 262 | }); |
| 263 | 263 | $this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class); |
| 264 | 264 | |
| 265 | - $this->registerService(\OCP\IUserManager::class, function (Server $c) { |
|
| 265 | + $this->registerService(\OCP\IUserManager::class, function(Server $c) { |
|
| 266 | 266 | $config = $c->getConfig(); |
| 267 | 267 | return new \OC\User\Manager($config); |
| 268 | 268 | }); |
| 269 | 269 | $this->registerAlias('UserManager', \OCP\IUserManager::class); |
| 270 | 270 | |
| 271 | - $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
| 271 | + $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
| 272 | 272 | $groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger()); |
| 273 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
| 273 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
| 274 | 274 | \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid)); |
| 275 | 275 | }); |
| 276 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { |
|
| 276 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) { |
|
| 277 | 277 | \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID())); |
| 278 | 278 | }); |
| 279 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
| 279 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
| 280 | 280 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID())); |
| 281 | 281 | }); |
| 282 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
| 282 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
| 283 | 283 | \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID())); |
| 284 | 284 | }); |
| 285 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
| 285 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
| 286 | 286 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID())); |
| 287 | 287 | }); |
| 288 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
| 288 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
| 289 | 289 | \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
| 290 | 290 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
| 291 | 291 | \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
@@ -305,11 +305,11 @@ discard block |
||
| 305 | 305 | return new Store($session, $logger, $tokenProvider); |
| 306 | 306 | }); |
| 307 | 307 | $this->registerAlias(IStore::class, Store::class); |
| 308 | - $this->registerService('OC\Authentication\Token\DefaultTokenMapper', function (Server $c) { |
|
| 308 | + $this->registerService('OC\Authentication\Token\DefaultTokenMapper', function(Server $c) { |
|
| 309 | 309 | $dbConnection = $c->getDatabaseConnection(); |
| 310 | 310 | return new Authentication\Token\DefaultTokenMapper($dbConnection); |
| 311 | 311 | }); |
| 312 | - $this->registerService('OC\Authentication\Token\DefaultTokenProvider', function (Server $c) { |
|
| 312 | + $this->registerService('OC\Authentication\Token\DefaultTokenProvider', function(Server $c) { |
|
| 313 | 313 | $mapper = $c->query('OC\Authentication\Token\DefaultTokenMapper'); |
| 314 | 314 | $crypto = $c->getCrypto(); |
| 315 | 315 | $config = $c->getConfig(); |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | }); |
| 320 | 320 | $this->registerAlias('OC\Authentication\Token\IProvider', 'OC\Authentication\Token\DefaultTokenProvider'); |
| 321 | 321 | |
| 322 | - $this->registerService(\OCP\IUserSession::class, function (Server $c) { |
|
| 322 | + $this->registerService(\OCP\IUserSession::class, function(Server $c) { |
|
| 323 | 323 | $manager = $c->getUserManager(); |
| 324 | 324 | $session = new \OC\Session\Memory(''); |
| 325 | 325 | $timeFactory = new TimeFactory(); |
@@ -332,44 +332,44 @@ discard block |
||
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | $userSession = new \OC\User\Session($manager, $session, $timeFactory, $defaultTokenProvider, $c->getConfig(), $c->getSecureRandom(), $c->getLockdownManager()); |
| 335 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
| 335 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
| 336 | 336 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
| 337 | 337 | }); |
| 338 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
| 338 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
| 339 | 339 | /** @var $user \OC\User\User */ |
| 340 | 340 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
| 341 | 341 | }); |
| 342 | - $userSession->listen('\OC\User', 'preDelete', function ($user) { |
|
| 342 | + $userSession->listen('\OC\User', 'preDelete', function($user) { |
|
| 343 | 343 | /** @var $user \OC\User\User */ |
| 344 | 344 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
| 345 | 345 | }); |
| 346 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
| 346 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
| 347 | 347 | /** @var $user \OC\User\User */ |
| 348 | 348 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
| 349 | 349 | }); |
| 350 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
| 350 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
| 351 | 351 | /** @var $user \OC\User\User */ |
| 352 | 352 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
| 353 | 353 | }); |
| 354 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
| 354 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
| 355 | 355 | /** @var $user \OC\User\User */ |
| 356 | 356 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
| 357 | 357 | }); |
| 358 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
| 358 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
| 359 | 359 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
| 360 | 360 | }); |
| 361 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password) { |
|
| 361 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password) { |
|
| 362 | 362 | /** @var $user \OC\User\User */ |
| 363 | 363 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
| 364 | 364 | }); |
| 365 | - $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
| 365 | + $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
| 366 | 366 | /** @var $user \OC\User\User */ |
| 367 | 367 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
| 368 | 368 | }); |
| 369 | - $userSession->listen('\OC\User', 'logout', function () { |
|
| 369 | + $userSession->listen('\OC\User', 'logout', function() { |
|
| 370 | 370 | \OC_Hook::emit('OC_User', 'logout', array()); |
| 371 | 371 | }); |
| 372 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
|
| 372 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) { |
|
| 373 | 373 | /** @var $user \OC\User\User */ |
| 374 | 374 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); |
| 375 | 375 | }); |
@@ -377,14 +377,14 @@ discard block |
||
| 377 | 377 | }); |
| 378 | 378 | $this->registerAlias('UserSession', \OCP\IUserSession::class); |
| 379 | 379 | |
| 380 | - $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) { |
|
| 380 | + $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) { |
|
| 381 | 381 | return new \OC\Authentication\TwoFactorAuth\Manager($c->getAppManager(), $c->getSession(), $c->getConfig(), $c->getActivityManager(), $c->getLogger()); |
| 382 | 382 | }); |
| 383 | 383 | |
| 384 | 384 | $this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); |
| 385 | 385 | $this->registerAlias('NavigationManager', \OCP\INavigationManager::class); |
| 386 | 386 | |
| 387 | - $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
| 387 | + $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
| 388 | 388 | return new \OC\AllConfig( |
| 389 | 389 | $c->getSystemConfig() |
| 390 | 390 | ); |
@@ -392,17 +392,17 @@ discard block |
||
| 392 | 392 | $this->registerAlias('AllConfig', \OC\AllConfig::class); |
| 393 | 393 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
| 394 | 394 | |
| 395 | - $this->registerService('SystemConfig', function ($c) use ($config) { |
|
| 395 | + $this->registerService('SystemConfig', function($c) use ($config) { |
|
| 396 | 396 | return new \OC\SystemConfig($config); |
| 397 | 397 | }); |
| 398 | 398 | |
| 399 | - $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
| 399 | + $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
| 400 | 400 | return new \OC\AppConfig($c->getDatabaseConnection()); |
| 401 | 401 | }); |
| 402 | 402 | $this->registerAlias('AppConfig', \OC\AppConfig::class); |
| 403 | 403 | $this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class); |
| 404 | 404 | |
| 405 | - $this->registerService(\OCP\L10N\IFactory::class, function (Server $c) { |
|
| 405 | + $this->registerService(\OCP\L10N\IFactory::class, function(Server $c) { |
|
| 406 | 406 | return new \OC\L10N\Factory( |
| 407 | 407 | $c->getConfig(), |
| 408 | 408 | $c->getRequest(), |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | }); |
| 413 | 413 | $this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class); |
| 414 | 414 | |
| 415 | - $this->registerService(\OCP\IURLGenerator::class, function (Server $c) { |
|
| 415 | + $this->registerService(\OCP\IURLGenerator::class, function(Server $c) { |
|
| 416 | 416 | $config = $c->getConfig(); |
| 417 | 417 | $cacheFactory = $c->getMemCacheFactory(); |
| 418 | 418 | $request = $c->getRequest(); |
@@ -424,18 +424,18 @@ discard block |
||
| 424 | 424 | }); |
| 425 | 425 | $this->registerAlias('URLGenerator', \OCP\IURLGenerator::class); |
| 426 | 426 | |
| 427 | - $this->registerService('AppHelper', function ($c) { |
|
| 427 | + $this->registerService('AppHelper', function($c) { |
|
| 428 | 428 | return new \OC\AppHelper(); |
| 429 | 429 | }); |
| 430 | 430 | $this->registerAlias('AppFetcher', AppFetcher::class); |
| 431 | 431 | $this->registerAlias('CategoryFetcher', CategoryFetcher::class); |
| 432 | 432 | |
| 433 | - $this->registerService(\OCP\ICache::class, function ($c) { |
|
| 433 | + $this->registerService(\OCP\ICache::class, function($c) { |
|
| 434 | 434 | return new Cache\File(); |
| 435 | 435 | }); |
| 436 | 436 | $this->registerAlias('UserCache', \OCP\ICache::class); |
| 437 | 437 | |
| 438 | - $this->registerService(Factory::class, function (Server $c) { |
|
| 438 | + $this->registerService(Factory::class, function(Server $c) { |
|
| 439 | 439 | |
| 440 | 440 | $arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
| 441 | 441 | '\\OC\\Memcache\\ArrayCache', |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | $version = implode(',', $v); |
| 453 | 453 | $instanceId = \OC_Util::getInstanceId(); |
| 454 | 454 | $path = \OC::$SERVERROOT; |
| 455 | - $prefix = md5($instanceId . '-' . $version . '-' . $path . '-' . $urlGenerator->getBaseUrl()); |
|
| 455 | + $prefix = md5($instanceId.'-'.$version.'-'.$path.'-'.$urlGenerator->getBaseUrl()); |
|
| 456 | 456 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
| 457 | 457 | $config->getSystemValue('memcache.local', null), |
| 458 | 458 | $config->getSystemValue('memcache.distributed', null), |
@@ -465,12 +465,12 @@ discard block |
||
| 465 | 465 | $this->registerAlias('MemCacheFactory', Factory::class); |
| 466 | 466 | $this->registerAlias(ICacheFactory::class, Factory::class); |
| 467 | 467 | |
| 468 | - $this->registerService('RedisFactory', function (Server $c) { |
|
| 468 | + $this->registerService('RedisFactory', function(Server $c) { |
|
| 469 | 469 | $systemConfig = $c->getSystemConfig(); |
| 470 | 470 | return new RedisFactory($systemConfig); |
| 471 | 471 | }); |
| 472 | 472 | |
| 473 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
| 473 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
| 474 | 474 | return new \OC\Activity\Manager( |
| 475 | 475 | $c->getRequest(), |
| 476 | 476 | $c->getUserSession(), |
@@ -480,14 +480,14 @@ discard block |
||
| 480 | 480 | }); |
| 481 | 481 | $this->registerAlias('ActivityManager', \OCP\Activity\IManager::class); |
| 482 | 482 | |
| 483 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
| 483 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
| 484 | 484 | return new \OC\Activity\EventMerger( |
| 485 | 485 | $c->getL10N('lib') |
| 486 | 486 | ); |
| 487 | 487 | }); |
| 488 | 488 | $this->registerAlias(IValidator::class, Validator::class); |
| 489 | 489 | |
| 490 | - $this->registerService(\OCP\IAvatarManager::class, function (Server $c) { |
|
| 490 | + $this->registerService(\OCP\IAvatarManager::class, function(Server $c) { |
|
| 491 | 491 | return new AvatarManager( |
| 492 | 492 | $c->getUserManager(), |
| 493 | 493 | $c->getAppDataDir('avatar'), |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | }); |
| 499 | 499 | $this->registerAlias('AvatarManager', \OCP\IAvatarManager::class); |
| 500 | 500 | |
| 501 | - $this->registerService(\OCP\ILogger::class, function (Server $c) { |
|
| 501 | + $this->registerService(\OCP\ILogger::class, function(Server $c) { |
|
| 502 | 502 | $logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); |
| 503 | 503 | $logger = Log::getLogClass($logType); |
| 504 | 504 | call_user_func(array($logger, 'init')); |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | }); |
| 508 | 508 | $this->registerAlias('Logger', \OCP\ILogger::class); |
| 509 | 509 | |
| 510 | - $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { |
|
| 510 | + $this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) { |
|
| 511 | 511 | $config = $c->getConfig(); |
| 512 | 512 | return new \OC\BackgroundJob\JobList( |
| 513 | 513 | $c->getDatabaseConnection(), |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | }); |
| 518 | 518 | $this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class); |
| 519 | 519 | |
| 520 | - $this->registerService(\OCP\Route\IRouter::class, function (Server $c) { |
|
| 520 | + $this->registerService(\OCP\Route\IRouter::class, function(Server $c) { |
|
| 521 | 521 | $cacheFactory = $c->getMemCacheFactory(); |
| 522 | 522 | $logger = $c->getLogger(); |
| 523 | 523 | if ($cacheFactory->isAvailable()) { |
@@ -529,7 +529,7 @@ discard block |
||
| 529 | 529 | }); |
| 530 | 530 | $this->registerAlias('Router', \OCP\Route\IRouter::class); |
| 531 | 531 | |
| 532 | - $this->registerService(\OCP\ISearch::class, function ($c) { |
|
| 532 | + $this->registerService(\OCP\ISearch::class, function($c) { |
|
| 533 | 533 | return new Search(); |
| 534 | 534 | }); |
| 535 | 535 | $this->registerAlias('Search', \OCP\ISearch::class); |
@@ -549,27 +549,27 @@ discard block |
||
| 549 | 549 | ); |
| 550 | 550 | }); |
| 551 | 551 | |
| 552 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
| 552 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
| 553 | 553 | return new SecureRandom(); |
| 554 | 554 | }); |
| 555 | 555 | $this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
| 556 | 556 | |
| 557 | - $this->registerService(\OCP\Security\ICrypto::class, function (Server $c) { |
|
| 557 | + $this->registerService(\OCP\Security\ICrypto::class, function(Server $c) { |
|
| 558 | 558 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
| 559 | 559 | }); |
| 560 | 560 | $this->registerAlias('Crypto', \OCP\Security\ICrypto::class); |
| 561 | 561 | |
| 562 | - $this->registerService(\OCP\Security\IHasher::class, function (Server $c) { |
|
| 562 | + $this->registerService(\OCP\Security\IHasher::class, function(Server $c) { |
|
| 563 | 563 | return new Hasher($c->getConfig()); |
| 564 | 564 | }); |
| 565 | 565 | $this->registerAlias('Hasher', \OCP\Security\IHasher::class); |
| 566 | 566 | |
| 567 | - $this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) { |
|
| 567 | + $this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) { |
|
| 568 | 568 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
| 569 | 569 | }); |
| 570 | 570 | $this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class); |
| 571 | 571 | |
| 572 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
| 572 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
| 573 | 573 | $systemConfig = $c->getSystemConfig(); |
| 574 | 574 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
| 575 | 575 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | }); |
| 584 | 584 | $this->registerAlias('DatabaseConnection', IDBConnection::class); |
| 585 | 585 | |
| 586 | - $this->registerService('HTTPHelper', function (Server $c) { |
|
| 586 | + $this->registerService('HTTPHelper', function(Server $c) { |
|
| 587 | 587 | $config = $c->getConfig(); |
| 588 | 588 | return new HTTPHelper( |
| 589 | 589 | $config, |
@@ -591,7 +591,7 @@ discard block |
||
| 591 | 591 | ); |
| 592 | 592 | }); |
| 593 | 593 | |
| 594 | - $this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) { |
|
| 594 | + $this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) { |
|
| 595 | 595 | $user = \OC_User::getUser(); |
| 596 | 596 | $uid = $user ? $user : null; |
| 597 | 597 | return new ClientService( |
@@ -606,7 +606,7 @@ discard block |
||
| 606 | 606 | ); |
| 607 | 607 | }); |
| 608 | 608 | $this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class); |
| 609 | - $this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) { |
|
| 609 | + $this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) { |
|
| 610 | 610 | $eventLogger = new EventLogger(); |
| 611 | 611 | if ($c->getSystemConfig()->getValue('debug', false)) { |
| 612 | 612 | // In debug mode, module is being activated by default |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | }); |
| 617 | 617 | $this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class); |
| 618 | 618 | |
| 619 | - $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) { |
|
| 619 | + $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) { |
|
| 620 | 620 | $queryLogger = new QueryLogger(); |
| 621 | 621 | if ($c->getSystemConfig()->getValue('debug', false)) { |
| 622 | 622 | // In debug mode, module is being activated by default |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | }); |
| 627 | 627 | $this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class); |
| 628 | 628 | |
| 629 | - $this->registerService(TempManager::class, function (Server $c) { |
|
| 629 | + $this->registerService(TempManager::class, function(Server $c) { |
|
| 630 | 630 | return new TempManager( |
| 631 | 631 | $c->getLogger(), |
| 632 | 632 | $c->getConfig() |
@@ -635,7 +635,7 @@ discard block |
||
| 635 | 635 | $this->registerAlias('TempManager', TempManager::class); |
| 636 | 636 | $this->registerAlias(ITempManager::class, TempManager::class); |
| 637 | 637 | |
| 638 | - $this->registerService(AppManager::class, function (Server $c) { |
|
| 638 | + $this->registerService(AppManager::class, function(Server $c) { |
|
| 639 | 639 | return new \OC\App\AppManager( |
| 640 | 640 | $c->getUserSession(), |
| 641 | 641 | $c->getAppConfig(), |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | $this->registerAlias('AppManager', AppManager::class); |
| 648 | 648 | $this->registerAlias(IAppManager::class, AppManager::class); |
| 649 | 649 | |
| 650 | - $this->registerService(\OCP\IDateTimeZone::class, function (Server $c) { |
|
| 650 | + $this->registerService(\OCP\IDateTimeZone::class, function(Server $c) { |
|
| 651 | 651 | return new DateTimeZone( |
| 652 | 652 | $c->getConfig(), |
| 653 | 653 | $c->getSession() |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | }); |
| 656 | 656 | $this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class); |
| 657 | 657 | |
| 658 | - $this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) { |
|
| 658 | + $this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) { |
|
| 659 | 659 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
| 660 | 660 | |
| 661 | 661 | return new DateTimeFormatter( |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | }); |
| 666 | 666 | $this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class); |
| 667 | 667 | |
| 668 | - $this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) { |
|
| 668 | + $this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) { |
|
| 669 | 669 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
| 670 | 670 | $listener = new UserMountCacheListener($mountCache); |
| 671 | 671 | $listener->listen($c->getUserManager()); |
@@ -673,10 +673,10 @@ discard block |
||
| 673 | 673 | }); |
| 674 | 674 | $this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class); |
| 675 | 675 | |
| 676 | - $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) { |
|
| 676 | + $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) { |
|
| 677 | 677 | $loader = \OC\Files\Filesystem::getLoader(); |
| 678 | 678 | $mountCache = $c->query('UserMountCache'); |
| 679 | - $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
|
| 679 | + $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
|
| 680 | 680 | |
| 681 | 681 | // builtin providers |
| 682 | 682 | |
@@ -689,14 +689,14 @@ discard block |
||
| 689 | 689 | }); |
| 690 | 690 | $this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class); |
| 691 | 691 | |
| 692 | - $this->registerService('IniWrapper', function ($c) { |
|
| 692 | + $this->registerService('IniWrapper', function($c) { |
|
| 693 | 693 | return new IniGetWrapper(); |
| 694 | 694 | }); |
| 695 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
| 695 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
| 696 | 696 | $jobList = $c->getJobList(); |
| 697 | 697 | return new AsyncBus($jobList); |
| 698 | 698 | }); |
| 699 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
| 699 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
| 700 | 700 | return new TrustedDomainHelper($this->getConfig()); |
| 701 | 701 | }); |
| 702 | 702 | $this->registerService('Throttler', function(Server $c) { |
@@ -707,10 +707,10 @@ discard block |
||
| 707 | 707 | $c->getConfig() |
| 708 | 708 | ); |
| 709 | 709 | }); |
| 710 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
| 710 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
| 711 | 711 | // IConfig and IAppManager requires a working database. This code |
| 712 | 712 | // might however be called when ownCloud is not yet setup. |
| 713 | - if(\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
| 713 | + if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
| 714 | 714 | $config = $c->getConfig(); |
| 715 | 715 | $appManager = $c->getAppManager(); |
| 716 | 716 | } else { |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | $c->getTempManager() |
| 729 | 729 | ); |
| 730 | 730 | }); |
| 731 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
| 731 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
| 732 | 732 | if (isset($this['urlParams'])) { |
| 733 | 733 | $urlParams = $this['urlParams']; |
| 734 | 734 | } else { |
@@ -764,7 +764,7 @@ discard block |
||
| 764 | 764 | }); |
| 765 | 765 | $this->registerAlias('Request', \OCP\IRequest::class); |
| 766 | 766 | |
| 767 | - $this->registerService(\OCP\Mail\IMailer::class, function (Server $c) { |
|
| 767 | + $this->registerService(\OCP\Mail\IMailer::class, function(Server $c) { |
|
| 768 | 768 | return new Mailer( |
| 769 | 769 | $c->getConfig(), |
| 770 | 770 | $c->getLogger(), |
@@ -778,14 +778,14 @@ discard block |
||
| 778 | 778 | $this->registerService('LDAPProvider', function(Server $c) { |
| 779 | 779 | $config = $c->getConfig(); |
| 780 | 780 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
| 781 | - if(is_null($factoryClass)) { |
|
| 781 | + if (is_null($factoryClass)) { |
|
| 782 | 782 | throw new \Exception('ldapProviderFactory not set'); |
| 783 | 783 | } |
| 784 | 784 | /** @var \OCP\LDAP\ILDAPProviderFactory $factory */ |
| 785 | 785 | $factory = new $factoryClass($this); |
| 786 | 786 | return $factory->getLDAPProvider(); |
| 787 | 787 | }); |
| 788 | - $this->registerService('LockingProvider', function (Server $c) { |
|
| 788 | + $this->registerService('LockingProvider', function(Server $c) { |
|
| 789 | 789 | $ini = $c->getIniWrapper(); |
| 790 | 790 | $config = $c->getConfig(); |
| 791 | 791 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -801,42 +801,42 @@ discard block |
||
| 801 | 801 | return new NoopLockingProvider(); |
| 802 | 802 | }); |
| 803 | 803 | |
| 804 | - $this->registerService(\OCP\Files\Mount\IMountManager::class, function () { |
|
| 804 | + $this->registerService(\OCP\Files\Mount\IMountManager::class, function() { |
|
| 805 | 805 | return new \OC\Files\Mount\Manager(); |
| 806 | 806 | }); |
| 807 | 807 | $this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class); |
| 808 | 808 | |
| 809 | - $this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) { |
|
| 809 | + $this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) { |
|
| 810 | 810 | return new \OC\Files\Type\Detection( |
| 811 | 811 | $c->getURLGenerator(), |
| 812 | 812 | \OC::$configDir, |
| 813 | - \OC::$SERVERROOT . '/resources/config/' |
|
| 813 | + \OC::$SERVERROOT.'/resources/config/' |
|
| 814 | 814 | ); |
| 815 | 815 | }); |
| 816 | 816 | $this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class); |
| 817 | 817 | |
| 818 | - $this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) { |
|
| 818 | + $this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) { |
|
| 819 | 819 | return new \OC\Files\Type\Loader( |
| 820 | 820 | $c->getDatabaseConnection() |
| 821 | 821 | ); |
| 822 | 822 | }); |
| 823 | 823 | $this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class); |
| 824 | - $this->registerService(BundleFetcher::class, function () { |
|
| 824 | + $this->registerService(BundleFetcher::class, function() { |
|
| 825 | 825 | return new BundleFetcher($this->getL10N('lib')); |
| 826 | 826 | }); |
| 827 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
| 827 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
| 828 | 828 | return new Manager( |
| 829 | 829 | $c->query(IValidator::class) |
| 830 | 830 | ); |
| 831 | 831 | }); |
| 832 | 832 | $this->registerAlias('NotificationManager', \OCP\Notification\IManager::class); |
| 833 | 833 | |
| 834 | - $this->registerService(\OC\CapabilitiesManager::class, function (Server $c) { |
|
| 834 | + $this->registerService(\OC\CapabilitiesManager::class, function(Server $c) { |
|
| 835 | 835 | $manager = new \OC\CapabilitiesManager($c->getLogger()); |
| 836 | - $manager->registerCapability(function () use ($c) { |
|
| 836 | + $manager->registerCapability(function() use ($c) { |
|
| 837 | 837 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
| 838 | 838 | }); |
| 839 | - $manager->registerCapability(function () use ($c) { |
|
| 839 | + $manager->registerCapability(function() use ($c) { |
|
| 840 | 840 | return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
| 841 | 841 | }); |
| 842 | 842 | return $manager; |
@@ -891,13 +891,13 @@ discard block |
||
| 891 | 891 | $cacheFactory->create('SCSS') |
| 892 | 892 | ); |
| 893 | 893 | }); |
| 894 | - $this->registerService(EventDispatcher::class, function () { |
|
| 894 | + $this->registerService(EventDispatcher::class, function() { |
|
| 895 | 895 | return new EventDispatcher(); |
| 896 | 896 | }); |
| 897 | 897 | $this->registerAlias('EventDispatcher', EventDispatcher::class); |
| 898 | 898 | $this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class); |
| 899 | 899 | |
| 900 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
| 900 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
| 901 | 901 | // FIXME: Instantiiated here due to cyclic dependency |
| 902 | 902 | $request = new Request( |
| 903 | 903 | [ |
@@ -922,7 +922,7 @@ discard block |
||
| 922 | 922 | $request |
| 923 | 923 | ); |
| 924 | 924 | }); |
| 925 | - $this->registerService('CsrfTokenManager', function (Server $c) { |
|
| 925 | + $this->registerService('CsrfTokenManager', function(Server $c) { |
|
| 926 | 926 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
| 927 | 927 | |
| 928 | 928 | return new CsrfTokenManager( |
@@ -930,10 +930,10 @@ discard block |
||
| 930 | 930 | $c->query(SessionStorage::class) |
| 931 | 931 | ); |
| 932 | 932 | }); |
| 933 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
| 933 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
| 934 | 934 | return new SessionStorage($c->getSession()); |
| 935 | 935 | }); |
| 936 | - $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) { |
|
| 936 | + $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) { |
|
| 937 | 937 | return new ContentSecurityPolicyManager(); |
| 938 | 938 | }); |
| 939 | 939 | $this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class); |
@@ -989,29 +989,29 @@ discard block |
||
| 989 | 989 | ); |
| 990 | 990 | return $manager; |
| 991 | 991 | }); |
| 992 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
| 992 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
| 993 | 993 | return new \OC\Files\AppData\Factory( |
| 994 | 994 | $c->getRootFolder(), |
| 995 | 995 | $c->getSystemConfig() |
| 996 | 996 | ); |
| 997 | 997 | }); |
| 998 | 998 | |
| 999 | - $this->registerService('LockdownManager', function (Server $c) { |
|
| 999 | + $this->registerService('LockdownManager', function(Server $c) { |
|
| 1000 | 1000 | return new LockdownManager(function() use ($c) { |
| 1001 | 1001 | return $c->getSession(); |
| 1002 | 1002 | }); |
| 1003 | 1003 | }); |
| 1004 | 1004 | |
| 1005 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
| 1005 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
| 1006 | 1006 | return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
| 1007 | 1007 | }); |
| 1008 | 1008 | |
| 1009 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
| 1009 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
| 1010 | 1010 | return new CloudIdManager(); |
| 1011 | 1011 | }); |
| 1012 | 1012 | |
| 1013 | 1013 | /* To trick DI since we don't extend the DIContainer here */ |
| 1014 | - $this->registerService(CleanPreviewsBackgroundJob::class, function (Server $c) { |
|
| 1014 | + $this->registerService(CleanPreviewsBackgroundJob::class, function(Server $c) { |
|
| 1015 | 1015 | return new CleanPreviewsBackgroundJob( |
| 1016 | 1016 | $c->getRootFolder(), |
| 1017 | 1017 | $c->getLogger(), |
@@ -1026,7 +1026,7 @@ discard block |
||
| 1026 | 1026 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
| 1027 | 1027 | $this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
| 1028 | 1028 | |
| 1029 | - $this->registerService(Defaults::class, function (Server $c) { |
|
| 1029 | + $this->registerService(Defaults::class, function(Server $c) { |
|
| 1030 | 1030 | return new Defaults( |
| 1031 | 1031 | $c->getThemingDefaults() |
| 1032 | 1032 | ); |
@@ -1178,7 +1178,7 @@ discard block |
||
| 1178 | 1178 | * @deprecated since 9.2.0 use IAppData |
| 1179 | 1179 | */ |
| 1180 | 1180 | public function getAppFolder() { |
| 1181 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
| 1181 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
| 1182 | 1182 | $root = $this->getRootFolder(); |
| 1183 | 1183 | if (!$root->nodeExists($dir)) { |
| 1184 | 1184 | $folder = $root->newFolder($dir); |