| Conditions | 35 |
| Paths | 1 |
| Total Lines | 1180 |
| Code Lines | 753 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 294 | public function __construct($webRoot, \OC\Config $config) { |
||
| 295 | parent::__construct(); |
||
| 296 | $this->webRoot = $webRoot; |
||
| 297 | |||
| 298 | // To find out if we are running from CLI or not |
||
| 299 | $this->registerParameter('isCLI', \OC::$CLI); |
||
| 300 | $this->registerParameter('serverRoot', \OC::$SERVERROOT); |
||
| 301 | |||
| 302 | $this->registerService(ContainerInterface::class, function (ContainerInterface $c) { |
||
| 303 | return $c; |
||
| 304 | }); |
||
| 305 | $this->registerService(\OCP\IServerContainer::class, function (ContainerInterface $c) { |
||
| 306 | return $c; |
||
| 307 | }); |
||
| 308 | |||
| 309 | $this->registerAlias(\OCP\Calendar\IManager::class, \OC\Calendar\Manager::class); |
||
| 310 | /** @deprecated 19.0.0 */ |
||
| 311 | $this->registerDeprecatedAlias('CalendarManager', \OC\Calendar\Manager::class); |
||
| 312 | |||
| 313 | $this->registerAlias(\OCP\Calendar\Resource\IManager::class, \OC\Calendar\Resource\Manager::class); |
||
| 314 | /** @deprecated 19.0.0 */ |
||
| 315 | $this->registerDeprecatedAlias('CalendarResourceBackendManager', \OC\Calendar\Resource\Manager::class); |
||
| 316 | |||
| 317 | $this->registerAlias(\OCP\Calendar\Room\IManager::class, \OC\Calendar\Room\Manager::class); |
||
| 318 | /** @deprecated 19.0.0 */ |
||
| 319 | $this->registerDeprecatedAlias('CalendarRoomBackendManager', \OC\Calendar\Room\Manager::class); |
||
| 320 | |||
| 321 | $this->registerAlias(\OCP\Contacts\IManager::class, \OC\ContactsManager::class); |
||
| 322 | /** @deprecated 19.0.0 */ |
||
| 323 | $this->registerDeprecatedAlias('ContactsManager', \OCP\Contacts\IManager::class); |
||
| 324 | |||
| 325 | $this->registerAlias(\OCP\DirectEditing\IManager::class, \OC\DirectEditing\Manager::class); |
||
| 326 | $this->registerAlias(ITemplateManager::class, TemplateManager::class); |
||
| 327 | |||
| 328 | $this->registerAlias(IActionFactory::class, ActionFactory::class); |
||
| 329 | |||
| 330 | $this->registerService(View::class, function (Server $c) { |
||
| 331 | return new View(); |
||
| 332 | }, false); |
||
| 333 | |||
| 334 | $this->registerService(IPreview::class, function (ContainerInterface $c) { |
||
| 335 | return new PreviewManager( |
||
| 336 | $c->get(\OCP\IConfig::class), |
||
| 337 | $c->get(IRootFolder::class), |
||
| 338 | new \OC\Preview\Storage\Root( |
||
| 339 | $c->get(IRootFolder::class), |
||
| 340 | $c->get(SystemConfig::class) |
||
| 341 | ), |
||
| 342 | $c->get(IEventDispatcher::class), |
||
| 343 | $c->get(SymfonyAdapter::class), |
||
| 344 | $c->get(GeneratorHelper::class), |
||
| 345 | $c->get(ISession::class)->get('user_id'), |
||
| 346 | $c->get(Coordinator::class), |
||
| 347 | $c->get(IServerContainer::class), |
||
| 348 | $c->get(IBinaryFinder::class), |
||
| 349 | $c->get(IMagickSupport::class) |
||
| 350 | ); |
||
| 351 | }); |
||
| 352 | /** @deprecated 19.0.0 */ |
||
| 353 | $this->registerDeprecatedAlias('PreviewManager', IPreview::class); |
||
| 354 | |||
| 355 | $this->registerService(\OC\Preview\Watcher::class, function (ContainerInterface $c) { |
||
| 356 | return new \OC\Preview\Watcher( |
||
| 357 | new \OC\Preview\Storage\Root( |
||
| 358 | $c->get(IRootFolder::class), |
||
| 359 | $c->get(SystemConfig::class) |
||
| 360 | ) |
||
| 361 | ); |
||
| 362 | }); |
||
| 363 | |||
| 364 | $this->registerService(IProfiler::class, function (Server $c) { |
||
| 365 | return new Profiler($c->get(SystemConfig::class)); |
||
| 366 | }); |
||
| 367 | |||
| 368 | $this->registerService(\OCP\Encryption\IManager::class, function (Server $c): Encryption\Manager { |
||
| 369 | $view = new View(); |
||
| 370 | $util = new Encryption\Util( |
||
| 371 | $view, |
||
| 372 | $c->get(IUserManager::class), |
||
| 373 | $c->get(IGroupManager::class), |
||
| 374 | $c->get(\OCP\IConfig::class) |
||
| 375 | ); |
||
| 376 | return new Encryption\Manager( |
||
| 377 | $c->get(\OCP\IConfig::class), |
||
| 378 | $c->get(LoggerInterface::class), |
||
| 379 | $c->getL10N('core'), |
||
| 380 | new View(), |
||
| 381 | $util, |
||
| 382 | new ArrayCache() |
||
| 383 | ); |
||
| 384 | }); |
||
| 385 | /** @deprecated 19.0.0 */ |
||
| 386 | $this->registerDeprecatedAlias('EncryptionManager', \OCP\Encryption\IManager::class); |
||
| 387 | |||
| 388 | /** @deprecated 21.0.0 */ |
||
| 389 | $this->registerDeprecatedAlias('EncryptionFileHelper', IFile::class); |
||
| 390 | $this->registerService(IFile::class, function (ContainerInterface $c) { |
||
| 391 | $util = new Encryption\Util( |
||
| 392 | new View(), |
||
| 393 | $c->get(IUserManager::class), |
||
| 394 | $c->get(IGroupManager::class), |
||
| 395 | $c->get(\OCP\IConfig::class) |
||
| 396 | ); |
||
| 397 | return new Encryption\File( |
||
| 398 | $util, |
||
| 399 | $c->get(IRootFolder::class), |
||
| 400 | $c->get(\OCP\Share\IManager::class) |
||
| 401 | ); |
||
| 402 | }); |
||
| 403 | |||
| 404 | /** @deprecated 21.0.0 */ |
||
| 405 | $this->registerDeprecatedAlias('EncryptionKeyStorage', IStorage::class); |
||
| 406 | $this->registerService(IStorage::class, function (ContainerInterface $c) { |
||
| 407 | $view = new View(); |
||
| 408 | $util = new Encryption\Util( |
||
| 409 | $view, |
||
| 410 | $c->get(IUserManager::class), |
||
| 411 | $c->get(IGroupManager::class), |
||
| 412 | $c->get(\OCP\IConfig::class) |
||
| 413 | ); |
||
| 414 | |||
| 415 | return new Encryption\Keys\Storage( |
||
| 416 | $view, |
||
| 417 | $util, |
||
| 418 | $c->get(ICrypto::class), |
||
| 419 | $c->get(\OCP\IConfig::class) |
||
| 420 | ); |
||
| 421 | }); |
||
| 422 | /** @deprecated 20.0.0 */ |
||
| 423 | $this->registerDeprecatedAlias('TagMapper', TagMapper::class); |
||
| 424 | |||
| 425 | $this->registerAlias(\OCP\ITagManager::class, TagManager::class); |
||
| 426 | /** @deprecated 19.0.0 */ |
||
| 427 | $this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class); |
||
| 428 | |||
| 429 | $this->registerService('SystemTagManagerFactory', function (ContainerInterface $c) { |
||
| 430 | /** @var \OCP\IConfig $config */ |
||
| 431 | $config = $c->get(\OCP\IConfig::class); |
||
| 432 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
||
| 433 | return new $factoryClass($this); |
||
| 434 | }); |
||
| 435 | $this->registerService(ISystemTagManager::class, function (ContainerInterface $c) { |
||
| 436 | return $c->get('SystemTagManagerFactory')->getManager(); |
||
| 437 | }); |
||
| 438 | /** @deprecated 19.0.0 */ |
||
| 439 | $this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class); |
||
| 440 | |||
| 441 | $this->registerService(ISystemTagObjectMapper::class, function (ContainerInterface $c) { |
||
| 442 | return $c->get('SystemTagManagerFactory')->getObjectMapper(); |
||
| 443 | }); |
||
| 444 | $this->registerService('RootFolder', function (ContainerInterface $c) { |
||
| 445 | $manager = \OC\Files\Filesystem::getMountManager(); |
||
| 446 | $view = new View(); |
||
| 447 | $root = new Root( |
||
| 448 | $manager, |
||
| 449 | $view, |
||
| 450 | null, |
||
| 451 | $c->get(IUserMountCache::class), |
||
| 452 | $this->get(LoggerInterface::class), |
||
| 453 | $this->get(IUserManager::class), |
||
| 454 | $this->get(IEventDispatcher::class), |
||
| 455 | ); |
||
| 456 | |||
| 457 | $previewConnector = new \OC\Preview\WatcherConnector( |
||
| 458 | $root, |
||
| 459 | $c->get(SystemConfig::class) |
||
| 460 | ); |
||
| 461 | $previewConnector->connectWatcher(); |
||
| 462 | |||
| 463 | return $root; |
||
| 464 | }); |
||
| 465 | $this->registerService(HookConnector::class, function (ContainerInterface $c) { |
||
| 466 | return new HookConnector( |
||
| 467 | $c->get(IRootFolder::class), |
||
| 468 | new View(), |
||
| 469 | $c->get(\OC\EventDispatcher\SymfonyAdapter::class), |
||
| 470 | $c->get(IEventDispatcher::class) |
||
| 471 | ); |
||
| 472 | }); |
||
| 473 | |||
| 474 | /** @deprecated 19.0.0 */ |
||
| 475 | $this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class); |
||
| 476 | |||
| 477 | $this->registerService(IRootFolder::class, function (ContainerInterface $c) { |
||
| 478 | return new LazyRoot(function () use ($c) { |
||
| 479 | return $c->get('RootFolder'); |
||
| 480 | }); |
||
| 481 | }); |
||
| 482 | /** @deprecated 19.0.0 */ |
||
| 483 | $this->registerDeprecatedAlias('LazyRootFolder', IRootFolder::class); |
||
| 484 | |||
| 485 | /** @deprecated 19.0.0 */ |
||
| 486 | $this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class); |
||
| 487 | $this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
||
| 488 | |||
| 489 | $this->registerService(DisplayNameCache::class, function (ContainerInterface $c) { |
||
| 490 | return $c->get(\OC\User\Manager::class)->getDisplayNameCache(); |
||
| 491 | }); |
||
| 492 | |||
| 493 | $this->registerService(\OCP\IGroupManager::class, function (ContainerInterface $c) { |
||
| 494 | $groupManager = new \OC\Group\Manager( |
||
| 495 | $this->get(IUserManager::class), |
||
| 496 | $c->get(SymfonyAdapter::class), |
||
| 497 | $this->get(LoggerInterface::class), |
||
| 498 | $this->get(ICacheFactory::class) |
||
| 499 | ); |
||
| 500 | $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
||
| 501 | /** @var IEventDispatcher $dispatcher */ |
||
| 502 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 503 | $dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid)); |
||
| 504 | }); |
||
| 505 | $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) { |
||
| 506 | /** @var IEventDispatcher $dispatcher */ |
||
| 507 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 508 | $dispatcher->dispatchTyped(new GroupCreatedEvent($group)); |
||
| 509 | }); |
||
| 510 | $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
||
| 511 | /** @var IEventDispatcher $dispatcher */ |
||
| 512 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 513 | $dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group)); |
||
| 514 | }); |
||
| 515 | $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
||
| 516 | /** @var IEventDispatcher $dispatcher */ |
||
| 517 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 518 | $dispatcher->dispatchTyped(new GroupDeletedEvent($group)); |
||
| 519 | }); |
||
| 520 | $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
||
| 521 | /** @var IEventDispatcher $dispatcher */ |
||
| 522 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 523 | $dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user)); |
||
| 524 | }); |
||
| 525 | $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
||
| 526 | /** @var IEventDispatcher $dispatcher */ |
||
| 527 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 528 | $dispatcher->dispatchTyped(new UserAddedEvent($group, $user)); |
||
| 529 | }); |
||
| 530 | $groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
||
| 531 | /** @var IEventDispatcher $dispatcher */ |
||
| 532 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 533 | $dispatcher->dispatchTyped(new BeforeUserRemovedEvent($group, $user)); |
||
| 534 | }); |
||
| 535 | $groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
||
| 536 | /** @var IEventDispatcher $dispatcher */ |
||
| 537 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 538 | $dispatcher->dispatchTyped(new UserRemovedEvent($group, $user)); |
||
| 539 | }); |
||
| 540 | return $groupManager; |
||
| 541 | }); |
||
| 542 | /** @deprecated 19.0.0 */ |
||
| 543 | $this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class); |
||
| 544 | |||
| 545 | $this->registerService(Store::class, function (ContainerInterface $c) { |
||
| 546 | $session = $c->get(ISession::class); |
||
| 547 | if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) { |
||
| 548 | $tokenProvider = $c->get(IProvider::class); |
||
| 549 | } else { |
||
| 550 | $tokenProvider = null; |
||
| 551 | } |
||
| 552 | $logger = $c->get(LoggerInterface::class); |
||
| 553 | return new Store($session, $logger, $tokenProvider); |
||
| 554 | }); |
||
| 555 | $this->registerAlias(IStore::class, Store::class); |
||
| 556 | $this->registerAlias(IProvider::class, Authentication\Token\Manager::class); |
||
| 557 | $this->registerAlias(OCPIProvider::class, Authentication\Token\Manager::class); |
||
| 558 | |||
| 559 | $this->registerService(\OC\User\Session::class, function (Server $c) { |
||
| 560 | $manager = $c->get(IUserManager::class); |
||
| 561 | $session = new \OC\Session\Memory(''); |
||
| 562 | $timeFactory = new TimeFactory(); |
||
| 563 | // Token providers might require a working database. This code |
||
| 564 | // might however be called when Nextcloud is not yet setup. |
||
| 565 | if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) { |
||
| 566 | $provider = $c->get(IProvider::class); |
||
| 567 | } else { |
||
| 568 | $provider = null; |
||
| 569 | } |
||
| 570 | |||
| 571 | $legacyDispatcher = $c->get(SymfonyAdapter::class); |
||
| 572 | |||
| 573 | $userSession = new \OC\User\Session( |
||
| 574 | $manager, |
||
| 575 | $session, |
||
| 576 | $timeFactory, |
||
| 577 | $provider, |
||
| 578 | $c->get(\OCP\IConfig::class), |
||
| 579 | $c->get(ISecureRandom::class), |
||
| 580 | $c->getLockdownManager(), |
||
| 581 | $c->get(LoggerInterface::class), |
||
| 582 | $c->get(IEventDispatcher::class) |
||
| 583 | ); |
||
| 584 | /** @deprecated 21.0.0 use BeforeUserCreatedEvent event with the IEventDispatcher instead */ |
||
| 585 | $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
||
| 586 | \OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]); |
||
| 587 | }); |
||
| 588 | /** @deprecated 21.0.0 use UserCreatedEvent event with the IEventDispatcher instead */ |
||
| 589 | $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
||
| 590 | /** @var \OC\User\User $user */ |
||
| 591 | \OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]); |
||
| 592 | }); |
||
| 593 | /** @deprecated 21.0.0 use BeforeUserDeletedEvent event with the IEventDispatcher instead */ |
||
| 594 | $userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) { |
||
| 595 | /** @var \OC\User\User $user */ |
||
| 596 | \OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]); |
||
| 597 | $legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
||
| 598 | }); |
||
| 599 | /** @deprecated 21.0.0 use UserDeletedEvent event with the IEventDispatcher instead */ |
||
| 600 | $userSession->listen('\OC\User', 'postDelete', function ($user) { |
||
| 601 | /** @var \OC\User\User $user */ |
||
| 602 | \OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]); |
||
| 603 | }); |
||
| 604 | $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
||
| 605 | /** @var \OC\User\User $user */ |
||
| 606 | \OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]); |
||
| 607 | |||
| 608 | /** @var IEventDispatcher $dispatcher */ |
||
| 609 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 610 | $dispatcher->dispatchTyped(new BeforePasswordUpdatedEvent($user, $password, $recoveryPassword)); |
||
| 611 | }); |
||
| 612 | $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
||
| 613 | /** @var \OC\User\User $user */ |
||
| 614 | \OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]); |
||
| 615 | |||
| 616 | /** @var IEventDispatcher $dispatcher */ |
||
| 617 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 618 | $dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword)); |
||
| 619 | }); |
||
| 620 | $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
||
| 621 | \OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]); |
||
| 622 | |||
| 623 | /** @var IEventDispatcher $dispatcher */ |
||
| 624 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 625 | $dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password)); |
||
| 626 | }); |
||
| 627 | $userSession->listen('\OC\User', 'postLogin', function ($user, $loginName, $password, $isTokenLogin) { |
||
| 628 | /** @var \OC\User\User $user */ |
||
| 629 | \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'loginName' => $loginName, 'password' => $password, 'isTokenLogin' => $isTokenLogin]); |
||
| 630 | |||
| 631 | /** @var IEventDispatcher $dispatcher */ |
||
| 632 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 633 | $dispatcher->dispatchTyped(new UserLoggedInEvent($user, $loginName, $password, $isTokenLogin)); |
||
| 634 | }); |
||
| 635 | $userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) { |
||
| 636 | /** @var IEventDispatcher $dispatcher */ |
||
| 637 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 638 | $dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid)); |
||
| 639 | }); |
||
| 640 | $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
||
| 641 | /** @var \OC\User\User $user */ |
||
| 642 | \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]); |
||
| 643 | |||
| 644 | /** @var IEventDispatcher $dispatcher */ |
||
| 645 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 646 | $dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password)); |
||
| 647 | }); |
||
| 648 | $userSession->listen('\OC\User', 'logout', function ($user) { |
||
| 649 | \OC_Hook::emit('OC_User', 'logout', []); |
||
| 650 | |||
| 651 | /** @var IEventDispatcher $dispatcher */ |
||
| 652 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 653 | $dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user)); |
||
| 654 | }); |
||
| 655 | $userSession->listen('\OC\User', 'postLogout', function ($user) { |
||
| 656 | /** @var IEventDispatcher $dispatcher */ |
||
| 657 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 658 | $dispatcher->dispatchTyped(new UserLoggedOutEvent($user)); |
||
| 659 | }); |
||
| 660 | $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
||
| 661 | /** @var \OC\User\User $user */ |
||
| 662 | \OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]); |
||
| 663 | |||
| 664 | /** @var IEventDispatcher $dispatcher */ |
||
| 665 | $dispatcher = $this->get(IEventDispatcher::class); |
||
| 666 | $dispatcher->dispatchTyped(new UserChangedEvent($user, $feature, $value, $oldValue)); |
||
| 667 | }); |
||
| 668 | return $userSession; |
||
| 669 | }); |
||
| 670 | $this->registerAlias(\OCP\IUserSession::class, \OC\User\Session::class); |
||
| 671 | /** @deprecated 19.0.0 */ |
||
| 672 | $this->registerDeprecatedAlias('UserSession', \OC\User\Session::class); |
||
| 673 | |||
| 674 | $this->registerAlias(\OCP\Authentication\TwoFactorAuth\IRegistry::class, \OC\Authentication\TwoFactorAuth\Registry::class); |
||
| 675 | |||
| 676 | $this->registerAlias(INavigationManager::class, \OC\NavigationManager::class); |
||
| 677 | /** @deprecated 19.0.0 */ |
||
| 678 | $this->registerDeprecatedAlias('NavigationManager', INavigationManager::class); |
||
| 679 | |||
| 680 | /** @deprecated 19.0.0 */ |
||
| 681 | $this->registerDeprecatedAlias('AllConfig', \OC\AllConfig::class); |
||
| 682 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
||
| 683 | |||
| 684 | $this->registerService(\OC\SystemConfig::class, function ($c) use ($config) { |
||
| 685 | return new \OC\SystemConfig($config); |
||
| 686 | }); |
||
| 687 | /** @deprecated 19.0.0 */ |
||
| 688 | $this->registerDeprecatedAlias('SystemConfig', \OC\SystemConfig::class); |
||
| 689 | |||
| 690 | /** @deprecated 19.0.0 */ |
||
| 691 | $this->registerDeprecatedAlias('AppConfig', \OC\AppConfig::class); |
||
| 692 | $this->registerAlias(IAppConfig::class, \OC\AppConfig::class); |
||
| 693 | |||
| 694 | $this->registerService(IFactory::class, function (Server $c) { |
||
| 695 | return new \OC\L10N\Factory( |
||
| 696 | $c->get(\OCP\IConfig::class), |
||
| 697 | $c->getRequest(), |
||
| 698 | $c->get(IUserSession::class), |
||
| 699 | $c->get(ICacheFactory::class), |
||
| 700 | \OC::$SERVERROOT |
||
| 701 | ); |
||
| 702 | }); |
||
| 703 | /** @deprecated 19.0.0 */ |
||
| 704 | $this->registerDeprecatedAlias('L10NFactory', IFactory::class); |
||
| 705 | |||
| 706 | $this->registerAlias(IURLGenerator::class, URLGenerator::class); |
||
| 707 | /** @deprecated 19.0.0 */ |
||
| 708 | $this->registerDeprecatedAlias('URLGenerator', IURLGenerator::class); |
||
| 709 | |||
| 710 | /** @deprecated 19.0.0 */ |
||
| 711 | $this->registerDeprecatedAlias('AppFetcher', AppFetcher::class); |
||
| 712 | /** @deprecated 19.0.0 */ |
||
| 713 | $this->registerDeprecatedAlias('CategoryFetcher', CategoryFetcher::class); |
||
| 714 | |||
| 715 | $this->registerService(ICache::class, function ($c) { |
||
| 716 | return new Cache\File(); |
||
| 717 | }); |
||
| 718 | /** @deprecated 19.0.0 */ |
||
| 719 | $this->registerDeprecatedAlias('UserCache', ICache::class); |
||
| 720 | |||
| 721 | $this->registerService(Factory::class, function (Server $c) { |
||
| 722 | $profiler = $c->get(IProfiler::class); |
||
| 723 | $arrayCacheFactory = new \OC\Memcache\Factory('', $c->get(LoggerInterface::class), |
||
| 724 | $profiler, |
||
| 725 | ArrayCache::class, |
||
| 726 | ArrayCache::class, |
||
| 727 | ArrayCache::class |
||
| 728 | ); |
||
| 729 | /** @var \OCP\IConfig $config */ |
||
| 730 | $config = $c->get(\OCP\IConfig::class); |
||
| 731 | |||
| 732 | if ($config->getSystemValueBool('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) { |
||
| 733 | if (!$config->getSystemValueBool('log_query')) { |
||
| 734 | try { |
||
| 735 | $v = \OC_App::getAppVersions(); |
||
| 736 | } catch (\Doctrine\DBAL\Exception $e) { |
||
| 737 | // Database service probably unavailable |
||
| 738 | // Probably related to https://github.com/nextcloud/server/issues/37424 |
||
| 739 | return $arrayCacheFactory; |
||
| 740 | } |
||
| 741 | } else { |
||
| 742 | // If the log_query is enabled, we can not get the app versions |
||
| 743 | // as that does a query, which will be logged and the logging |
||
| 744 | // depends on redis and here we are back again in the same function. |
||
| 745 | $v = [ |
||
| 746 | 'log_query' => 'enabled', |
||
| 747 | ]; |
||
| 748 | } |
||
| 749 | $v['core'] = implode(',', \OC_Util::getVersion()); |
||
| 750 | $version = implode(',', $v); |
||
| 751 | $instanceId = \OC_Util::getInstanceId(); |
||
| 752 | $path = \OC::$SERVERROOT; |
||
| 753 | $prefix = md5($instanceId . '-' . $version . '-' . $path); |
||
| 754 | return new \OC\Memcache\Factory($prefix, |
||
| 755 | $c->get(LoggerInterface::class), |
||
| 756 | $profiler, |
||
| 757 | $config->getSystemValue('memcache.local', null), |
||
| 758 | $config->getSystemValue('memcache.distributed', null), |
||
| 759 | $config->getSystemValue('memcache.locking', null), |
||
| 760 | $config->getSystemValueString('redis_log_file') |
||
| 761 | ); |
||
| 762 | } |
||
| 763 | return $arrayCacheFactory; |
||
| 764 | }); |
||
| 765 | /** @deprecated 19.0.0 */ |
||
| 766 | $this->registerDeprecatedAlias('MemCacheFactory', Factory::class); |
||
| 767 | $this->registerAlias(ICacheFactory::class, Factory::class); |
||
| 768 | |||
| 769 | $this->registerService('RedisFactory', function (Server $c) { |
||
| 770 | $systemConfig = $c->get(SystemConfig::class); |
||
| 771 | return new RedisFactory($systemConfig, $c->getEventLogger()); |
||
| 772 | }); |
||
| 773 | |||
| 774 | $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
||
| 775 | $l10n = $this->get(IFactory::class)->get('lib'); |
||
| 776 | return new \OC\Activity\Manager( |
||
| 777 | $c->getRequest(), |
||
| 778 | $c->get(IUserSession::class), |
||
| 779 | $c->get(\OCP\IConfig::class), |
||
| 780 | $c->get(IValidator::class), |
||
| 781 | $l10n |
||
| 782 | ); |
||
| 783 | }); |
||
| 784 | /** @deprecated 19.0.0 */ |
||
| 785 | $this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class); |
||
| 786 | |||
| 787 | $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
||
| 788 | return new \OC\Activity\EventMerger( |
||
| 789 | $c->getL10N('lib') |
||
| 790 | ); |
||
| 791 | }); |
||
| 792 | $this->registerAlias(IValidator::class, Validator::class); |
||
| 793 | |||
| 794 | $this->registerService(AvatarManager::class, function (Server $c) { |
||
| 795 | return new AvatarManager( |
||
| 796 | $c->get(IUserSession::class), |
||
| 797 | $c->get(\OC\User\Manager::class), |
||
| 798 | $c->getAppDataDir('avatar'), |
||
| 799 | $c->getL10N('lib'), |
||
| 800 | $c->get(LoggerInterface::class), |
||
| 801 | $c->get(\OCP\IConfig::class), |
||
| 802 | $c->get(IAccountManager::class), |
||
| 803 | $c->get(KnownUserService::class) |
||
| 804 | ); |
||
| 805 | }); |
||
| 806 | |||
| 807 | $this->registerAlias(IAvatarManager::class, AvatarManager::class); |
||
| 808 | /** @deprecated 19.0.0 */ |
||
| 809 | $this->registerDeprecatedAlias('AvatarManager', AvatarManager::class); |
||
| 810 | |||
| 811 | $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
||
| 812 | $this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class); |
||
| 813 | $this->registerAlias(\OCP\Support\Subscription\IAssertion::class, \OC\Support\Subscription\Assertion::class); |
||
| 814 | |||
| 815 | $this->registerService(\OC\Log::class, function (Server $c) { |
||
| 816 | $logType = $c->get(AllConfig::class)->getSystemValue('log_type', 'file'); |
||
| 817 | $factory = new LogFactory($c, $this->get(SystemConfig::class)); |
||
| 818 | $logger = $factory->get($logType); |
||
| 819 | $registry = $c->get(\OCP\Support\CrashReport\IRegistry::class); |
||
| 820 | |||
| 821 | return new Log($logger, $this->get(SystemConfig::class), null, $registry); |
||
| 822 | }); |
||
| 823 | $this->registerAlias(ILogger::class, \OC\Log::class); |
||
| 824 | /** @deprecated 19.0.0 */ |
||
| 825 | $this->registerDeprecatedAlias('Logger', \OC\Log::class); |
||
| 826 | // PSR-3 logger |
||
| 827 | $this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class); |
||
| 828 | |||
| 829 | $this->registerService(ILogFactory::class, function (Server $c) { |
||
| 830 | return new LogFactory($c, $this->get(SystemConfig::class)); |
||
| 831 | }); |
||
| 832 | |||
| 833 | $this->registerAlias(IJobList::class, \OC\BackgroundJob\JobList::class); |
||
| 834 | /** @deprecated 19.0.0 */ |
||
| 835 | $this->registerDeprecatedAlias('JobList', IJobList::class); |
||
| 836 | |||
| 837 | $this->registerService(Router::class, function (Server $c) { |
||
| 838 | $cacheFactory = $c->get(ICacheFactory::class); |
||
| 839 | if ($cacheFactory->isLocalCacheAvailable()) { |
||
| 840 | $router = $c->resolve(CachingRouter::class); |
||
| 841 | } else { |
||
| 842 | $router = $c->resolve(Router::class); |
||
| 843 | } |
||
| 844 | return $router; |
||
| 845 | }); |
||
| 846 | $this->registerAlias(IRouter::class, Router::class); |
||
| 847 | /** @deprecated 19.0.0 */ |
||
| 848 | $this->registerDeprecatedAlias('Router', IRouter::class); |
||
| 849 | |||
| 850 | $this->registerAlias(ISearch::class, Search::class); |
||
| 851 | /** @deprecated 19.0.0 */ |
||
| 852 | $this->registerDeprecatedAlias('Search', ISearch::class); |
||
| 853 | |||
| 854 | $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
||
| 855 | $cacheFactory = $c->get(ICacheFactory::class); |
||
| 856 | if ($cacheFactory->isAvailable()) { |
||
| 857 | $backend = new \OC\Security\RateLimiting\Backend\MemoryCacheBackend( |
||
| 858 | $c->get(AllConfig::class), |
||
| 859 | $this->get(ICacheFactory::class), |
||
| 860 | new \OC\AppFramework\Utility\TimeFactory() |
||
| 861 | ); |
||
| 862 | } else { |
||
| 863 | $backend = new \OC\Security\RateLimiting\Backend\DatabaseBackend( |
||
| 864 | $c->get(AllConfig::class), |
||
| 865 | $c->get(IDBConnection::class), |
||
| 866 | new \OC\AppFramework\Utility\TimeFactory() |
||
| 867 | ); |
||
| 868 | } |
||
| 869 | |||
| 870 | return $backend; |
||
| 871 | }); |
||
| 872 | |||
| 873 | $this->registerAlias(\OCP\Security\ISecureRandom::class, SecureRandom::class); |
||
| 874 | /** @deprecated 19.0.0 */ |
||
| 875 | $this->registerDeprecatedAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
||
| 876 | $this->registerAlias(\OCP\Security\IRemoteHostValidator::class, \OC\Security\RemoteHostValidator::class); |
||
| 877 | $this->registerAlias(IVerificationToken::class, VerificationToken::class); |
||
| 878 | |||
| 879 | $this->registerAlias(ICrypto::class, Crypto::class); |
||
| 880 | /** @deprecated 19.0.0 */ |
||
| 881 | $this->registerDeprecatedAlias('Crypto', ICrypto::class); |
||
| 882 | |||
| 883 | $this->registerAlias(IHasher::class, Hasher::class); |
||
| 884 | /** @deprecated 19.0.0 */ |
||
| 885 | $this->registerDeprecatedAlias('Hasher', IHasher::class); |
||
| 886 | |||
| 887 | $this->registerAlias(ICredentialsManager::class, CredentialsManager::class); |
||
| 888 | /** @deprecated 19.0.0 */ |
||
| 889 | $this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class); |
||
| 890 | |||
| 891 | $this->registerAlias(IDBConnection::class, ConnectionAdapter::class); |
||
| 892 | $this->registerService(Connection::class, function (Server $c) { |
||
| 893 | $systemConfig = $c->get(SystemConfig::class); |
||
| 894 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
||
| 895 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
||
| 896 | if (!$factory->isValidType($type)) { |
||
| 897 | throw new \OC\DatabaseException('Invalid database type'); |
||
| 898 | } |
||
| 899 | $connectionParams = $factory->createConnectionParams(); |
||
| 900 | $connection = $factory->getConnection($type, $connectionParams); |
||
| 901 | return $connection; |
||
| 902 | }); |
||
| 903 | /** @deprecated 19.0.0 */ |
||
| 904 | $this->registerDeprecatedAlias('DatabaseConnection', IDBConnection::class); |
||
| 905 | |||
| 906 | $this->registerAlias(ICertificateManager::class, CertificateManager::class); |
||
| 907 | $this->registerAlias(IClientService::class, ClientService::class); |
||
| 908 | $this->registerService(NegativeDnsCache::class, function (ContainerInterface $c) { |
||
| 909 | return new NegativeDnsCache( |
||
| 910 | $c->get(ICacheFactory::class), |
||
| 911 | ); |
||
| 912 | }); |
||
| 913 | $this->registerDeprecatedAlias('HttpClientService', IClientService::class); |
||
| 914 | $this->registerService(IEventLogger::class, function (ContainerInterface $c) { |
||
| 915 | return new EventLogger($c->get(SystemConfig::class), $c->get(LoggerInterface::class), $c->get(Log::class)); |
||
| 916 | }); |
||
| 917 | /** @deprecated 19.0.0 */ |
||
| 918 | $this->registerDeprecatedAlias('EventLogger', IEventLogger::class); |
||
| 919 | |||
| 920 | $this->registerService(IQueryLogger::class, function (ContainerInterface $c) { |
||
| 921 | $queryLogger = new QueryLogger(); |
||
| 922 | if ($c->get(SystemConfig::class)->getValue('debug', false)) { |
||
| 923 | // In debug mode, module is being activated by default |
||
| 924 | $queryLogger->activate(); |
||
| 925 | } |
||
| 926 | return $queryLogger; |
||
| 927 | }); |
||
| 928 | /** @deprecated 19.0.0 */ |
||
| 929 | $this->registerDeprecatedAlias('QueryLogger', IQueryLogger::class); |
||
| 930 | |||
| 931 | /** @deprecated 19.0.0 */ |
||
| 932 | $this->registerDeprecatedAlias('TempManager', TempManager::class); |
||
| 933 | $this->registerAlias(ITempManager::class, TempManager::class); |
||
| 934 | |||
| 935 | $this->registerService(AppManager::class, function (ContainerInterface $c) { |
||
| 936 | // TODO: use auto-wiring |
||
| 937 | return new \OC\App\AppManager( |
||
| 938 | $c->get(IUserSession::class), |
||
| 939 | $c->get(\OCP\IConfig::class), |
||
| 940 | $c->get(\OC\AppConfig::class), |
||
| 941 | $c->get(IGroupManager::class), |
||
| 942 | $c->get(ICacheFactory::class), |
||
| 943 | $c->get(SymfonyAdapter::class), |
||
| 944 | $c->get(IEventDispatcher::class), |
||
| 945 | $c->get(LoggerInterface::class) |
||
| 946 | ); |
||
| 947 | }); |
||
| 948 | /** @deprecated 19.0.0 */ |
||
| 949 | $this->registerDeprecatedAlias('AppManager', AppManager::class); |
||
| 950 | $this->registerAlias(IAppManager::class, AppManager::class); |
||
| 951 | |||
| 952 | $this->registerAlias(IDateTimeZone::class, DateTimeZone::class); |
||
| 953 | /** @deprecated 19.0.0 */ |
||
| 954 | $this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class); |
||
| 955 | |||
| 956 | $this->registerService(IDateTimeFormatter::class, function (Server $c) { |
||
| 957 | $language = $c->get(\OCP\IConfig::class)->getUserValue($c->get(ISession::class)->get('user_id'), 'core', 'lang', null); |
||
| 958 | |||
| 959 | return new DateTimeFormatter( |
||
| 960 | $c->get(IDateTimeZone::class)->getTimeZone(), |
||
| 961 | $c->getL10N('lib', $language) |
||
| 962 | ); |
||
| 963 | }); |
||
| 964 | /** @deprecated 19.0.0 */ |
||
| 965 | $this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class); |
||
| 966 | |||
| 967 | $this->registerService(IUserMountCache::class, function (ContainerInterface $c) { |
||
| 968 | $mountCache = $c->get(UserMountCache::class); |
||
| 969 | $listener = new UserMountCacheListener($mountCache); |
||
| 970 | $listener->listen($c->get(IUserManager::class)); |
||
| 971 | return $mountCache; |
||
| 972 | }); |
||
| 973 | /** @deprecated 19.0.0 */ |
||
| 974 | $this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class); |
||
| 975 | |||
| 976 | $this->registerService(IMountProviderCollection::class, function (ContainerInterface $c) { |
||
| 977 | $loader = $c->get(IStorageFactory::class); |
||
| 978 | $mountCache = $c->get(IUserMountCache::class); |
||
| 979 | $eventLogger = $c->get(IEventLogger::class); |
||
| 980 | $manager = new MountProviderCollection($loader, $mountCache, $eventLogger); |
||
| 981 | |||
| 982 | // builtin providers |
||
| 983 | |||
| 984 | $config = $c->get(\OCP\IConfig::class); |
||
| 985 | $logger = $c->get(LoggerInterface::class); |
||
| 986 | $manager->registerProvider(new CacheMountProvider($config)); |
||
| 987 | $manager->registerHomeProvider(new LocalHomeMountProvider()); |
||
| 988 | $manager->registerHomeProvider(new ObjectHomeMountProvider($config)); |
||
| 989 | $manager->registerRootProvider(new RootMountProvider($config, $c->get(LoggerInterface::class))); |
||
| 990 | $manager->registerRootProvider(new ObjectStorePreviewCacheMountProvider($logger, $config)); |
||
| 991 | |||
| 992 | return $manager; |
||
| 993 | }); |
||
| 994 | /** @deprecated 19.0.0 */ |
||
| 995 | $this->registerDeprecatedAlias('MountConfigManager', IMountProviderCollection::class); |
||
| 996 | |||
| 997 | /** @deprecated 20.0.0 */ |
||
| 998 | $this->registerDeprecatedAlias('IniWrapper', IniGetWrapper::class); |
||
| 999 | $this->registerService(IBus::class, function (ContainerInterface $c) { |
||
| 1000 | $busClass = $c->get(\OCP\IConfig::class)->getSystemValueString('commandbus'); |
||
| 1001 | if ($busClass) { |
||
| 1002 | [$app, $class] = explode('::', $busClass, 2); |
||
| 1003 | if ($c->get(IAppManager::class)->isInstalled($app)) { |
||
| 1004 | \OC_App::loadApp($app); |
||
| 1005 | return $c->get($class); |
||
| 1006 | } else { |
||
| 1007 | throw new ServiceUnavailableException("The app providing the command bus ($app) is not enabled"); |
||
| 1008 | } |
||
| 1009 | } else { |
||
| 1010 | $jobList = $c->get(IJobList::class); |
||
| 1011 | return new CronBus($jobList); |
||
| 1012 | } |
||
| 1013 | }); |
||
| 1014 | $this->registerDeprecatedAlias('AsyncCommandBus', IBus::class); |
||
| 1015 | /** @deprecated 20.0.0 */ |
||
| 1016 | $this->registerDeprecatedAlias('TrustedDomainHelper', TrustedDomainHelper::class); |
||
| 1017 | $this->registerAlias(ITrustedDomainHelper::class, TrustedDomainHelper::class); |
||
| 1018 | /** @deprecated 19.0.0 */ |
||
| 1019 | $this->registerDeprecatedAlias('Throttler', Throttler::class); |
||
| 1020 | $this->registerAlias(IThrottler::class, Throttler::class); |
||
| 1021 | $this->registerService('IntegrityCodeChecker', function (ContainerInterface $c) { |
||
| 1022 | // IConfig and IAppManager requires a working database. This code |
||
| 1023 | // might however be called when ownCloud is not yet setup. |
||
| 1024 | if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) { |
||
| 1025 | $config = $c->get(\OCP\IConfig::class); |
||
| 1026 | $appManager = $c->get(IAppManager::class); |
||
| 1027 | } else { |
||
| 1028 | $config = null; |
||
| 1029 | $appManager = null; |
||
| 1030 | } |
||
| 1031 | |||
| 1032 | return new Checker( |
||
| 1033 | new EnvironmentHelper(), |
||
| 1034 | new FileAccessHelper(), |
||
| 1035 | new AppLocator(), |
||
| 1036 | $config, |
||
| 1037 | $c->get(ICacheFactory::class), |
||
| 1038 | $appManager, |
||
| 1039 | $c->get(IMimeTypeDetector::class) |
||
| 1040 | ); |
||
| 1041 | }); |
||
| 1042 | $this->registerService(\OCP\IRequest::class, function (ContainerInterface $c) { |
||
| 1043 | if (isset($this['urlParams'])) { |
||
| 1044 | $urlParams = $this['urlParams']; |
||
| 1045 | } else { |
||
| 1046 | $urlParams = []; |
||
| 1047 | } |
||
| 1048 | |||
| 1049 | if (defined('PHPUNIT_RUN') && PHPUNIT_RUN |
||
| 1050 | && in_array('fakeinput', stream_get_wrappers()) |
||
| 1051 | ) { |
||
| 1052 | $stream = 'fakeinput://data'; |
||
| 1053 | } else { |
||
| 1054 | $stream = 'php://input'; |
||
| 1055 | } |
||
| 1056 | |||
| 1057 | return new Request( |
||
| 1058 | [ |
||
| 1059 | 'get' => $_GET, |
||
| 1060 | 'post' => $_POST, |
||
| 1061 | 'files' => $_FILES, |
||
| 1062 | 'server' => $_SERVER, |
||
| 1063 | 'env' => $_ENV, |
||
| 1064 | 'cookies' => $_COOKIE, |
||
| 1065 | 'method' => (isset($_SERVER) && isset($_SERVER['REQUEST_METHOD'])) |
||
| 1066 | ? $_SERVER['REQUEST_METHOD'] |
||
| 1067 | : '', |
||
| 1068 | 'urlParams' => $urlParams, |
||
| 1069 | ], |
||
| 1070 | $this->get(IRequestId::class), |
||
| 1071 | $this->get(\OCP\IConfig::class), |
||
| 1072 | $this->get(CsrfTokenManager::class), |
||
| 1073 | $stream |
||
| 1074 | ); |
||
| 1075 | }); |
||
| 1076 | /** @deprecated 19.0.0 */ |
||
| 1077 | $this->registerDeprecatedAlias('Request', \OCP\IRequest::class); |
||
| 1078 | |||
| 1079 | $this->registerService(IRequestId::class, function (ContainerInterface $c): IRequestId { |
||
| 1080 | return new RequestId( |
||
| 1081 | $_SERVER['UNIQUE_ID'] ?? '', |
||
| 1082 | $this->get(ISecureRandom::class) |
||
| 1083 | ); |
||
| 1084 | }); |
||
| 1085 | |||
| 1086 | $this->registerService(IMailer::class, function (Server $c) { |
||
| 1087 | return new Mailer( |
||
| 1088 | $c->get(\OCP\IConfig::class), |
||
| 1089 | $c->get(LoggerInterface::class), |
||
| 1090 | $c->get(Defaults::class), |
||
| 1091 | $c->get(IURLGenerator::class), |
||
| 1092 | $c->getL10N('lib'), |
||
| 1093 | $c->get(IEventDispatcher::class), |
||
| 1094 | $c->get(IFactory::class) |
||
| 1095 | ); |
||
| 1096 | }); |
||
| 1097 | /** @deprecated 19.0.0 */ |
||
| 1098 | $this->registerDeprecatedAlias('Mailer', IMailer::class); |
||
| 1099 | |||
| 1100 | /** @deprecated 21.0.0 */ |
||
| 1101 | $this->registerDeprecatedAlias('LDAPProvider', ILDAPProvider::class); |
||
| 1102 | |||
| 1103 | $this->registerService(ILDAPProviderFactory::class, function (ContainerInterface $c) { |
||
| 1104 | $config = $c->get(\OCP\IConfig::class); |
||
| 1105 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
||
| 1106 | if (is_null($factoryClass) || !class_exists($factoryClass)) { |
||
| 1107 | return new NullLDAPProviderFactory($this); |
||
| 1108 | } |
||
| 1109 | /** @var \OCP\LDAP\ILDAPProviderFactory $factory */ |
||
| 1110 | return new $factoryClass($this); |
||
| 1111 | }); |
||
| 1112 | $this->registerService(ILDAPProvider::class, function (ContainerInterface $c) { |
||
| 1113 | $factory = $c->get(ILDAPProviderFactory::class); |
||
| 1114 | return $factory->getLDAPProvider(); |
||
| 1115 | }); |
||
| 1116 | $this->registerService(ILockingProvider::class, function (ContainerInterface $c) { |
||
| 1117 | $ini = $c->get(IniGetWrapper::class); |
||
| 1118 | $config = $c->get(\OCP\IConfig::class); |
||
| 1119 | $ttl = $config->getSystemValueInt('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
||
| 1120 | if ($config->getSystemValueBool('filelocking.enabled', true) or (defined('PHPUNIT_RUN') && PHPUNIT_RUN)) { |
||
| 1121 | /** @var \OC\Memcache\Factory $memcacheFactory */ |
||
| 1122 | $memcacheFactory = $c->get(ICacheFactory::class); |
||
| 1123 | $memcache = $memcacheFactory->createLocking('lock'); |
||
| 1124 | if (!($memcache instanceof \OC\Memcache\NullCache)) { |
||
| 1125 | return new MemcacheLockingProvider($memcache, $ttl); |
||
| 1126 | } |
||
| 1127 | return new DBLockingProvider( |
||
| 1128 | $c->get(IDBConnection::class), |
||
| 1129 | new TimeFactory(), |
||
| 1130 | $ttl, |
||
| 1131 | !\OC::$CLI |
||
| 1132 | ); |
||
| 1133 | } |
||
| 1134 | return new NoopLockingProvider(); |
||
| 1135 | }); |
||
| 1136 | /** @deprecated 19.0.0 */ |
||
| 1137 | $this->registerDeprecatedAlias('LockingProvider', ILockingProvider::class); |
||
| 1138 | |||
| 1139 | $this->registerService(ILockManager::class, function (Server $c): LockManager { |
||
| 1140 | return new LockManager(); |
||
| 1141 | }); |
||
| 1142 | |||
| 1143 | $this->registerAlias(ILockdownManager::class, 'LockdownManager'); |
||
| 1144 | $this->registerService(SetupManager::class, function ($c) { |
||
| 1145 | // create the setupmanager through the mount manager to resolve the cyclic dependency |
||
| 1146 | return $c->get(\OC\Files\Mount\Manager::class)->getSetupManager(); |
||
| 1147 | }); |
||
| 1148 | $this->registerAlias(IMountManager::class, \OC\Files\Mount\Manager::class); |
||
| 1149 | /** @deprecated 19.0.0 */ |
||
| 1150 | $this->registerDeprecatedAlias('MountManager', IMountManager::class); |
||
| 1151 | |||
| 1152 | $this->registerService(IMimeTypeDetector::class, function (ContainerInterface $c) { |
||
| 1153 | return new \OC\Files\Type\Detection( |
||
| 1154 | $c->get(IURLGenerator::class), |
||
| 1155 | $c->get(LoggerInterface::class), |
||
| 1156 | \OC::$configDir, |
||
| 1157 | \OC::$SERVERROOT . '/resources/config/' |
||
| 1158 | ); |
||
| 1159 | }); |
||
| 1160 | /** @deprecated 19.0.0 */ |
||
| 1161 | $this->registerDeprecatedAlias('MimeTypeDetector', IMimeTypeDetector::class); |
||
| 1162 | |||
| 1163 | $this->registerAlias(IMimeTypeLoader::class, Loader::class); |
||
| 1164 | /** @deprecated 19.0.0 */ |
||
| 1165 | $this->registerDeprecatedAlias('MimeTypeLoader', IMimeTypeLoader::class); |
||
| 1166 | $this->registerService(BundleFetcher::class, function () { |
||
| 1167 | return new BundleFetcher($this->getL10N('lib')); |
||
| 1168 | }); |
||
| 1169 | $this->registerAlias(\OCP\Notification\IManager::class, Manager::class); |
||
| 1170 | /** @deprecated 19.0.0 */ |
||
| 1171 | $this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class); |
||
| 1172 | |||
| 1173 | $this->registerService(CapabilitiesManager::class, function (ContainerInterface $c) { |
||
| 1174 | $manager = new CapabilitiesManager($c->get(LoggerInterface::class)); |
||
| 1175 | $manager->registerCapability(function () use ($c) { |
||
| 1176 | return new \OC\OCS\CoreCapabilities($c->get(\OCP\IConfig::class)); |
||
| 1177 | }); |
||
| 1178 | $manager->registerCapability(function () use ($c) { |
||
| 1179 | return $c->get(\OC\Security\Bruteforce\Capabilities::class); |
||
| 1180 | }); |
||
| 1181 | $manager->registerCapability(function () use ($c) { |
||
| 1182 | return $c->get(MetadataCapabilities::class); |
||
| 1183 | }); |
||
| 1184 | return $manager; |
||
| 1185 | }); |
||
| 1186 | /** @deprecated 19.0.0 */ |
||
| 1187 | $this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class); |
||
| 1188 | |||
| 1189 | $this->registerService(ICommentsManager::class, function (Server $c) { |
||
| 1190 | $config = $c->get(\OCP\IConfig::class); |
||
| 1191 | $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
||
| 1192 | /** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
||
| 1193 | $factory = new $factoryClass($this); |
||
| 1194 | $manager = $factory->getManager(); |
||
| 1195 | |||
| 1196 | $manager->registerDisplayNameResolver('user', function ($id) use ($c) { |
||
| 1197 | $manager = $c->get(IUserManager::class); |
||
| 1198 | $userDisplayName = $manager->getDisplayName($id); |
||
| 1199 | if ($userDisplayName === null) { |
||
| 1200 | $l = $c->get(IFactory::class)->get('core'); |
||
| 1201 | return $l->t('Unknown user'); |
||
| 1202 | } |
||
| 1203 | return $userDisplayName; |
||
| 1204 | }); |
||
| 1205 | |||
| 1206 | return $manager; |
||
| 1207 | }); |
||
| 1208 | /** @deprecated 19.0.0 */ |
||
| 1209 | $this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class); |
||
| 1210 | |||
| 1211 | $this->registerAlias(\OC_Defaults::class, 'ThemingDefaults'); |
||
| 1212 | $this->registerService('ThemingDefaults', function (Server $c) { |
||
| 1213 | try { |
||
| 1214 | $classExists = class_exists('OCA\Theming\ThemingDefaults'); |
||
| 1215 | } catch (\OCP\AutoloadNotAllowedException $e) { |
||
| 1216 | // App disabled or in maintenance mode |
||
| 1217 | $classExists = false; |
||
| 1218 | } |
||
| 1219 | |||
| 1220 | if ($classExists && $c->get(\OCP\IConfig::class)->getSystemValueBool('installed', false) && $c->get(IAppManager::class)->isInstalled('theming') && $c->getTrustedDomainHelper()->isTrustedDomain($c->getRequest()->getInsecureServerHost())) { |
||
| 1221 | $imageManager = new ImageManager( |
||
| 1222 | $c->get(\OCP\IConfig::class), |
||
| 1223 | $c->getAppDataDir('theming'), |
||
| 1224 | $c->get(IURLGenerator::class), |
||
| 1225 | $this->get(ICacheFactory::class), |
||
| 1226 | $this->get(ILogger::class), |
||
| 1227 | $this->get(ITempManager::class) |
||
| 1228 | ); |
||
| 1229 | return new ThemingDefaults( |
||
| 1230 | $c->get(\OCP\IConfig::class), |
||
| 1231 | $c->getL10N('theming'), |
||
| 1232 | $c->get(IUserSession::class), |
||
| 1233 | $c->get(IURLGenerator::class), |
||
| 1234 | $c->get(ICacheFactory::class), |
||
| 1235 | new Util($c->get(\OCP\IConfig::class), $this->get(IAppManager::class), $c->getAppDataDir('theming'), $imageManager), |
||
| 1236 | $imageManager, |
||
| 1237 | $c->get(IAppManager::class), |
||
| 1238 | $c->get(INavigationManager::class) |
||
| 1239 | ); |
||
| 1240 | } |
||
| 1241 | return new \OC_Defaults(); |
||
| 1242 | }); |
||
| 1243 | $this->registerService(JSCombiner::class, function (Server $c) { |
||
| 1244 | return new JSCombiner( |
||
| 1245 | $c->getAppDataDir('js'), |
||
| 1246 | $c->get(IURLGenerator::class), |
||
| 1247 | $this->get(ICacheFactory::class), |
||
| 1248 | $c->get(SystemConfig::class), |
||
| 1249 | $c->get(LoggerInterface::class) |
||
| 1250 | ); |
||
| 1251 | }); |
||
| 1252 | $this->registerAlias(\OCP\EventDispatcher\IEventDispatcher::class, \OC\EventDispatcher\EventDispatcher::class); |
||
| 1253 | /** @deprecated 19.0.0 */ |
||
| 1254 | $this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class); |
||
| 1255 | $this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class); |
||
| 1256 | |||
| 1257 | $this->registerService('CryptoWrapper', function (ContainerInterface $c) { |
||
| 1258 | // FIXME: Instantiated here due to cyclic dependency |
||
| 1259 | $request = new Request( |
||
| 1260 | [ |
||
| 1261 | 'get' => $_GET, |
||
| 1262 | 'post' => $_POST, |
||
| 1263 | 'files' => $_FILES, |
||
| 1264 | 'server' => $_SERVER, |
||
| 1265 | 'env' => $_ENV, |
||
| 1266 | 'cookies' => $_COOKIE, |
||
| 1267 | 'method' => (isset($_SERVER) && isset($_SERVER['REQUEST_METHOD'])) |
||
| 1268 | ? $_SERVER['REQUEST_METHOD'] |
||
| 1269 | : null, |
||
| 1270 | ], |
||
| 1271 | $c->get(IRequestId::class), |
||
| 1272 | $c->get(\OCP\IConfig::class) |
||
| 1273 | ); |
||
| 1274 | |||
| 1275 | return new CryptoWrapper( |
||
| 1276 | $c->get(\OCP\IConfig::class), |
||
| 1277 | $c->get(ICrypto::class), |
||
| 1278 | $c->get(ISecureRandom::class), |
||
| 1279 | $request |
||
| 1280 | ); |
||
| 1281 | }); |
||
| 1282 | /** @deprecated 19.0.0 */ |
||
| 1283 | $this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class); |
||
| 1284 | $this->registerService(SessionStorage::class, function (ContainerInterface $c) { |
||
| 1285 | return new SessionStorage($c->get(ISession::class)); |
||
| 1286 | }); |
||
| 1287 | $this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class); |
||
| 1288 | /** @deprecated 19.0.0 */ |
||
| 1289 | $this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class); |
||
| 1290 | |||
| 1291 | $this->registerService(\OCP\Share\IManager::class, function (IServerContainer $c) { |
||
| 1292 | $config = $c->get(\OCP\IConfig::class); |
||
| 1293 | $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
||
| 1294 | /** @var \OCP\Share\IProviderFactory $factory */ |
||
| 1295 | $factory = new $factoryClass($this); |
||
| 1296 | |||
| 1297 | $manager = new \OC\Share20\Manager( |
||
| 1298 | $c->get(LoggerInterface::class), |
||
| 1299 | $c->get(\OCP\IConfig::class), |
||
| 1300 | $c->get(ISecureRandom::class), |
||
| 1301 | $c->get(IHasher::class), |
||
| 1302 | $c->get(IMountManager::class), |
||
| 1303 | $c->get(IGroupManager::class), |
||
| 1304 | $c->getL10N('lib'), |
||
| 1305 | $c->get(IFactory::class), |
||
| 1306 | $factory, |
||
| 1307 | $c->get(IUserManager::class), |
||
| 1308 | $c->get(IRootFolder::class), |
||
| 1309 | $c->get(SymfonyAdapter::class), |
||
| 1310 | $c->get(IMailer::class), |
||
| 1311 | $c->get(IURLGenerator::class), |
||
| 1312 | $c->get('ThemingDefaults'), |
||
| 1313 | $c->get(IEventDispatcher::class), |
||
| 1314 | $c->get(IUserSession::class), |
||
| 1315 | $c->get(KnownUserService::class) |
||
| 1316 | ); |
||
| 1317 | |||
| 1318 | return $manager; |
||
| 1319 | }); |
||
| 1320 | /** @deprecated 19.0.0 */ |
||
| 1321 | $this->registerDeprecatedAlias('ShareManager', \OCP\Share\IManager::class); |
||
| 1322 | |||
| 1323 | $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) { |
||
| 1324 | $instance = new Collaboration\Collaborators\Search($c); |
||
| 1325 | |||
| 1326 | // register default plugins |
||
| 1327 | $instance->registerPlugin(['shareType' => 'SHARE_TYPE_USER', 'class' => UserPlugin::class]); |
||
| 1328 | $instance->registerPlugin(['shareType' => 'SHARE_TYPE_GROUP', 'class' => GroupPlugin::class]); |
||
| 1329 | $instance->registerPlugin(['shareType' => 'SHARE_TYPE_EMAIL', 'class' => MailPlugin::class]); |
||
| 1330 | $instance->registerPlugin(['shareType' => 'SHARE_TYPE_REMOTE', 'class' => RemotePlugin::class]); |
||
| 1331 | $instance->registerPlugin(['shareType' => 'SHARE_TYPE_REMOTE_GROUP', 'class' => RemoteGroupPlugin::class]); |
||
| 1332 | |||
| 1333 | return $instance; |
||
| 1334 | }); |
||
| 1335 | /** @deprecated 19.0.0 */ |
||
| 1336 | $this->registerDeprecatedAlias('CollaboratorSearch', \OCP\Collaboration\Collaborators\ISearch::class); |
||
| 1337 | $this->registerAlias(\OCP\Collaboration\Collaborators\ISearchResult::class, \OC\Collaboration\Collaborators\SearchResult::class); |
||
| 1338 | |||
| 1339 | $this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class); |
||
| 1340 | |||
| 1341 | $this->registerAlias(\OCP\Collaboration\Resources\IProviderManager::class, \OC\Collaboration\Resources\ProviderManager::class); |
||
| 1342 | $this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\Manager::class); |
||
| 1343 | |||
| 1344 | $this->registerAlias(IReferenceManager::class, ReferenceManager::class); |
||
| 1345 | |||
| 1346 | $this->registerDeprecatedAlias('SettingsManager', \OC\Settings\Manager::class); |
||
| 1347 | $this->registerAlias(\OCP\Settings\IManager::class, \OC\Settings\Manager::class); |
||
| 1348 | $this->registerService(\OC\Files\AppData\Factory::class, function (ContainerInterface $c) { |
||
| 1349 | return new \OC\Files\AppData\Factory( |
||
| 1350 | $c->get(IRootFolder::class), |
||
| 1351 | $c->get(SystemConfig::class) |
||
| 1352 | ); |
||
| 1353 | }); |
||
| 1354 | |||
| 1355 | $this->registerService('LockdownManager', function (ContainerInterface $c) { |
||
| 1356 | return new LockdownManager(function () use ($c) { |
||
| 1357 | return $c->get(ISession::class); |
||
| 1358 | }); |
||
| 1359 | }); |
||
| 1360 | |||
| 1361 | $this->registerService(\OCP\OCS\IDiscoveryService::class, function (ContainerInterface $c) { |
||
| 1362 | return new DiscoveryService( |
||
| 1363 | $c->get(ICacheFactory::class), |
||
| 1364 | $c->get(IClientService::class) |
||
| 1365 | ); |
||
| 1366 | }); |
||
| 1367 | |||
| 1368 | $this->registerService(ICloudIdManager::class, function (ContainerInterface $c) { |
||
| 1369 | return new CloudIdManager( |
||
| 1370 | $c->get(\OCP\Contacts\IManager::class), |
||
| 1371 | $c->get(IURLGenerator::class), |
||
| 1372 | $c->get(IUserManager::class), |
||
| 1373 | $c->get(ICacheFactory::class), |
||
| 1374 | $c->get(IEventDispatcher::class), |
||
| 1375 | ); |
||
| 1376 | }); |
||
| 1377 | |||
| 1378 | $this->registerAlias(\OCP\GlobalScale\IConfig::class, \OC\GlobalScale\Config::class); |
||
| 1379 | |||
| 1380 | $this->registerService(ICloudFederationProviderManager::class, function (ContainerInterface $c) { |
||
| 1381 | return new CloudFederationProviderManager( |
||
| 1382 | $c->get(IAppManager::class), |
||
| 1383 | $c->get(IClientService::class), |
||
| 1384 | $c->get(ICloudIdManager::class), |
||
| 1385 | $c->get(LoggerInterface::class) |
||
| 1386 | ); |
||
| 1387 | }); |
||
| 1388 | |||
| 1389 | $this->registerService(ICloudFederationFactory::class, function (Server $c) { |
||
| 1390 | return new CloudFederationFactory(); |
||
| 1391 | }); |
||
| 1392 | |||
| 1393 | $this->registerAlias(\OCP\AppFramework\Utility\IControllerMethodReflector::class, \OC\AppFramework\Utility\ControllerMethodReflector::class); |
||
| 1394 | /** @deprecated 19.0.0 */ |
||
| 1395 | $this->registerDeprecatedAlias('ControllerMethodReflector', \OCP\AppFramework\Utility\IControllerMethodReflector::class); |
||
| 1396 | |||
| 1397 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
||
| 1398 | $this->registerAlias(\Psr\Clock\ClockInterface::class, \OCP\AppFramework\Utility\ITimeFactory::class); |
||
| 1399 | /** @deprecated 19.0.0 */ |
||
| 1400 | $this->registerDeprecatedAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
||
| 1401 | |||
| 1402 | $this->registerService(Defaults::class, function (Server $c) { |
||
| 1403 | return new Defaults( |
||
| 1404 | $c->getThemingDefaults() |
||
| 1405 | ); |
||
| 1406 | }); |
||
| 1407 | /** @deprecated 19.0.0 */ |
||
| 1408 | $this->registerDeprecatedAlias('Defaults', \OCP\Defaults::class); |
||
| 1409 | |||
| 1410 | $this->registerService(\OCP\ISession::class, function (ContainerInterface $c) { |
||
| 1411 | return $c->get(\OCP\IUserSession::class)->getSession(); |
||
| 1412 | }, false); |
||
| 1413 | |||
| 1414 | $this->registerService(IShareHelper::class, function (ContainerInterface $c) { |
||
| 1415 | return new ShareHelper( |
||
| 1416 | $c->get(\OCP\Share\IManager::class) |
||
| 1417 | ); |
||
| 1418 | }); |
||
| 1419 | |||
| 1420 | $this->registerService(Installer::class, function (ContainerInterface $c) { |
||
| 1421 | return new Installer( |
||
| 1422 | $c->get(AppFetcher::class), |
||
| 1423 | $c->get(IClientService::class), |
||
| 1424 | $c->get(ITempManager::class), |
||
| 1425 | $c->get(LoggerInterface::class), |
||
| 1426 | $c->get(\OCP\IConfig::class), |
||
| 1427 | \OC::$CLI |
||
| 1428 | ); |
||
| 1429 | }); |
||
| 1430 | |||
| 1431 | $this->registerService(IApiFactory::class, function (ContainerInterface $c) { |
||
| 1432 | return new ApiFactory($c->get(IClientService::class)); |
||
| 1433 | }); |
||
| 1434 | |||
| 1435 | $this->registerService(IInstanceFactory::class, function (ContainerInterface $c) { |
||
| 1436 | $memcacheFactory = $c->get(ICacheFactory::class); |
||
| 1437 | return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->get(IClientService::class)); |
||
| 1438 | }); |
||
| 1439 | |||
| 1440 | $this->registerAlias(IContactsStore::class, ContactsStore::class); |
||
| 1441 | $this->registerAlias(IAccountManager::class, AccountManager::class); |
||
| 1442 | |||
| 1443 | $this->registerAlias(IStorageFactory::class, StorageFactory::class); |
||
| 1444 | |||
| 1445 | $this->registerAlias(\OCP\Dashboard\IManager::class, \OC\Dashboard\Manager::class); |
||
| 1446 | |||
| 1447 | $this->registerAlias(IFullTextSearchManager::class, FullTextSearchManager::class); |
||
| 1448 | |||
| 1449 | $this->registerAlias(ISubAdmin::class, SubAdmin::class); |
||
| 1450 | |||
| 1451 | $this->registerAlias(IInitialStateService::class, InitialStateService::class); |
||
| 1452 | |||
| 1453 | $this->registerAlias(\OCP\IEmojiHelper::class, \OC\EmojiHelper::class); |
||
| 1454 | |||
| 1455 | $this->registerAlias(\OCP\UserStatus\IManager::class, \OC\UserStatus\Manager::class); |
||
| 1456 | |||
| 1457 | $this->registerAlias(IBroker::class, Broker::class); |
||
| 1458 | |||
| 1459 | $this->registerAlias(IMetadataManager::class, MetadataManager::class); |
||
| 1460 | |||
| 1461 | $this->registerAlias(\OCP\Files\AppData\IAppDataFactory::class, \OC\Files\AppData\Factory::class); |
||
| 1462 | |||
| 1463 | $this->registerAlias(IBinaryFinder::class, BinaryFinder::class); |
||
| 1464 | |||
| 1465 | $this->registerAlias(\OCP\Share\IPublicShareTemplateFactory::class, \OC\Share20\PublicShareTemplateFactory::class); |
||
| 1466 | |||
| 1467 | $this->registerAlias(ITranslationManager::class, TranslationManager::class); |
||
| 1468 | |||
| 1469 | $this->registerAlias(ISpeechToTextManager::class, SpeechToTextManager::class); |
||
| 1470 | |||
| 1471 | $this->registerAlias(IEventSourceFactory::class, EventSourceFactory::class); |
||
| 1472 | |||
| 1473 | $this->connectDispatcher(); |
||
| 1474 | } |
||
| 2382 |
This interface has been deprecated. The supplier of the interface has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the interface will be removed and what other interface to use instead.