mirror of
https://github.com/friendica/friendica
synced 2025-01-19 17:39:46 +00:00
Move registerErrorHandler() into App class
This commit is contained in:
parent
04fb9dd9e0
commit
633c692083
2 changed files with 13 additions and 10 deletions
16
src/App.php
16
src/App.php
|
@ -29,6 +29,7 @@ use Friendica\Security\Authentication;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Logger\Capability\LogChannel;
|
use Friendica\Core\Logger\Capability\LogChannel;
|
||||||
|
use Friendica\Core\Logger\Handler\ErrorHandler;
|
||||||
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
|
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Update;
|
use Friendica\Core\Update;
|
||||||
|
@ -137,7 +138,9 @@ class App
|
||||||
|
|
||||||
$this->setupContainerForAddons();
|
$this->setupContainerForAddons();
|
||||||
|
|
||||||
$this->container->setup(LogChannel::APP, false);
|
$this->container->setup(LogChannel::APP);
|
||||||
|
|
||||||
|
$this->registerErrorHandler();
|
||||||
|
|
||||||
$this->requestId = $this->container->create(Request::class)->getRequestId();
|
$this->requestId = $this->container->create(Request::class)->getRequestId();
|
||||||
$this->auth = $this->container->create(Authentication::class);
|
$this->auth = $this->container->create(Authentication::class);
|
||||||
|
@ -175,6 +178,8 @@ class App
|
||||||
{
|
{
|
||||||
$this->setupContainerForAddons();
|
$this->setupContainerForAddons();
|
||||||
|
|
||||||
|
$this->registerErrorHandler();
|
||||||
|
|
||||||
$this->registerTemplateEngine();
|
$this->registerTemplateEngine();
|
||||||
|
|
||||||
(\Friendica\Core\Console::create($this->container, $argv))->execute();
|
(\Friendica\Core\Console::create($this->container, $argv))->execute();
|
||||||
|
@ -184,9 +189,9 @@ class App
|
||||||
{
|
{
|
||||||
$this->setupContainerForAddons();
|
$this->setupContainerForAddons();
|
||||||
|
|
||||||
$this->container->setup(LogChannel::AUTH_JABBERED, false);
|
$this->container->setup(LogChannel::AUTH_JABBERED);
|
||||||
|
|
||||||
$this->registerTemplateEngine();
|
$this->registerErrorHandler();
|
||||||
|
|
||||||
/** @var BasePath */
|
/** @var BasePath */
|
||||||
$basePath = $this->container->create(BasePath::class);
|
$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
|
private function registerTemplateEngine(): void
|
||||||
{
|
{
|
||||||
Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine');
|
Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine');
|
||||||
|
|
|
@ -11,7 +11,6 @@ namespace Friendica\Core;
|
||||||
|
|
||||||
use Dice\Dice;
|
use Dice\Dice;
|
||||||
use Friendica\Core\Logger\Capability\LogChannel;
|
use Friendica\Core\Logger\Capability\LogChannel;
|
||||||
use Friendica\Core\Logger\Handler\ErrorHandler;
|
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
|
@ -49,7 +48,6 @@ final class DiceContainer implements Container
|
||||||
{
|
{
|
||||||
$this->setupContainerForLogger($logChannel);
|
$this->setupContainerForLogger($logChannel);
|
||||||
$this->setupLegacyServiceLocator();
|
$this->setupLegacyServiceLocator();
|
||||||
$this->registerErrorHandler();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -89,9 +87,4 @@ final class DiceContainer implements Container
|
||||||
{
|
{
|
||||||
DI::init($this->container);
|
DI::init($this->container);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function registerErrorHandler(): void
|
|
||||||
{
|
|
||||||
ErrorHandler::register($this->container->create(LoggerInterface::class));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue