@@ -66,6 +66,6 @@ |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | private function getInternalFolder(string $name): string { |
| 69 | - return implode('/', str_split(substr(md5($name), 0, 7))) . '/' . $name; |
|
| 69 | + return implode('/', str_split(substr(md5($name), 0, 7))).'/'.$name; |
|
| 70 | 70 | } |
| 71 | 71 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | public function run($argument) { |
| 65 | 65 | foreach ($this->getDeletedFiles() as $fileId) { |
| 66 | 66 | try { |
| 67 | - $preview = $this->previewFolder->getFolder((string)$fileId); |
|
| 67 | + $preview = $this->previewFolder->getFolder((string) $fileId); |
|
| 68 | 68 | $preview->delete(); |
| 69 | 69 | } catch (NotFoundException $e) { |
| 70 | 70 | // continue |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * We take the md5 of the name (fileid) and split the first 7 chars. That way |
| 126 | 126 | * there are not a gazillion files in the root of the preview appdata. |
| 127 | 127 | */ |
| 128 | - $like = $this->connection->escapeLikeParameter($data['path']) . '/_/_/_/_/_/_/_/%'; |
|
| 128 | + $like = $this->connection->escapeLikeParameter($data['path']).'/_/_/_/_/_/_/_/%'; |
|
| 129 | 129 | |
| 130 | 130 | $qb = $this->connection->getQueryBuilder(); |
| 131 | 131 | $qb->select('a.name') |
@@ -256,7 +256,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | new \OC\Preview\Storage\Root($c->getRootFolder(), $c->getSystemConfig(), '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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | $arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
| 655 | 655 | ArrayCache::class, |
| 656 | 656 | ArrayCache::class, |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | $version = implode(',', $v); |
| 665 | 665 | $instanceId = \OC_Util::getInstanceId(); |
| 666 | 666 | $path = \OC::$SERVERROOT; |
| 667 | - $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
| 667 | + $prefix = md5($instanceId.'-'.$version.'-'.$path); |
|
| 668 | 668 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
| 669 | 669 | $config->getSystemValue('memcache.local', null), |
| 670 | 670 | $config->getSystemValue('memcache.distributed', null), |
@@ -676,12 +676,12 @@ discard block |
||
| 676 | 676 | $this->registerDeprecatedAlias('MemCacheFactory', Factory::class); |
| 677 | 677 | $this->registerAlias(ICacheFactory::class, Factory::class); |
| 678 | 678 | |
| 679 | - $this->registerService('RedisFactory', function (Server $c) { |
|
| 679 | + $this->registerService('RedisFactory', function(Server $c) { |
|
| 680 | 680 | $systemConfig = $c->getSystemConfig(); |
| 681 | 681 | return new RedisFactory($systemConfig); |
| 682 | 682 | }); |
| 683 | 683 | |
| 684 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
| 684 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
| 685 | 685 | return new \OC\Activity\Manager( |
| 686 | 686 | $c->getRequest(), |
| 687 | 687 | $c->getUserSession(), |
@@ -691,14 +691,14 @@ discard block |
||
| 691 | 691 | }); |
| 692 | 692 | $this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class); |
| 693 | 693 | |
| 694 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
| 694 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
| 695 | 695 | return new \OC\Activity\EventMerger( |
| 696 | 696 | $c->getL10N('lib') |
| 697 | 697 | ); |
| 698 | 698 | }); |
| 699 | 699 | $this->registerAlias(IValidator::class, Validator::class); |
| 700 | 700 | |
| 701 | - $this->registerService(AvatarManager::class, function (Server $c) { |
|
| 701 | + $this->registerService(AvatarManager::class, function(Server $c) { |
|
| 702 | 702 | return new AvatarManager( |
| 703 | 703 | $c->query(\OC\User\Manager::class), |
| 704 | 704 | $c->getAppDataDir('avatar'), |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
| 714 | 714 | $this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class); |
| 715 | 715 | |
| 716 | - $this->registerService(\OC\Log::class, function (Server $c) { |
|
| 716 | + $this->registerService(\OC\Log::class, function(Server $c) { |
|
| 717 | 717 | $logType = $c->query(AllConfig::class)->getSystemValue('log_type', 'file'); |
| 718 | 718 | $factory = new LogFactory($c, $this->getSystemConfig()); |
| 719 | 719 | $logger = $factory->get($logType); |
@@ -726,11 +726,11 @@ discard block |
||
| 726 | 726 | // PSR-3 logger |
| 727 | 727 | $this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class); |
| 728 | 728 | |
| 729 | - $this->registerService(ILogFactory::class, function (Server $c) { |
|
| 729 | + $this->registerService(ILogFactory::class, function(Server $c) { |
|
| 730 | 730 | return new LogFactory($c, $this->getSystemConfig()); |
| 731 | 731 | }); |
| 732 | 732 | |
| 733 | - $this->registerService(IJobList::class, function (Server $c) { |
|
| 733 | + $this->registerService(IJobList::class, function(Server $c) { |
|
| 734 | 734 | $config = $c->getConfig(); |
| 735 | 735 | return new \OC\BackgroundJob\JobList( |
| 736 | 736 | $c->getDatabaseConnection(), |
@@ -740,7 +740,7 @@ discard block |
||
| 740 | 740 | }); |
| 741 | 741 | $this->registerDeprecatedAlias('JobList', IJobList::class); |
| 742 | 742 | |
| 743 | - $this->registerService(IRouter::class, function (Server $c) { |
|
| 743 | + $this->registerService(IRouter::class, function(Server $c) { |
|
| 744 | 744 | $cacheFactory = $c->getMemCacheFactory(); |
| 745 | 745 | $logger = $c->getLogger(); |
| 746 | 746 | if ($cacheFactory->isLocalCacheAvailable()) { |
@@ -752,39 +752,39 @@ discard block |
||
| 752 | 752 | }); |
| 753 | 753 | $this->registerDeprecatedAlias('Router', IRouter::class); |
| 754 | 754 | |
| 755 | - $this->registerService(ISearch::class, function ($c) { |
|
| 755 | + $this->registerService(ISearch::class, function($c) { |
|
| 756 | 756 | return new Search(); |
| 757 | 757 | }); |
| 758 | 758 | $this->registerDeprecatedAlias('Search', ISearch::class); |
| 759 | 759 | |
| 760 | - $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
| 760 | + $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
| 761 | 761 | return new \OC\Security\RateLimiting\Backend\MemoryCache( |
| 762 | 762 | $this->getMemCacheFactory(), |
| 763 | 763 | new \OC\AppFramework\Utility\TimeFactory() |
| 764 | 764 | ); |
| 765 | 765 | }); |
| 766 | 766 | |
| 767 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
| 767 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
| 768 | 768 | return new SecureRandom(); |
| 769 | 769 | }); |
| 770 | 770 | $this->registerDeprecatedAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
| 771 | 771 | |
| 772 | - $this->registerService(ICrypto::class, function (Server $c) { |
|
| 772 | + $this->registerService(ICrypto::class, function(Server $c) { |
|
| 773 | 773 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
| 774 | 774 | }); |
| 775 | 775 | $this->registerDeprecatedAlias('Crypto', ICrypto::class); |
| 776 | 776 | |
| 777 | - $this->registerService(IHasher::class, function (Server $c) { |
|
| 777 | + $this->registerService(IHasher::class, function(Server $c) { |
|
| 778 | 778 | return new Hasher($c->getConfig()); |
| 779 | 779 | }); |
| 780 | 780 | $this->registerDeprecatedAlias('Hasher', IHasher::class); |
| 781 | 781 | |
| 782 | - $this->registerService(ICredentialsManager::class, function (Server $c) { |
|
| 782 | + $this->registerService(ICredentialsManager::class, function(Server $c) { |
|
| 783 | 783 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
| 784 | 784 | }); |
| 785 | 785 | $this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class); |
| 786 | 786 | |
| 787 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
| 787 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
| 788 | 788 | $systemConfig = $c->getSystemConfig(); |
| 789 | 789 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
| 790 | 790 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -799,7 +799,7 @@ discard block |
||
| 799 | 799 | $this->registerDeprecatedAlias('DatabaseConnection', IDBConnection::class); |
| 800 | 800 | |
| 801 | 801 | |
| 802 | - $this->registerService(IClientService::class, function (Server $c) { |
|
| 802 | + $this->registerService(IClientService::class, function(Server $c) { |
|
| 803 | 803 | $user = \OC_User::getUser(); |
| 804 | 804 | $uid = $user ? $user : null; |
| 805 | 805 | return new ClientService( |
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | ); |
| 816 | 816 | }); |
| 817 | 817 | $this->registerDeprecatedAlias('HttpClientService', IClientService::class); |
| 818 | - $this->registerService(IEventLogger::class, function (Server $c) { |
|
| 818 | + $this->registerService(IEventLogger::class, function(Server $c) { |
|
| 819 | 819 | $eventLogger = new EventLogger(); |
| 820 | 820 | if ($c->getSystemConfig()->getValue('debug', false)) { |
| 821 | 821 | // In debug mode, module is being activated by default |
@@ -825,7 +825,7 @@ discard block |
||
| 825 | 825 | }); |
| 826 | 826 | $this->registerDeprecatedAlias('EventLogger', IEventLogger::class); |
| 827 | 827 | |
| 828 | - $this->registerService(IQueryLogger::class, function (Server $c) { |
|
| 828 | + $this->registerService(IQueryLogger::class, function(Server $c) { |
|
| 829 | 829 | $queryLogger = new QueryLogger(); |
| 830 | 830 | if ($c->getSystemConfig()->getValue('debug', false)) { |
| 831 | 831 | // In debug mode, module is being activated by default |
@@ -835,7 +835,7 @@ discard block |
||
| 835 | 835 | }); |
| 836 | 836 | $this->registerDeprecatedAlias('QueryLogger', IQueryLogger::class); |
| 837 | 837 | |
| 838 | - $this->registerService(TempManager::class, function (Server $c) { |
|
| 838 | + $this->registerService(TempManager::class, function(Server $c) { |
|
| 839 | 839 | return new TempManager( |
| 840 | 840 | $c->getLogger(), |
| 841 | 841 | $c->getConfig() |
@@ -844,7 +844,7 @@ discard block |
||
| 844 | 844 | $this->registerDeprecatedAlias('TempManager', TempManager::class); |
| 845 | 845 | $this->registerAlias(ITempManager::class, TempManager::class); |
| 846 | 846 | |
| 847 | - $this->registerService(AppManager::class, function (Server $c) { |
|
| 847 | + $this->registerService(AppManager::class, function(Server $c) { |
|
| 848 | 848 | return new \OC\App\AppManager( |
| 849 | 849 | $c->getUserSession(), |
| 850 | 850 | $c->getConfig(), |
@@ -858,7 +858,7 @@ discard block |
||
| 858 | 858 | $this->registerDeprecatedAlias('AppManager', AppManager::class); |
| 859 | 859 | $this->registerAlias(IAppManager::class, AppManager::class); |
| 860 | 860 | |
| 861 | - $this->registerService(IDateTimeZone::class, function (Server $c) { |
|
| 861 | + $this->registerService(IDateTimeZone::class, function(Server $c) { |
|
| 862 | 862 | return new DateTimeZone( |
| 863 | 863 | $c->getConfig(), |
| 864 | 864 | $c->getSession() |
@@ -866,7 +866,7 @@ discard block |
||
| 866 | 866 | }); |
| 867 | 867 | $this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class); |
| 868 | 868 | |
| 869 | - $this->registerService(IDateTimeFormatter::class, function (Server $c) { |
|
| 869 | + $this->registerService(IDateTimeFormatter::class, function(Server $c) { |
|
| 870 | 870 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
| 871 | 871 | |
| 872 | 872 | return new DateTimeFormatter( |
@@ -876,7 +876,7 @@ discard block |
||
| 876 | 876 | }); |
| 877 | 877 | $this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class); |
| 878 | 878 | |
| 879 | - $this->registerService(IUserMountCache::class, function (Server $c) { |
|
| 879 | + $this->registerService(IUserMountCache::class, function(Server $c) { |
|
| 880 | 880 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
| 881 | 881 | $listener = new UserMountCacheListener($mountCache); |
| 882 | 882 | $listener->listen($c->getUserManager()); |
@@ -884,7 +884,7 @@ discard block |
||
| 884 | 884 | }); |
| 885 | 885 | $this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class); |
| 886 | 886 | |
| 887 | - $this->registerService(IMountProviderCollection::class, function (Server $c) { |
|
| 887 | + $this->registerService(IMountProviderCollection::class, function(Server $c) { |
|
| 888 | 888 | $loader = \OC\Files\Filesystem::getLoader(); |
| 889 | 889 | $mountCache = $c->query(IUserMountCache::class); |
| 890 | 890 | $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
@@ -900,10 +900,10 @@ discard block |
||
| 900 | 900 | }); |
| 901 | 901 | $this->registerDeprecatedAlias('MountConfigManager', IMountProviderCollection::class); |
| 902 | 902 | |
| 903 | - $this->registerService('IniWrapper', function ($c) { |
|
| 903 | + $this->registerService('IniWrapper', function($c) { |
|
| 904 | 904 | return new IniGetWrapper(); |
| 905 | 905 | }); |
| 906 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
| 906 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
| 907 | 907 | $busClass = $c->getConfig()->getSystemValue('commandbus'); |
| 908 | 908 | if ($busClass) { |
| 909 | 909 | list($app, $class) = explode('::', $busClass, 2); |
@@ -918,10 +918,10 @@ discard block |
||
| 918 | 918 | return new CronBus($jobList); |
| 919 | 919 | } |
| 920 | 920 | }); |
| 921 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
| 921 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
| 922 | 922 | return new TrustedDomainHelper($this->getConfig()); |
| 923 | 923 | }); |
| 924 | - $this->registerService(Throttler::class, function (Server $c) { |
|
| 924 | + $this->registerService(Throttler::class, function(Server $c) { |
|
| 925 | 925 | return new Throttler( |
| 926 | 926 | $c->getDatabaseConnection(), |
| 927 | 927 | new TimeFactory(), |
@@ -930,7 +930,7 @@ discard block |
||
| 930 | 930 | ); |
| 931 | 931 | }); |
| 932 | 932 | $this->registerDeprecatedAlias('Throttler', Throttler::class); |
| 933 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
| 933 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
| 934 | 934 | // IConfig and IAppManager requires a working database. This code |
| 935 | 935 | // might however be called when ownCloud is not yet setup. |
| 936 | 936 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
@@ -952,7 +952,7 @@ discard block |
||
| 952 | 952 | $c->getMimeTypeDetector() |
| 953 | 953 | ); |
| 954 | 954 | }); |
| 955 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
| 955 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
| 956 | 956 | if (isset($this['urlParams'])) { |
| 957 | 957 | $urlParams = $this['urlParams']; |
| 958 | 958 | } else { |
@@ -988,7 +988,7 @@ discard block |
||
| 988 | 988 | }); |
| 989 | 989 | $this->registerDeprecatedAlias('Request', \OCP\IRequest::class); |
| 990 | 990 | |
| 991 | - $this->registerService(IMailer::class, function (Server $c) { |
|
| 991 | + $this->registerService(IMailer::class, function(Server $c) { |
|
| 992 | 992 | return new Mailer( |
| 993 | 993 | $c->getConfig(), |
| 994 | 994 | $c->getLogger(), |
@@ -1001,7 +1001,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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,26 +1066,26 @@ discard block |
||
| 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 */ |
| 1085 | 1085 | $factory = new $factoryClass($this); |
| 1086 | 1086 | $manager = $factory->getManager(); |
| 1087 | 1087 | |
| 1088 | - $manager->registerDisplayNameResolver('user', function ($id) use ($c) { |
|
| 1088 | + $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
|
| 1089 | 1089 | $manager = $c->getUserManager(); |
| 1090 | 1090 | $user = $manager->get($id); |
| 1091 | 1091 | if (is_null($user)) { |
@@ -1101,7 +1101,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 */ |
@@ -1231,7 +1231,7 @@ discard block |
||
| 1231 | 1231 | }); |
| 1232 | 1232 | $this->registerDeprecatedAlias('ShareManager', \OCP\Share\IManager::class); |
| 1233 | 1233 | |
| 1234 | - $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) { |
|
| 1234 | + $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function(Server $c) { |
|
| 1235 | 1235 | $instance = new Collaboration\Collaborators\Search($c); |
| 1236 | 1236 | |
| 1237 | 1237 | // register default plugins |
@@ -1251,7 +1251,7 @@ discard block |
||
| 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 |
||
| 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,24 +1299,24 @@ discard block |
||
| 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 | ); |
| 1317 | 1317 | }); |
| 1318 | 1318 | |
| 1319 | - $this->registerService(Installer::class, function (Server $c) { |
|
| 1319 | + $this->registerService(Installer::class, function(Server $c) { |
|
| 1320 | 1320 | return new Installer( |
| 1321 | 1321 | $c->getAppFetcher(), |
| 1322 | 1322 | $c->getHTTPClientService(), |
@@ -1327,16 +1327,16 @@ discard block |
||
| 1327 | 1327 | ); |
| 1328 | 1328 | }); |
| 1329 | 1329 | |
| 1330 | - $this->registerService(IApiFactory::class, function (Server $c) { |
|
| 1330 | + $this->registerService(IApiFactory::class, function(Server $c) { |
|
| 1331 | 1331 | return new ApiFactory($c->getHTTPClientService()); |
| 1332 | 1332 | }); |
| 1333 | 1333 | |
| 1334 | - $this->registerService(IInstanceFactory::class, function (Server $c) { |
|
| 1334 | + $this->registerService(IInstanceFactory::class, function(Server $c) { |
|
| 1335 | 1335 | $memcacheFactory = $c->getMemCacheFactory(); |
| 1336 | 1336 | return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->getHTTPClientService()); |
| 1337 | 1337 | }); |
| 1338 | 1338 | |
| 1339 | - $this->registerService(IContactsStore::class, function (Server $c) { |
|
| 1339 | + $this->registerService(IContactsStore::class, function(Server $c) { |
|
| 1340 | 1340 | return new ContactsStore( |
| 1341 | 1341 | $c->getContactsManager(), |
| 1342 | 1342 | $c->getConfig(), |
@@ -1347,7 +1347,7 @@ discard block |
||
| 1347 | 1347 | $this->registerAlias(IContactsStore::class, ContactsStore::class); |
| 1348 | 1348 | $this->registerAlias(IAccountManager::class, AccountManager::class); |
| 1349 | 1349 | |
| 1350 | - $this->registerService(IStorageFactory::class, function () { |
|
| 1350 | + $this->registerService(IStorageFactory::class, function() { |
|
| 1351 | 1351 | return new StorageFactory(); |
| 1352 | 1352 | }); |
| 1353 | 1353 | |
@@ -1386,7 +1386,7 @@ discard block |
||
| 1386 | 1386 | $dispatcher = $this->getEventDispatcher(); |
| 1387 | 1387 | |
| 1388 | 1388 | // Delete avatar on user deletion |
| 1389 | - $dispatcher->addListener('OCP\IUser::preDelete', function (GenericEvent $e) { |
|
| 1389 | + $dispatcher->addListener('OCP\IUser::preDelete', function(GenericEvent $e) { |
|
| 1390 | 1390 | $logger = $this->getLogger(); |
| 1391 | 1391 | $manager = $this->getAvatarManager(); |
| 1392 | 1392 | /** @var IUser $user */ |
@@ -1399,11 +1399,11 @@ discard block |
||
| 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 |
||
| 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); |
@@ -2237,11 +2237,11 @@ discard block |
||
| 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 | } |