@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $this->initProviders(); |
53 | 53 | $results = []; |
54 | 54 | foreach ($this->providers as $provider) { |
55 | - if (! $provider->providesResultsFor($inApps)) { |
|
55 | + if (!$provider->providesResultsFor($inApps)) { |
|
56 | 56 | continue; |
57 | 57 | } |
58 | 58 | if ($provider instanceof PagedProvider) { |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | public function removeProvider($provider) { |
88 | 88 | $this->registeredProviders = array_filter( |
89 | 89 | $this->registeredProviders, |
90 | - function ($element) use ($provider) { |
|
90 | + function($element) use ($provider) { |
|
91 | 91 | return ($element['class'] != $provider); |
92 | 92 | } |
93 | 93 | ); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * Create instances of all the registered search providers |
109 | 109 | */ |
110 | 110 | private function initProviders() { |
111 | - if (! empty($this->providers)) { |
|
111 | + if (!empty($this->providers)) { |
|
112 | 112 | return; |
113 | 113 | } |
114 | 114 | foreach ($this->registeredProviders as $provider) { |
@@ -258,10 +258,10 @@ discard block |
||
258 | 258 | $this->registerParameter('isCLI', \OC::$CLI); |
259 | 259 | $this->registerParameter('serverRoot', \OC::$SERVERROOT); |
260 | 260 | |
261 | - $this->registerService(ContainerInterface::class, function (ContainerInterface $c) { |
|
261 | + $this->registerService(ContainerInterface::class, function(ContainerInterface $c) { |
|
262 | 262 | return $c; |
263 | 263 | }); |
264 | - $this->registerService(\OCP\IServerContainer::class, function (ContainerInterface $c) { |
|
264 | + $this->registerService(\OCP\IServerContainer::class, function(ContainerInterface $c) { |
|
265 | 265 | return $c; |
266 | 266 | }); |
267 | 267 | |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | $this->registerAlias(IActionFactory::class, ActionFactory::class); |
287 | 287 | |
288 | 288 | |
289 | - $this->registerService(IPreview::class, function (Server $c) { |
|
289 | + $this->registerService(IPreview::class, function(Server $c) { |
|
290 | 290 | return new PreviewManager( |
291 | 291 | $c->getConfig(), |
292 | 292 | $c->getRootFolder(), |
@@ -299,13 +299,13 @@ discard block |
||
299 | 299 | /** @deprecated 19.0.0 */ |
300 | 300 | $this->registerDeprecatedAlias('PreviewManager', IPreview::class); |
301 | 301 | |
302 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
302 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
303 | 303 | return new \OC\Preview\Watcher( |
304 | 304 | new \OC\Preview\Storage\Root($c->getRootFolder(), $c->getSystemConfig()) |
305 | 305 | ); |
306 | 306 | }); |
307 | 307 | |
308 | - $this->registerService(\OCP\Encryption\IManager::class, function (Server $c) { |
|
308 | + $this->registerService(\OCP\Encryption\IManager::class, function(Server $c) { |
|
309 | 309 | $view = new View(); |
310 | 310 | $util = new Encryption\Util( |
311 | 311 | $view, |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | /** @deprecated 19.0.0 */ |
326 | 326 | $this->registerDeprecatedAlias('EncryptionManager', \OCP\Encryption\IManager::class); |
327 | 327 | |
328 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
328 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
329 | 329 | $util = new Encryption\Util( |
330 | 330 | new View(), |
331 | 331 | $c->getUserManager(), |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | ); |
340 | 340 | }); |
341 | 341 | |
342 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
342 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
343 | 343 | $view = new View(); |
344 | 344 | $util = new Encryption\Util( |
345 | 345 | $view, |
@@ -357,21 +357,21 @@ discard block |
||
357 | 357 | /** @deprecated 19.0.0 */ |
358 | 358 | $this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class); |
359 | 359 | |
360 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
360 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
361 | 361 | $config = $c->getConfig(); |
362 | 362 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
363 | 363 | return new $factoryClass($this); |
364 | 364 | }); |
365 | - $this->registerService(ISystemTagManager::class, function (Server $c) { |
|
365 | + $this->registerService(ISystemTagManager::class, function(Server $c) { |
|
366 | 366 | return $c->query('SystemTagManagerFactory')->getManager(); |
367 | 367 | }); |
368 | 368 | /** @deprecated 19.0.0 */ |
369 | 369 | $this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class); |
370 | 370 | |
371 | - $this->registerService(ISystemTagObjectMapper::class, function (Server $c) { |
|
371 | + $this->registerService(ISystemTagObjectMapper::class, function(Server $c) { |
|
372 | 372 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
373 | 373 | }); |
374 | - $this->registerService('RootFolder', function (Server $c) { |
|
374 | + $this->registerService('RootFolder', function(Server $c) { |
|
375 | 375 | $manager = \OC\Files\Filesystem::getMountManager(null); |
376 | 376 | $view = new View(); |
377 | 377 | $root = new Root( |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | |
389 | 389 | return $root; |
390 | 390 | }); |
391 | - $this->registerService(HookConnector::class, function (Server $c) { |
|
391 | + $this->registerService(HookConnector::class, function(Server $c) { |
|
392 | 392 | return new HookConnector( |
393 | 393 | $c->query(IRootFolder::class), |
394 | 394 | new View(), |
@@ -400,8 +400,8 @@ discard block |
||
400 | 400 | /** @deprecated 19.0.0 */ |
401 | 401 | $this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class); |
402 | 402 | |
403 | - $this->registerService(IRootFolder::class, function (Server $c) { |
|
404 | - return new LazyRoot(function () use ($c) { |
|
403 | + $this->registerService(IRootFolder::class, function(Server $c) { |
|
404 | + return new LazyRoot(function() use ($c) { |
|
405 | 405 | return $c->query('RootFolder'); |
406 | 406 | }); |
407 | 407 | }); |
@@ -412,44 +412,44 @@ discard block |
||
412 | 412 | $this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class); |
413 | 413 | $this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
414 | 414 | |
415 | - $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
415 | + $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
416 | 416 | $groupManager = new \OC\Group\Manager($this->getUserManager(), $c->getEventDispatcher(), $this->getLogger()); |
417 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
417 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
418 | 418 | \OC_Hook::emit('OC_Group', 'pre_createGroup', ['run' => true, 'gid' => $gid]); |
419 | 419 | |
420 | 420 | /** @var IEventDispatcher $dispatcher */ |
421 | 421 | $dispatcher = $this->query(IEventDispatcher::class); |
422 | 422 | $dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid)); |
423 | 423 | }); |
424 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) { |
|
424 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $group) { |
|
425 | 425 | \OC_Hook::emit('OC_User', 'post_createGroup', ['gid' => $group->getGID()]); |
426 | 426 | |
427 | 427 | /** @var IEventDispatcher $dispatcher */ |
428 | 428 | $dispatcher = $this->query(IEventDispatcher::class); |
429 | 429 | $dispatcher->dispatchTyped(new GroupCreatedEvent($group)); |
430 | 430 | }); |
431 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
431 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
432 | 432 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', ['run' => true, 'gid' => $group->getGID()]); |
433 | 433 | |
434 | 434 | /** @var IEventDispatcher $dispatcher */ |
435 | 435 | $dispatcher = $this->query(IEventDispatcher::class); |
436 | 436 | $dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group)); |
437 | 437 | }); |
438 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
438 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
439 | 439 | \OC_Hook::emit('OC_User', 'post_deleteGroup', ['gid' => $group->getGID()]); |
440 | 440 | |
441 | 441 | /** @var IEventDispatcher $dispatcher */ |
442 | 442 | $dispatcher = $this->query(IEventDispatcher::class); |
443 | 443 | $dispatcher->dispatchTyped(new GroupDeletedEvent($group)); |
444 | 444 | }); |
445 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
445 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
446 | 446 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', ['run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()]); |
447 | 447 | |
448 | 448 | /** @var IEventDispatcher $dispatcher */ |
449 | 449 | $dispatcher = $this->query(IEventDispatcher::class); |
450 | 450 | $dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user)); |
451 | 451 | }); |
452 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
452 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
453 | 453 | \OC_Hook::emit('OC_Group', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]); |
454 | 454 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
455 | 455 | \OC_Hook::emit('OC_User', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]); |
@@ -458,12 +458,12 @@ discard block |
||
458 | 458 | $dispatcher = $this->query(IEventDispatcher::class); |
459 | 459 | $dispatcher->dispatchTyped(new UserAddedEvent($group, $user)); |
460 | 460 | }); |
461 | - $groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
461 | + $groupManager->listen('\OC\Group', 'preRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
462 | 462 | /** @var IEventDispatcher $dispatcher */ |
463 | 463 | $dispatcher = $this->query(IEventDispatcher::class); |
464 | 464 | $dispatcher->dispatchTyped(new BeforeUserRemovedEvent($group, $user)); |
465 | 465 | }); |
466 | - $groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
466 | + $groupManager->listen('\OC\Group', 'postRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
467 | 467 | /** @var IEventDispatcher $dispatcher */ |
468 | 468 | $dispatcher = $this->query(IEventDispatcher::class); |
469 | 469 | $dispatcher->dispatchTyped(new UserRemovedEvent($group, $user)); |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | /** @deprecated 19.0.0 */ |
474 | 474 | $this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class); |
475 | 475 | |
476 | - $this->registerService(Store::class, function (Server $c) { |
|
476 | + $this->registerService(Store::class, function(Server $c) { |
|
477 | 477 | $session = $c->getSession(); |
478 | 478 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
479 | 479 | $tokenProvider = $c->query(IProvider::class); |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | $this->registerAlias(IStore::class, Store::class); |
487 | 487 | $this->registerAlias(IProvider::class, Authentication\Token\Manager::class); |
488 | 488 | |
489 | - $this->registerService(\OC\User\Session::class, function (Server $c) { |
|
489 | + $this->registerService(\OC\User\Session::class, function(Server $c) { |
|
490 | 490 | $manager = $c->getUserManager(); |
491 | 491 | $session = new \OC\Session\Memory(''); |
492 | 492 | $timeFactory = new TimeFactory(); |
@@ -511,14 +511,14 @@ discard block |
||
511 | 511 | $c->getLogger(), |
512 | 512 | $c->query(IEventDispatcher::class) |
513 | 513 | ); |
514 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
514 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
515 | 515 | \OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]); |
516 | 516 | |
517 | 517 | /** @var IEventDispatcher $dispatcher */ |
518 | 518 | $dispatcher = $this->query(IEventDispatcher::class); |
519 | 519 | $dispatcher->dispatchTyped(new BeforeUserCreatedEvent($uid, $password)); |
520 | 520 | }); |
521 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
521 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
522 | 522 | /** @var \OC\User\User $user */ |
523 | 523 | \OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]); |
524 | 524 | |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | $dispatcher = $this->query(IEventDispatcher::class); |
527 | 527 | $dispatcher->dispatchTyped(new UserCreatedEvent($user, $password)); |
528 | 528 | }); |
529 | - $userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) { |
|
529 | + $userSession->listen('\OC\User', 'preDelete', function($user) use ($legacyDispatcher) { |
|
530 | 530 | /** @var \OC\User\User $user */ |
531 | 531 | \OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]); |
532 | 532 | $legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | $dispatcher = $this->query(IEventDispatcher::class); |
536 | 536 | $dispatcher->dispatchTyped(new BeforeUserDeletedEvent($user)); |
537 | 537 | }); |
538 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
538 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
539 | 539 | /** @var \OC\User\User $user */ |
540 | 540 | \OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]); |
541 | 541 | |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | $dispatcher = $this->query(IEventDispatcher::class); |
544 | 544 | $dispatcher->dispatchTyped(new UserDeletedEvent($user)); |
545 | 545 | }); |
546 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
546 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
547 | 547 | /** @var \OC\User\User $user */ |
548 | 548 | \OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]); |
549 | 549 | |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | $dispatcher = $this->query(IEventDispatcher::class); |
552 | 552 | $dispatcher->dispatchTyped(new BeforePasswordUpdatedEvent($user, $password, $recoveryPassword)); |
553 | 553 | }); |
554 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
554 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
555 | 555 | /** @var \OC\User\User $user */ |
556 | 556 | \OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]); |
557 | 557 | |
@@ -559,14 +559,14 @@ discard block |
||
559 | 559 | $dispatcher = $this->query(IEventDispatcher::class); |
560 | 560 | $dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword)); |
561 | 561 | }); |
562 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
562 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
563 | 563 | \OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]); |
564 | 564 | |
565 | 565 | /** @var IEventDispatcher $dispatcher */ |
566 | 566 | $dispatcher = $this->query(IEventDispatcher::class); |
567 | 567 | $dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password)); |
568 | 568 | }); |
569 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password, $isTokenLogin) { |
|
569 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password, $isTokenLogin) { |
|
570 | 570 | /** @var \OC\User\User $user */ |
571 | 571 | \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'isTokenLogin' => $isTokenLogin]); |
572 | 572 | |
@@ -574,12 +574,12 @@ discard block |
||
574 | 574 | $dispatcher = $this->query(IEventDispatcher::class); |
575 | 575 | $dispatcher->dispatchTyped(new UserLoggedInEvent($user, $password, $isTokenLogin)); |
576 | 576 | }); |
577 | - $userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) { |
|
577 | + $userSession->listen('\OC\User', 'preRememberedLogin', function($uid) { |
|
578 | 578 | /** @var IEventDispatcher $dispatcher */ |
579 | 579 | $dispatcher = $this->query(IEventDispatcher::class); |
580 | 580 | $dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid)); |
581 | 581 | }); |
582 | - $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
582 | + $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
583 | 583 | /** @var \OC\User\User $user */ |
584 | 584 | \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]); |
585 | 585 | |
@@ -587,19 +587,19 @@ discard block |
||
587 | 587 | $dispatcher = $this->query(IEventDispatcher::class); |
588 | 588 | $dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password)); |
589 | 589 | }); |
590 | - $userSession->listen('\OC\User', 'logout', function ($user) { |
|
590 | + $userSession->listen('\OC\User', 'logout', function($user) { |
|
591 | 591 | \OC_Hook::emit('OC_User', 'logout', []); |
592 | 592 | |
593 | 593 | /** @var IEventDispatcher $dispatcher */ |
594 | 594 | $dispatcher = $this->query(IEventDispatcher::class); |
595 | 595 | $dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user)); |
596 | 596 | }); |
597 | - $userSession->listen('\OC\User', 'postLogout', function ($user) { |
|
597 | + $userSession->listen('\OC\User', 'postLogout', function($user) { |
|
598 | 598 | /** @var IEventDispatcher $dispatcher */ |
599 | 599 | $dispatcher = $this->query(IEventDispatcher::class); |
600 | 600 | $dispatcher->dispatchTyped(new UserLoggedOutEvent($user)); |
601 | 601 | }); |
602 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
|
602 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) { |
|
603 | 603 | /** @var \OC\User\User $user */ |
604 | 604 | \OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]); |
605 | 605 | |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | $this->registerDeprecatedAlias('AllConfig', \OC\AllConfig::class); |
624 | 624 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
625 | 625 | |
626 | - $this->registerService(\OC\SystemConfig::class, function ($c) use ($config) { |
|
626 | + $this->registerService(\OC\SystemConfig::class, function($c) use ($config) { |
|
627 | 627 | return new \OC\SystemConfig($config); |
628 | 628 | }); |
629 | 629 | /** @deprecated 19.0.0 */ |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | $this->registerDeprecatedAlias('AppConfig', \OC\AppConfig::class); |
634 | 634 | $this->registerAlias(IAppConfig::class, \OC\AppConfig::class); |
635 | 635 | |
636 | - $this->registerService(IFactory::class, function (Server $c) { |
|
636 | + $this->registerService(IFactory::class, function(Server $c) { |
|
637 | 637 | return new \OC\L10N\Factory( |
638 | 638 | $c->getConfig(), |
639 | 639 | $c->getRequest(), |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | /** @deprecated 19.0.0 */ |
645 | 645 | $this->registerDeprecatedAlias('L10NFactory', IFactory::class); |
646 | 646 | |
647 | - $this->registerService(IURLGenerator::class, function (Server $c) { |
|
647 | + $this->registerService(IURLGenerator::class, function(Server $c) { |
|
648 | 648 | $config = $c->getConfig(); |
649 | 649 | $cacheFactory = $c->getMemCacheFactory(); |
650 | 650 | $request = $c->getRequest(); |
@@ -662,13 +662,13 @@ discard block |
||
662 | 662 | /** @deprecated 19.0.0 */ |
663 | 663 | $this->registerDeprecatedAlias('CategoryFetcher', CategoryFetcher::class); |
664 | 664 | |
665 | - $this->registerService(ICache::class, function ($c) { |
|
665 | + $this->registerService(ICache::class, function($c) { |
|
666 | 666 | return new Cache\File(); |
667 | 667 | }); |
668 | 668 | /** @deprecated 19.0.0 */ |
669 | 669 | $this->registerDeprecatedAlias('UserCache', ICache::class); |
670 | 670 | |
671 | - $this->registerService(Factory::class, function (Server $c) { |
|
671 | + $this->registerService(Factory::class, function(Server $c) { |
|
672 | 672 | $arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
673 | 673 | ArrayCache::class, |
674 | 674 | ArrayCache::class, |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | $version = implode(',', $v); |
683 | 683 | $instanceId = \OC_Util::getInstanceId(); |
684 | 684 | $path = \OC::$SERVERROOT; |
685 | - $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
685 | + $prefix = md5($instanceId.'-'.$version.'-'.$path); |
|
686 | 686 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
687 | 687 | $config->getSystemValue('memcache.local', null), |
688 | 688 | $config->getSystemValue('memcache.distributed', null), |
@@ -695,12 +695,12 @@ discard block |
||
695 | 695 | $this->registerDeprecatedAlias('MemCacheFactory', Factory::class); |
696 | 696 | $this->registerAlias(ICacheFactory::class, Factory::class); |
697 | 697 | |
698 | - $this->registerService('RedisFactory', function (Server $c) { |
|
698 | + $this->registerService('RedisFactory', function(Server $c) { |
|
699 | 699 | $systemConfig = $c->getSystemConfig(); |
700 | 700 | return new RedisFactory($systemConfig); |
701 | 701 | }); |
702 | 702 | |
703 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
703 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
704 | 704 | $l10n = $this->get(IFactory::class)->get('activity'); |
705 | 705 | return new \OC\Activity\Manager( |
706 | 706 | $c->getRequest(), |
@@ -713,14 +713,14 @@ discard block |
||
713 | 713 | /** @deprecated 19.0.0 */ |
714 | 714 | $this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class); |
715 | 715 | |
716 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
716 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
717 | 717 | return new \OC\Activity\EventMerger( |
718 | 718 | $c->getL10N('lib') |
719 | 719 | ); |
720 | 720 | }); |
721 | 721 | $this->registerAlias(IValidator::class, Validator::class); |
722 | 722 | |
723 | - $this->registerService(AvatarManager::class, function (Server $c) { |
|
723 | + $this->registerService(AvatarManager::class, function(Server $c) { |
|
724 | 724 | return new AvatarManager( |
725 | 725 | $c->query(\OC\User\Manager::class), |
726 | 726 | $c->getAppDataDir('avatar'), |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
737 | 737 | $this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class); |
738 | 738 | |
739 | - $this->registerService(\OC\Log::class, function (Server $c) { |
|
739 | + $this->registerService(\OC\Log::class, function(Server $c) { |
|
740 | 740 | $logType = $c->query(AllConfig::class)->getSystemValue('log_type', 'file'); |
741 | 741 | $factory = new LogFactory($c, $this->getSystemConfig()); |
742 | 742 | $logger = $factory->get($logType); |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | // PSR-3 logger |
751 | 751 | $this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class); |
752 | 752 | |
753 | - $this->registerService(ILogFactory::class, function (Server $c) { |
|
753 | + $this->registerService(ILogFactory::class, function(Server $c) { |
|
754 | 754 | return new LogFactory($c, $this->getSystemConfig()); |
755 | 755 | }); |
756 | 756 | |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | /** @deprecated 19.0.0 */ |
759 | 759 | $this->registerDeprecatedAlias('JobList', IJobList::class); |
760 | 760 | |
761 | - $this->registerService(IRouter::class, function (Server $c) { |
|
761 | + $this->registerService(IRouter::class, function(Server $c) { |
|
762 | 762 | $cacheFactory = $c->getMemCacheFactory(); |
763 | 763 | $logger = $c->getLogger(); |
764 | 764 | if ($cacheFactory->isLocalCacheAvailable()) { |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | /** @deprecated 19.0.0 */ |
776 | 776 | $this->registerDeprecatedAlias('Search', ISearch::class); |
777 | 777 | |
778 | - $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
778 | + $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
779 | 779 | return new \OC\Security\RateLimiting\Backend\MemoryCache( |
780 | 780 | $this->getMemCacheFactory(), |
781 | 781 | new \OC\AppFramework\Utility\TimeFactory() |
@@ -798,7 +798,7 @@ discard block |
||
798 | 798 | /** @deprecated 19.0.0 */ |
799 | 799 | $this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class); |
800 | 800 | |
801 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
801 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
802 | 802 | $systemConfig = $c->getSystemConfig(); |
803 | 803 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
804 | 804 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -814,7 +814,7 @@ discard block |
||
814 | 814 | $this->registerDeprecatedAlias('DatabaseConnection', IDBConnection::class); |
815 | 815 | |
816 | 816 | |
817 | - $this->registerService(IClientService::class, function (Server $c) { |
|
817 | + $this->registerService(IClientService::class, function(Server $c) { |
|
818 | 818 | $user = \OC_User::getUser(); |
819 | 819 | $uid = $user ? $user : null; |
820 | 820 | return new ClientService( |
@@ -831,7 +831,7 @@ discard block |
||
831 | 831 | }); |
832 | 832 | /** @deprecated 19.0.0 */ |
833 | 833 | $this->registerDeprecatedAlias('HttpClientService', IClientService::class); |
834 | - $this->registerService(IEventLogger::class, function (Server $c) { |
|
834 | + $this->registerService(IEventLogger::class, function(Server $c) { |
|
835 | 835 | $eventLogger = new EventLogger(); |
836 | 836 | if ($c->getSystemConfig()->getValue('debug', false)) { |
837 | 837 | // In debug mode, module is being activated by default |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | /** @deprecated 19.0.0 */ |
843 | 843 | $this->registerDeprecatedAlias('EventLogger', IEventLogger::class); |
844 | 844 | |
845 | - $this->registerService(IQueryLogger::class, function (Server $c) { |
|
845 | + $this->registerService(IQueryLogger::class, function(Server $c) { |
|
846 | 846 | $queryLogger = new QueryLogger(); |
847 | 847 | if ($c->getSystemConfig()->getValue('debug', false)) { |
848 | 848 | // In debug mode, module is being activated by default |
@@ -857,7 +857,7 @@ discard block |
||
857 | 857 | $this->registerDeprecatedAlias('TempManager', TempManager::class); |
858 | 858 | $this->registerAlias(ITempManager::class, TempManager::class); |
859 | 859 | |
860 | - $this->registerService(AppManager::class, function (Server $c) { |
|
860 | + $this->registerService(AppManager::class, function(Server $c) { |
|
861 | 861 | return new \OC\App\AppManager( |
862 | 862 | $c->getUserSession(), |
863 | 863 | $c->getConfig(), |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | /** @deprecated 19.0.0 */ |
877 | 877 | $this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class); |
878 | 878 | |
879 | - $this->registerService(IDateTimeFormatter::class, function (Server $c) { |
|
879 | + $this->registerService(IDateTimeFormatter::class, function(Server $c) { |
|
880 | 880 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
881 | 881 | |
882 | 882 | return new DateTimeFormatter( |
@@ -887,7 +887,7 @@ discard block |
||
887 | 887 | /** @deprecated 19.0.0 */ |
888 | 888 | $this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class); |
889 | 889 | |
890 | - $this->registerService(IUserMountCache::class, function (Server $c) { |
|
890 | + $this->registerService(IUserMountCache::class, function(Server $c) { |
|
891 | 891 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
892 | 892 | $listener = new UserMountCacheListener($mountCache); |
893 | 893 | $listener->listen($c->getUserManager()); |
@@ -896,7 +896,7 @@ discard block |
||
896 | 896 | /** @deprecated 19.0.0 */ |
897 | 897 | $this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class); |
898 | 898 | |
899 | - $this->registerService(IMountProviderCollection::class, function (Server $c) { |
|
899 | + $this->registerService(IMountProviderCollection::class, function(Server $c) { |
|
900 | 900 | $loader = \OC\Files\Filesystem::getLoader(); |
901 | 901 | $mountCache = $c->query(IUserMountCache::class); |
902 | 902 | $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | |
918 | 918 | /** @deprecated 20.0.0 */ |
919 | 919 | $this->registerDeprecatedAlias('IniWrapper', IniGetWrapper::class); |
920 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
920 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
921 | 921 | $busClass = $c->getConfig()->getSystemValue('commandbus'); |
922 | 922 | if ($busClass) { |
923 | 923 | [$app, $class] = explode('::', $busClass, 2); |
@@ -937,7 +937,7 @@ discard block |
||
937 | 937 | $this->registerDeprecatedAlias('TrustedDomainHelper', TrustedDomainHelper::class); |
938 | 938 | /** @deprecated 19.0.0 */ |
939 | 939 | $this->registerDeprecatedAlias('Throttler', Throttler::class); |
940 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
940 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
941 | 941 | // IConfig and IAppManager requires a working database. This code |
942 | 942 | // might however be called when ownCloud is not yet setup. |
943 | 943 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
@@ -959,7 +959,7 @@ discard block |
||
959 | 959 | $c->getMimeTypeDetector() |
960 | 960 | ); |
961 | 961 | }); |
962 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
962 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
963 | 963 | if (isset($this['urlParams'])) { |
964 | 964 | $urlParams = $this['urlParams']; |
965 | 965 | } else { |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | /** @deprecated 19.0.0 */ |
997 | 997 | $this->registerDeprecatedAlias('Request', \OCP\IRequest::class); |
998 | 998 | |
999 | - $this->registerService(IMailer::class, function (Server $c) { |
|
999 | + $this->registerService(IMailer::class, function(Server $c) { |
|
1000 | 1000 | return new Mailer( |
1001 | 1001 | $c->getConfig(), |
1002 | 1002 | $c->getLogger(), |
@@ -1010,7 +1010,7 @@ discard block |
||
1010 | 1010 | /** @deprecated 19.0.0 */ |
1011 | 1011 | $this->registerDeprecatedAlias('Mailer', IMailer::class); |
1012 | 1012 | |
1013 | - $this->registerService('LDAPProvider', function (Server $c) { |
|
1013 | + $this->registerService('LDAPProvider', function(Server $c) { |
|
1014 | 1014 | $config = $c->getConfig(); |
1015 | 1015 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
1016 | 1016 | if (is_null($factoryClass)) { |
@@ -1020,7 +1020,7 @@ discard block |
||
1020 | 1020 | $factory = new $factoryClass($this); |
1021 | 1021 | return $factory->getLDAPProvider(); |
1022 | 1022 | }); |
1023 | - $this->registerService(ILockingProvider::class, function (Server $c) { |
|
1023 | + $this->registerService(ILockingProvider::class, function(Server $c) { |
|
1024 | 1024 | $ini = $c->getIniWrapper(); |
1025 | 1025 | $config = $c->getConfig(); |
1026 | 1026 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -1048,12 +1048,12 @@ discard block |
||
1048 | 1048 | /** @deprecated 19.0.0 */ |
1049 | 1049 | $this->registerDeprecatedAlias('MountManager', IMountManager::class); |
1050 | 1050 | |
1051 | - $this->registerService(IMimeTypeDetector::class, function (Server $c) { |
|
1051 | + $this->registerService(IMimeTypeDetector::class, function(Server $c) { |
|
1052 | 1052 | return new \OC\Files\Type\Detection( |
1053 | 1053 | $c->getURLGenerator(), |
1054 | 1054 | $c->getLogger(), |
1055 | 1055 | \OC::$configDir, |
1056 | - \OC::$SERVERROOT . '/resources/config/' |
|
1056 | + \OC::$SERVERROOT.'/resources/config/' |
|
1057 | 1057 | ); |
1058 | 1058 | }); |
1059 | 1059 | /** @deprecated 19.0.0 */ |
@@ -1062,19 +1062,19 @@ discard block |
||
1062 | 1062 | $this->registerAlias(IMimeTypeLoader::class, Loader::class); |
1063 | 1063 | /** @deprecated 19.0.0 */ |
1064 | 1064 | $this->registerDeprecatedAlias('MimeTypeLoader', IMimeTypeLoader::class); |
1065 | - $this->registerService(BundleFetcher::class, function () { |
|
1065 | + $this->registerService(BundleFetcher::class, function() { |
|
1066 | 1066 | return new BundleFetcher($this->getL10N('lib')); |
1067 | 1067 | }); |
1068 | 1068 | $this->registerAlias(\OCP\Notification\IManager::class, Manager::class); |
1069 | 1069 | /** @deprecated 19.0.0 */ |
1070 | 1070 | $this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class); |
1071 | 1071 | |
1072 | - $this->registerService(CapabilitiesManager::class, function (Server $c) { |
|
1072 | + $this->registerService(CapabilitiesManager::class, function(Server $c) { |
|
1073 | 1073 | $manager = new CapabilitiesManager($c->getLogger()); |
1074 | - $manager->registerCapability(function () use ($c) { |
|
1074 | + $manager->registerCapability(function() use ($c) { |
|
1075 | 1075 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
1076 | 1076 | }); |
1077 | - $manager->registerCapability(function () use ($c) { |
|
1077 | + $manager->registerCapability(function() use ($c) { |
|
1078 | 1078 | return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
1079 | 1079 | }); |
1080 | 1080 | return $manager; |
@@ -1082,14 +1082,14 @@ discard block |
||
1082 | 1082 | /** @deprecated 19.0.0 */ |
1083 | 1083 | $this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class); |
1084 | 1084 | |
1085 | - $this->registerService(ICommentsManager::class, function (Server $c) { |
|
1085 | + $this->registerService(ICommentsManager::class, function(Server $c) { |
|
1086 | 1086 | $config = $c->getConfig(); |
1087 | 1087 | $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
1088 | 1088 | /** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
1089 | 1089 | $factory = new $factoryClass($this); |
1090 | 1090 | $manager = $factory->getManager(); |
1091 | 1091 | |
1092 | - $manager->registerDisplayNameResolver('user', function ($id) use ($c) { |
|
1092 | + $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
|
1093 | 1093 | $manager = $c->getUserManager(); |
1094 | 1094 | $user = $manager->get($id); |
1095 | 1095 | if (is_null($user)) { |
@@ -1107,7 +1107,7 @@ discard block |
||
1107 | 1107 | $this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class); |
1108 | 1108 | |
1109 | 1109 | $this->registerAlias(\OC_Defaults::class, 'ThemingDefaults'); |
1110 | - $this->registerService('ThemingDefaults', function (Server $c) { |
|
1110 | + $this->registerService('ThemingDefaults', function(Server $c) { |
|
1111 | 1111 | /* |
1112 | 1112 | * Dark magic for autoloader. |
1113 | 1113 | * If we do a class_exists it will try to load the class which will |
@@ -1135,7 +1135,7 @@ discard block |
||
1135 | 1135 | } |
1136 | 1136 | return new \OC_Defaults(); |
1137 | 1137 | }); |
1138 | - $this->registerService(JSCombiner::class, function (Server $c) { |
|
1138 | + $this->registerService(JSCombiner::class, function(Server $c) { |
|
1139 | 1139 | return new JSCombiner( |
1140 | 1140 | $c->getAppDataDir('js'), |
1141 | 1141 | $c->getURLGenerator(), |
@@ -1149,7 +1149,7 @@ discard block |
||
1149 | 1149 | $this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class); |
1150 | 1150 | $this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class); |
1151 | 1151 | |
1152 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
1152 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
1153 | 1153 | // FIXME: Instantiiated here due to cyclic dependency |
1154 | 1154 | $request = new Request( |
1155 | 1155 | [ |
@@ -1176,14 +1176,14 @@ discard block |
||
1176 | 1176 | }); |
1177 | 1177 | /** @deprecated 19.0.0 */ |
1178 | 1178 | $this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class); |
1179 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
1179 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
1180 | 1180 | return new SessionStorage($c->getSession()); |
1181 | 1181 | }); |
1182 | 1182 | $this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class); |
1183 | 1183 | /** @deprecated 19.0.0 */ |
1184 | 1184 | $this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class); |
1185 | 1185 | |
1186 | - $this->registerService(\OCP\Share\IManager::class, function (Server $c) { |
|
1186 | + $this->registerService(\OCP\Share\IManager::class, function(Server $c) { |
|
1187 | 1187 | $config = $c->getConfig(); |
1188 | 1188 | $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
1189 | 1189 | /** @var \OCP\Share\IProviderFactory $factory */ |
@@ -1213,7 +1213,7 @@ discard block |
||
1213 | 1213 | /** @deprecated 19.0.0 */ |
1214 | 1214 | $this->registerDeprecatedAlias('ShareManager', \OCP\Share\IManager::class); |
1215 | 1215 | |
1216 | - $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) { |
|
1216 | + $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function(Server $c) { |
|
1217 | 1217 | $instance = new Collaboration\Collaborators\Search($c); |
1218 | 1218 | |
1219 | 1219 | // register default plugins |
@@ -1234,7 +1234,7 @@ discard block |
||
1234 | 1234 | $this->registerAlias(\OCP\Collaboration\Resources\IProviderManager::class, \OC\Collaboration\Resources\ProviderManager::class); |
1235 | 1235 | $this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\Manager::class); |
1236 | 1236 | |
1237 | - $this->registerService('SettingsManager', function (Server $c) { |
|
1237 | + $this->registerService('SettingsManager', function(Server $c) { |
|
1238 | 1238 | $manager = new \OC\Settings\Manager( |
1239 | 1239 | $c->getLogger(), |
1240 | 1240 | $c->getL10NFactory(), |
@@ -1243,34 +1243,34 @@ discard block |
||
1243 | 1243 | ); |
1244 | 1244 | return $manager; |
1245 | 1245 | }); |
1246 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
1246 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
1247 | 1247 | return new \OC\Files\AppData\Factory( |
1248 | 1248 | $c->getRootFolder(), |
1249 | 1249 | $c->getSystemConfig() |
1250 | 1250 | ); |
1251 | 1251 | }); |
1252 | 1252 | |
1253 | - $this->registerService('LockdownManager', function (Server $c) { |
|
1254 | - return new LockdownManager(function () use ($c) { |
|
1253 | + $this->registerService('LockdownManager', function(Server $c) { |
|
1254 | + return new LockdownManager(function() use ($c) { |
|
1255 | 1255 | return $c->getSession(); |
1256 | 1256 | }); |
1257 | 1257 | }); |
1258 | 1258 | |
1259 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
1259 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
1260 | 1260 | return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
1261 | 1261 | }); |
1262 | 1262 | |
1263 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
1263 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
1264 | 1264 | return new CloudIdManager(); |
1265 | 1265 | }); |
1266 | 1266 | |
1267 | 1267 | $this->registerAlias(\OCP\GlobalScale\IConfig::class, \OC\GlobalScale\Config::class); |
1268 | 1268 | |
1269 | - $this->registerService(ICloudFederationProviderManager::class, function (Server $c) { |
|
1269 | + $this->registerService(ICloudFederationProviderManager::class, function(Server $c) { |
|
1270 | 1270 | return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger()); |
1271 | 1271 | }); |
1272 | 1272 | |
1273 | - $this->registerService(ICloudFederationFactory::class, function (Server $c) { |
|
1273 | + $this->registerService(ICloudFederationFactory::class, function(Server $c) { |
|
1274 | 1274 | return new CloudFederationFactory(); |
1275 | 1275 | }); |
1276 | 1276 | |
@@ -1282,7 +1282,7 @@ discard block |
||
1282 | 1282 | /** @deprecated 19.0.0 */ |
1283 | 1283 | $this->registerDeprecatedAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
1284 | 1284 | |
1285 | - $this->registerService(Defaults::class, function (Server $c) { |
|
1285 | + $this->registerService(Defaults::class, function(Server $c) { |
|
1286 | 1286 | return new Defaults( |
1287 | 1287 | $c->getThemingDefaults() |
1288 | 1288 | ); |
@@ -1290,17 +1290,17 @@ discard block |
||
1290 | 1290 | /** @deprecated 19.0.0 */ |
1291 | 1291 | $this->registerDeprecatedAlias('Defaults', \OCP\Defaults::class); |
1292 | 1292 | |
1293 | - $this->registerService(\OCP\ISession::class, function (SimpleContainer $c) { |
|
1293 | + $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { |
|
1294 | 1294 | return $c->query(\OCP\IUserSession::class)->getSession(); |
1295 | 1295 | }); |
1296 | 1296 | |
1297 | - $this->registerService(IShareHelper::class, function (Server $c) { |
|
1297 | + $this->registerService(IShareHelper::class, function(Server $c) { |
|
1298 | 1298 | return new ShareHelper( |
1299 | 1299 | $c->query(\OCP\Share\IManager::class) |
1300 | 1300 | ); |
1301 | 1301 | }); |
1302 | 1302 | |
1303 | - $this->registerService(Installer::class, function (Server $c) { |
|
1303 | + $this->registerService(Installer::class, function(Server $c) { |
|
1304 | 1304 | return new Installer( |
1305 | 1305 | $c->getAppFetcher(), |
1306 | 1306 | $c->getHTTPClientService(), |
@@ -1311,11 +1311,11 @@ discard block |
||
1311 | 1311 | ); |
1312 | 1312 | }); |
1313 | 1313 | |
1314 | - $this->registerService(IApiFactory::class, function (Server $c) { |
|
1314 | + $this->registerService(IApiFactory::class, function(Server $c) { |
|
1315 | 1315 | return new ApiFactory($c->getHTTPClientService()); |
1316 | 1316 | }); |
1317 | 1317 | |
1318 | - $this->registerService(IInstanceFactory::class, function (Server $c) { |
|
1318 | + $this->registerService(IInstanceFactory::class, function(Server $c) { |
|
1319 | 1319 | $memcacheFactory = $c->getMemCacheFactory(); |
1320 | 1320 | return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->getHTTPClientService()); |
1321 | 1321 | }); |
@@ -1372,7 +1372,7 @@ discard block |
||
1372 | 1372 | $dispatcher = $this->getEventDispatcher(); |
1373 | 1373 | |
1374 | 1374 | // Delete avatar on user deletion |
1375 | - $dispatcher->addListener('OCP\IUser::preDelete', function (GenericEvent $e) { |
|
1375 | + $dispatcher->addListener('OCP\IUser::preDelete', function(GenericEvent $e) { |
|
1376 | 1376 | $logger = $this->getLogger(); |
1377 | 1377 | $manager = $this->getAvatarManager(); |
1378 | 1378 | /** @var IUser $user */ |
@@ -1385,11 +1385,11 @@ discard block |
||
1385 | 1385 | // no avatar to remove |
1386 | 1386 | } catch (\Exception $e) { |
1387 | 1387 | // Ignore exceptions |
1388 | - $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
1388 | + $logger->info('Could not cleanup avatar of '.$user->getUID()); |
|
1389 | 1389 | } |
1390 | 1390 | }); |
1391 | 1391 | |
1392 | - $dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) { |
|
1392 | + $dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) { |
|
1393 | 1393 | $manager = $this->getAvatarManager(); |
1394 | 1394 | /** @var IUser $user */ |
1395 | 1395 | $user = $e->getSubject(); |
@@ -2294,11 +2294,11 @@ discard block |
||
2294 | 2294 | } |
2295 | 2295 | |
2296 | 2296 | private function registerDeprecatedAlias(string $alias, string $target) { |
2297 | - $this->registerService($alias, function (ContainerInterface $container) use ($target, $alias) { |
|
2297 | + $this->registerService($alias, function(ContainerInterface $container) use ($target, $alias) { |
|
2298 | 2298 | try { |
2299 | 2299 | /** @var ILogger $logger */ |
2300 | 2300 | $logger = $container->get(ILogger::class); |
2301 | - $logger->debug('The requested alias "' . $alias . '" is depreacted. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); |
|
2301 | + $logger->debug('The requested alias "'.$alias.'" is depreacted. Please request "'.$target.'" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); |
|
2302 | 2302 | } catch (ContainerExceptionInterface $e) { |
2303 | 2303 | // Could not get logger. Continue |
2304 | 2304 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | private static function initLocalStorageRootFS() { |
88 | 88 | // mount local file backend as root |
89 | - $configDataDirectory = \OC::$server->getSystemConfig()->getValue("datadirectory", OC::$SERVERROOT . "/data"); |
|
89 | + $configDataDirectory = \OC::$server->getSystemConfig()->getValue("datadirectory", OC::$SERVERROOT."/data"); |
|
90 | 90 | //first set up the local "root" storage |
91 | 91 | \OC\Files\Filesystem::initMountManager(); |
92 | 92 | if (!self::$rootMounted) { |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | \OC\Files\Filesystem::initMountManager(); |
209 | 209 | |
210 | 210 | $prevLogging = \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false); |
211 | - \OC\Files\Filesystem::addStorageWrapper('mount_options', function ($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
211 | + \OC\Files\Filesystem::addStorageWrapper('mount_options', function($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
212 | 212 | if ($storage->instanceOfStorage('\OC\Files\Storage\Common')) { |
213 | 213 | /** @var \OC\Files\Storage\Common $storage */ |
214 | 214 | $storage->setMountOptions($mount->getOptions()); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | return $storage; |
217 | 217 | }); |
218 | 218 | |
219 | - \OC\Files\Filesystem::addStorageWrapper('enable_sharing', function ($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
219 | + \OC\Files\Filesystem::addStorageWrapper('enable_sharing', function($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
220 | 220 | if (!$mount->getOption('enable_sharing', true)) { |
221 | 221 | return new \OC\Files\Storage\Wrapper\PermissionsMask([ |
222 | 222 | 'storage' => $storage, |
@@ -227,21 +227,21 @@ discard block |
||
227 | 227 | }); |
228 | 228 | |
229 | 229 | // install storage availability wrapper, before most other wrappers |
230 | - \OC\Files\Filesystem::addStorageWrapper('oc_availability', function ($mountPoint, \OCP\Files\Storage\IStorage $storage) { |
|
230 | + \OC\Files\Filesystem::addStorageWrapper('oc_availability', function($mountPoint, \OCP\Files\Storage\IStorage $storage) { |
|
231 | 231 | if (!$storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage') && !$storage->isLocal()) { |
232 | 232 | return new \OC\Files\Storage\Wrapper\Availability(['storage' => $storage]); |
233 | 233 | } |
234 | 234 | return $storage; |
235 | 235 | }); |
236 | 236 | |
237 | - \OC\Files\Filesystem::addStorageWrapper('oc_encoding', function ($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
237 | + \OC\Files\Filesystem::addStorageWrapper('oc_encoding', function($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
238 | 238 | if ($mount->getOption('encoding_compatibility', false) && !$storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage') && !$storage->isLocal()) { |
239 | 239 | return new \OC\Files\Storage\Wrapper\Encoding(['storage' => $storage]); |
240 | 240 | } |
241 | 241 | return $storage; |
242 | 242 | }); |
243 | 243 | |
244 | - \OC\Files\Filesystem::addStorageWrapper('oc_quota', function ($mountPoint, $storage) { |
|
244 | + \OC\Files\Filesystem::addStorageWrapper('oc_quota', function($mountPoint, $storage) { |
|
245 | 245 | // set up quota for home storages, even for other users |
246 | 246 | // which can happen when using sharing |
247 | 247 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | return $storage; |
264 | 264 | }); |
265 | 265 | |
266 | - \OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
266 | + \OC\Files\Filesystem::addStorageWrapper('readonly', function($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
267 | 267 | /* |
268 | 268 | * Do not allow any operations that modify the storage |
269 | 269 | */ |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | |
316 | 316 | //if we aren't logged in, there is no use to set up the filesystem |
317 | 317 | if ($user != "") { |
318 | - $userDir = '/' . $user . '/files'; |
|
318 | + $userDir = '/'.$user.'/files'; |
|
319 | 319 | |
320 | 320 | //jail the user into his "home" directory |
321 | 321 | \OC\Files\Filesystem::init($user, $userDir); |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | * @suppress PhanDeprecatedFunction |
411 | 411 | */ |
412 | 412 | public static function copySkeleton($userId, \OCP\Files\Folder $userDirectory) { |
413 | - $plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton'); |
|
413 | + $plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT.'/core/skeleton'); |
|
414 | 414 | $userLang = \OC::$server->getL10NFactory()->findLanguage(); |
415 | 415 | $skeletonDirectory = str_replace('{lang}', $userLang, $plainSkeletonDirectory); |
416 | 416 | |
@@ -432,9 +432,9 @@ discard block |
||
432 | 432 | if ($instanceId === null) { |
433 | 433 | throw new \RuntimeException('no instance id!'); |
434 | 434 | } |
435 | - $appdata = 'appdata_' . $instanceId; |
|
435 | + $appdata = 'appdata_'.$instanceId; |
|
436 | 436 | if ($userId === $appdata) { |
437 | - throw new \RuntimeException('username is reserved name: ' . $appdata); |
|
437 | + throw new \RuntimeException('username is reserved name: '.$appdata); |
|
438 | 438 | } |
439 | 439 | |
440 | 440 | if (!empty($skeletonDirectory)) { |
@@ -469,14 +469,14 @@ discard block |
||
469 | 469 | // Copy the files |
470 | 470 | while (false !== ($file = readdir($dir))) { |
471 | 471 | if (!\OC\Files\Filesystem::isIgnoredDir($file)) { |
472 | - if (is_dir($source . '/' . $file)) { |
|
472 | + if (is_dir($source.'/'.$file)) { |
|
473 | 473 | $child = $target->newFolder($file); |
474 | - self::copyr($source . '/' . $file, $child); |
|
474 | + self::copyr($source.'/'.$file, $child); |
|
475 | 475 | } else { |
476 | 476 | $child = $target->newFile($file); |
477 | - $sourceStream = fopen($source . '/' . $file, 'r'); |
|
477 | + $sourceStream = fopen($source.'/'.$file, 'r'); |
|
478 | 478 | if ($sourceStream === false) { |
479 | - $logger->error(sprintf('Could not fopen "%s"', $source . '/' . $file), ['app' => 'core']); |
|
479 | + $logger->error(sprintf('Could not fopen "%s"', $source.'/'.$file), ['app' => 'core']); |
|
480 | 480 | closedir($dir); |
481 | 481 | return; |
482 | 482 | } |
@@ -553,8 +553,8 @@ discard block |
||
553 | 553 | return; |
554 | 554 | } |
555 | 555 | |
556 | - $timestamp = filemtime(OC::$SERVERROOT . '/version.php'); |
|
557 | - require OC::$SERVERROOT . '/version.php'; |
|
556 | + $timestamp = filemtime(OC::$SERVERROOT.'/version.php'); |
|
557 | + require OC::$SERVERROOT.'/version.php'; |
|
558 | 558 | /** @var int $timestamp */ |
559 | 559 | self::$versionCache['OC_Version_Timestamp'] = $timestamp; |
560 | 560 | /** @var string $OC_Version */ |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | public static function checkServer(\OC\SystemConfig $config) { |
725 | 725 | $l = \OC::$server->getL10N('lib'); |
726 | 726 | $errors = []; |
727 | - $CONFIG_DATADIRECTORY = $config->getValue('datadirectory', OC::$SERVERROOT . '/data'); |
|
727 | + $CONFIG_DATADIRECTORY = $config->getValue('datadirectory', OC::$SERVERROOT.'/data'); |
|
728 | 728 | |
729 | 729 | if (!self::needUpgrade($config) && $config->getValue('installed', false)) { |
730 | 730 | // this check needs to be done every time |
@@ -764,9 +764,9 @@ discard block |
||
764 | 764 | $errors[] = [ |
765 | 765 | 'error' => $l->t('Cannot write into "config" directory'), |
766 | 766 | 'hint' => $l->t('This can usually be fixed by giving the webserver write access to the config directory. See %s', |
767 | - [ $urlGenerator->linkToDocs('admin-dir_permissions') ]) . '. ' |
|
767 | + [$urlGenerator->linkToDocs('admin-dir_permissions')]).'. ' |
|
768 | 768 | . $l->t('Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it. See %s', |
769 | - [ $urlGenerator->linkToDocs('admin-config') ]) |
|
769 | + [$urlGenerator->linkToDocs('admin-config')]) |
|
770 | 770 | ]; |
771 | 771 | } |
772 | 772 | } |
@@ -935,13 +935,13 @@ discard block |
||
935 | 935 | if (function_exists('xml_parser_create') && |
936 | 936 | LIBXML_LOADED_VERSION < 20700) { |
937 | 937 | $version = LIBXML_LOADED_VERSION; |
938 | - $major = floor($version/10000); |
|
938 | + $major = floor($version / 10000); |
|
939 | 939 | $version -= ($major * 10000); |
940 | - $minor = floor($version/100); |
|
940 | + $minor = floor($version / 100); |
|
941 | 941 | $version -= ($minor * 100); |
942 | 942 | $patch = $version; |
943 | 943 | $errors[] = [ |
944 | - 'error' => $l->t('libxml2 2.7.0 is at least required. Currently %s is installed.', [$major . '.' . $minor . '.' . $patch]), |
|
944 | + 'error' => $l->t('libxml2 2.7.0 is at least required. Currently %s is installed.', [$major.'.'.$minor.'.'.$patch]), |
|
945 | 945 | 'hint' => $l->t('To fix this issue update your libxml2 version and restart your web server.') |
946 | 946 | ]; |
947 | 947 | } |
@@ -1043,10 +1043,10 @@ discard block |
||
1043 | 1043 | 'hint' => $l->t('Check the value of "datadirectory" in your configuration') |
1044 | 1044 | ]; |
1045 | 1045 | } |
1046 | - if (!file_exists($dataDirectory . '/.ocdata')) { |
|
1046 | + if (!file_exists($dataDirectory.'/.ocdata')) { |
|
1047 | 1047 | $errors[] = [ |
1048 | 1048 | 'error' => $l->t('Your data directory is invalid'), |
1049 | - 'hint' => $l->t('Ensure there is a file called ".ocdata"' . |
|
1049 | + 'hint' => $l->t('Ensure there is a file called ".ocdata"'. |
|
1050 | 1050 | ' in the root of the data directory.') |
1051 | 1051 | ]; |
1052 | 1052 | } |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | public static function checkLoggedIn() { |
1063 | 1063 | // Check if we are a user |
1064 | 1064 | if (!\OC::$server->getUserSession()->isLoggedIn()) { |
1065 | - header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute( |
|
1065 | + header('Location: '.\OC::$server->getURLGenerator()->linkToRoute( |
|
1066 | 1066 | 'core.login.showLoginForm', |
1067 | 1067 | [ |
1068 | 1068 | 'redirect_url' => \OC::$server->getRequest()->getRequestUri(), |
@@ -1073,7 +1073,7 @@ discard block |
||
1073 | 1073 | } |
1074 | 1074 | // Redirect to 2FA challenge selection if 2FA challenge was not solved yet |
1075 | 1075 | if (\OC::$server->getTwoFactorAuthManager()->needsSecondFactor(\OC::$server->getUserSession()->getUser())) { |
1076 | - header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge')); |
|
1076 | + header('Location: '.\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge')); |
|
1077 | 1077 | exit(); |
1078 | 1078 | } |
1079 | 1079 | } |
@@ -1086,7 +1086,7 @@ discard block |
||
1086 | 1086 | public static function checkAdminUser() { |
1087 | 1087 | OC_Util::checkLoggedIn(); |
1088 | 1088 | if (!OC_User::isAdminUser(OC_User::getUser())) { |
1089 | - header('Location: ' . \OCP\Util::linkToAbsolute('', 'index.php')); |
|
1089 | + header('Location: '.\OCP\Util::linkToAbsolute('', 'index.php')); |
|
1090 | 1090 | exit(); |
1091 | 1091 | } |
1092 | 1092 | } |
@@ -1133,9 +1133,9 @@ discard block |
||
1133 | 1133 | } |
1134 | 1134 | |
1135 | 1135 | if ($config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true') { |
1136 | - $location = $urlGenerator->getAbsoluteURL('/apps/' . $appId . '/'); |
|
1136 | + $location = $urlGenerator->getAbsoluteURL('/apps/'.$appId.'/'); |
|
1137 | 1137 | } else { |
1138 | - $location = $urlGenerator->getAbsoluteURL('/index.php/apps/' . $appId . '/'); |
|
1138 | + $location = $urlGenerator->getAbsoluteURL('/index.php/apps/'.$appId.'/'); |
|
1139 | 1139 | } |
1140 | 1140 | } |
1141 | 1141 | } |
@@ -1149,7 +1149,7 @@ discard block |
||
1149 | 1149 | */ |
1150 | 1150 | public static function redirectToDefaultPage() { |
1151 | 1151 | $location = self::getDefaultPageUrl(); |
1152 | - header('Location: ' . $location); |
|
1152 | + header('Location: '.$location); |
|
1153 | 1153 | exit(); |
1154 | 1154 | } |
1155 | 1155 | |
@@ -1162,7 +1162,7 @@ discard block |
||
1162 | 1162 | $id = \OC::$server->getSystemConfig()->getValue('instanceid', null); |
1163 | 1163 | if (is_null($id)) { |
1164 | 1164 | // We need to guarantee at least one letter in instanceid so it can be used as the session_name |
1165 | - $id = 'oc' . \OC::$server->getSecureRandom()->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS); |
|
1165 | + $id = 'oc'.\OC::$server->getSecureRandom()->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS); |
|
1166 | 1166 | \OC::$server->getSystemConfig()->setValue('instanceid', $id); |
1167 | 1167 | } |
1168 | 1168 | return $id; |
@@ -1179,12 +1179,12 @@ discard block |
||
1179 | 1179 | */ |
1180 | 1180 | public static function sanitizeHTML($value) { |
1181 | 1181 | if (is_array($value)) { |
1182 | - $value = array_map(function ($value) { |
|
1182 | + $value = array_map(function($value) { |
|
1183 | 1183 | return self::sanitizeHTML($value); |
1184 | 1184 | }, $value); |
1185 | 1185 | } else { |
1186 | 1186 | // Specify encoding for PHP<5.4 |
1187 | - $value = htmlspecialchars((string)$value, ENT_QUOTES, 'UTF-8'); |
|
1187 | + $value = htmlspecialchars((string) $value, ENT_QUOTES, 'UTF-8'); |
|
1188 | 1188 | } |
1189 | 1189 | return $value; |
1190 | 1190 | } |
@@ -1217,7 +1217,7 @@ discard block |
||
1217 | 1217 | $testContent = 'This is used for testing whether htaccess is properly enabled to disallow access from the outside. This file can be safely removed.'; |
1218 | 1218 | |
1219 | 1219 | // creating a test file |
1220 | - $testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName; |
|
1220 | + $testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT.'/data').'/'.$fileName; |
|
1221 | 1221 | |
1222 | 1222 | if (file_exists($testFile)) {// already running this test, possible recursive call |
1223 | 1223 | return false; |
@@ -1226,7 +1226,7 @@ discard block |
||
1226 | 1226 | $fp = @fopen($testFile, 'w'); |
1227 | 1227 | if (!$fp) { |
1228 | 1228 | throw new OC\HintException('Can\'t create test file to check for working .htaccess file.', |
1229 | - 'Make sure it is possible for the webserver to write to ' . $testFile); |
|
1229 | + 'Make sure it is possible for the webserver to write to '.$testFile); |
|
1230 | 1230 | } |
1231 | 1231 | fwrite($fp, $testContent); |
1232 | 1232 | fclose($fp); |
@@ -1252,10 +1252,10 @@ discard block |
||
1252 | 1252 | } |
1253 | 1253 | |
1254 | 1254 | $fileName = '/htaccesstest.txt'; |
1255 | - $testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName; |
|
1255 | + $testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT.'/data').'/'.$fileName; |
|
1256 | 1256 | |
1257 | 1257 | // accessing the file via http |
1258 | - $url = \OC::$server->getURLGenerator()->getAbsoluteURL(OC::$WEBROOT . '/data' . $fileName); |
|
1258 | + $url = \OC::$server->getURLGenerator()->getAbsoluteURL(OC::$WEBROOT.'/data'.$fileName); |
|
1259 | 1259 | try { |
1260 | 1260 | $content = \OC::$server->getHTTPClientService()->newClient()->get($url)->getBody(); |
1261 | 1261 | } catch (\Exception $e) { |
@@ -1263,9 +1263,9 @@ discard block |
||
1263 | 1263 | } |
1264 | 1264 | |
1265 | 1265 | if (strpos($url, 'https:') === 0) { |
1266 | - $url = 'http:' . substr($url, 6); |
|
1266 | + $url = 'http:'.substr($url, 6); |
|
1267 | 1267 | } else { |
1268 | - $url = 'https:' . substr($url, 5); |
|
1268 | + $url = 'https:'.substr($url, 5); |
|
1269 | 1269 | } |
1270 | 1270 | |
1271 | 1271 | try { |
@@ -1349,7 +1349,7 @@ discard block |
||
1349 | 1349 | $theme = \OC::$server->getSystemConfig()->getValue("theme", ''); |
1350 | 1350 | |
1351 | 1351 | if ($theme === '') { |
1352 | - if (is_dir(OC::$SERVERROOT . '/themes/default')) { |
|
1352 | + if (is_dir(OC::$SERVERROOT.'/themes/default')) { |
|
1353 | 1353 | $theme = 'default'; |
1354 | 1354 | } |
1355 | 1355 | } |
@@ -1370,7 +1370,7 @@ discard block |
||
1370 | 1370 | |
1371 | 1371 | $normalizedValue = Normalizer::normalize($value); |
1372 | 1372 | if ($normalizedValue === null || $normalizedValue === false) { |
1373 | - \OC::$server->getLogger()->warning('normalizing failed for "' . $value . '"', ['app' => 'core']); |
|
1373 | + \OC::$server->getLogger()->warning('normalizing failed for "'.$value.'"', ['app' => 'core']); |
|
1374 | 1374 | return $value; |
1375 | 1375 | } |
1376 | 1376 | |
@@ -1386,7 +1386,7 @@ discard block |
||
1386 | 1386 | $version = OC_Util::getVersionString(); |
1387 | 1387 | $build = OC_Util::getBuild(); |
1388 | 1388 | if (!empty($build) and OC_Util::getChannel() === 'daily') { |
1389 | - $version .= ' Build:' . $build; |
|
1389 | + $version .= ' Build:'.$build; |
|
1390 | 1390 | } |
1391 | 1391 | return $version; |
1392 | 1392 | } |
@@ -1408,7 +1408,7 @@ discard block |
||
1408 | 1408 | } |
1409 | 1409 | |
1410 | 1410 | // detect part files |
1411 | - if (preg_match('/' . \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX . '/', $trimmed) !== 0) { |
|
1411 | + if (preg_match('/'.\OCP\Files\FileInfo::BLACKLIST_FILES_REGEX.'/', $trimmed) !== 0) { |
|
1412 | 1412 | return false; |
1413 | 1413 | } |
1414 | 1414 | |
@@ -1439,19 +1439,19 @@ discard block |
||
1439 | 1439 | } elseif ($config->getValue('debug', false) && $versionDiff < 0) { |
1440 | 1440 | // downgrade with debug |
1441 | 1441 | $installedMajor = explode('.', $installedVersion); |
1442 | - $installedMajor = $installedMajor[0] . '.' . $installedMajor[1]; |
|
1442 | + $installedMajor = $installedMajor[0].'.'.$installedMajor[1]; |
|
1443 | 1443 | $currentMajor = explode('.', $currentVersion); |
1444 | - $currentMajor = $currentMajor[0] . '.' . $currentMajor[1]; |
|
1444 | + $currentMajor = $currentMajor[0].'.'.$currentMajor[1]; |
|
1445 | 1445 | if ($installedMajor === $currentMajor) { |
1446 | 1446 | // Same major, allow downgrade for developers |
1447 | 1447 | return true; |
1448 | 1448 | } else { |
1449 | 1449 | // downgrade attempt, throw exception |
1450 | - throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')'); |
|
1450 | + throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from '.$installedVersion.' to '.$currentVersion.')'); |
|
1451 | 1451 | } |
1452 | 1452 | } elseif ($versionDiff < 0) { |
1453 | 1453 | // downgrade attempt, throw exception |
1454 | - throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')'); |
|
1454 | + throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from '.$installedVersion.' to '.$currentVersion.')'); |
|
1455 | 1455 | } |
1456 | 1456 | |
1457 | 1457 | // also check for upgrades for apps (independently from the user) |