]> git.mxchange.org Git - friendica.git/commitdiff
Move registerErrorHandler() into App class
authorArt4 <art4@wlabs.de>
Thu, 9 Jan 2025 08:53:07 +0000 (08:53 +0000)
committerArt4 <art4@wlabs.de>
Thu, 9 Jan 2025 08:53:07 +0000 (08:53 +0000)
src/App.php
src/Core/DiceContainer.php

index 0b86e3caaeebacfe44a325fe20c3802573d25b79..aa6dc5123442d3923291d234956e455f59ead658 100644 (file)
@@ -29,6 +29,7 @@ use Friendica\Security\Authentication;
 use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger\Capability\LogChannel;
+use Friendica\Core\Logger\Handler\ErrorHandler;
 use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
 use Friendica\Core\System;
 use Friendica\Core\Update;
@@ -137,7 +138,9 @@ class App
 
                $this->setupContainerForAddons();
 
-               $this->container->setup(LogChannel::APP, false);
+               $this->container->setup(LogChannel::APP);
+
+               $this->registerErrorHandler();
 
                $this->requestId = $this->container->create(Request::class)->getRequestId();
                $this->auth      = $this->container->create(Authentication::class);
@@ -175,6 +178,8 @@ class App
        {
                $this->setupContainerForAddons();
 
+               $this->registerErrorHandler();
+
                $this->registerTemplateEngine();
 
                (\Friendica\Core\Console::create($this->container, $argv))->execute();
@@ -184,9 +189,9 @@ class App
        {
                $this->setupContainerForAddons();
 
-               $this->container->setup(LogChannel::AUTH_JABBERED, false);
+               $this->container->setup(LogChannel::AUTH_JABBERED);
 
-               $this->registerTemplateEngine();
+               $this->registerErrorHandler();
 
                /** @var BasePath */
                $basePath = $this->container->create(BasePath::class);
@@ -213,6 +218,11 @@ class App
                }
        }
 
+       private function registerErrorHandler(): void
+       {
+               ErrorHandler::register($this->container->create(LoggerInterface::class));
+       }
+
        private function registerTemplateEngine(): void
        {
                Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine');
index e5c69c498247e323be8884606191a7ad7e3c6336..bba5a18ab6dc34260454a6d04a2f75fdc154362d 100644 (file)
@@ -11,7 +11,6 @@ namespace Friendica\Core;
 
 use Dice\Dice;
 use Friendica\Core\Logger\Capability\LogChannel;
-use Friendica\Core\Logger\Handler\ErrorHandler;
 use Friendica\DI;
 use Psr\Log\LoggerInterface;
 
@@ -49,7 +48,6 @@ final class DiceContainer implements Container
        {
                $this->setupContainerForLogger($logChannel);
                $this->setupLegacyServiceLocator();
-               $this->registerErrorHandler();
        }
 
        /**
@@ -89,9 +87,4 @@ final class DiceContainer implements Container
        {
                DI::init($this->container);
        }
-
-       private function registerErrorHandler(): void
-       {
-               ErrorHandler::register($this->container->create(LoggerInterface::class));
-       }
 }