{
$this->setupContainerForAddons();
- $this->container = $this->container->addRule(LoggerInterface::class,[
- 'constructParams' => [LogChannel::AUTH_JABBERED],
- ]);
+ $this->setupContainerForLogger(LogChannel::AUTH_JABBERED);
- $this->setupLegacyServerLocator();
+ $this->setupLegacyServiceLocator();
$this->registerErrorHandler();
}
}
- $this->setupLegacyServerLocator();
+ public function processConsole(array $argv): void
+ {
+ $this->setupContainerForAddons();
+
+ $this->setupContainerForLogger(LogChannel::CONSOLE);
+
++ $this->setupLegacyServiceLocator();
+
+ $this->registerErrorHandler();
+
+ $this->registerTemplateEngine();
+
+ (new \Friendica\Core\Console($this->container, $argv))->execute();
+ }
+
private function setupContainerForAddons(): void
{
/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
$this->container = $this->container->addRules($addonLoader->getActiveAddonConfig('dependencies'));
}
- private function setupLegacyServerLocator(): void
+ private function setupContainerForLogger(string $logChannel): void
+ {
+ $this->container = $this->container->addRule(LoggerInterface::class, [
+ 'constructParams' => [$logChannel],
+ ]);
+ }
+
+ private function setupLegacyServiceLocator(): void
{
\Friendica\DI::init($this->container);
}