Refactor App::processConsole()

This commit is contained in:
Art4 2024-12-26 08:01:30 +00:00
parent f40b428ac2
commit cf8ce380b7

View file

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