]> git.mxchange.org Git - friendica.git/commitdiff
Refactor App::processConsole()
authorArt4 <art4@wlabs.de>
Thu, 26 Dec 2024 08:01:30 +0000 (08:01 +0000)
committerArt4 <art4@wlabs.de>
Thu, 26 Dec 2024 08:01:30 +0000 (08:01 +0000)
src/App.php

index 7aef7fe361db6b38154c639873cedbb0cbd19267..ae9a6334e37963485bf6879f719d9e20d19d9780 100644 (file)
@@ -192,14 +192,15 @@ class App
 
        public function processConsole(array $argv): void
        {
-               /** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
-               $addonLoader = $this->container->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
-               $this->container = $this->container->addRules($addonLoader->getActiveAddonConfig('dependencies'));
-               $this->container = $this->container->addRule(LoggerInterface::class, ['constructParams' => [LogChannel::CONSOLE]]);
+               $this->setupContainerForAddons();
 
-               /// @fixme Necessary until Hooks inside the Logger can get loaded without the DI-class
-               DI::init($this->container);
-               \Friendica\Core\Logger\Handler\ErrorHandler::register($this->container->create(\Psr\Log\LoggerInterface::class));
+               $this->container = $this->container->addRule(LoggerInterface::class, [
+                       'constructParams' => [LogChannel::CONSOLE],
+               ]);
+
+               $this->setupLegacyServerLocator();
+
+               $this->registerErrorHandler();
 
                (new \Friendica\Core\Console($this->container, $argv))->execute();
        }