From 04fb9dd9e08f8e94115fa271d3cfd92df905f931 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 9 Jan 2025 08:36:47 +0000 Subject: [PATCH] Move registerTemplateEngine() into App class --- src/App.php | 4 ++++ src/Core/Container.php | 3 +-- src/Core/DiceContainer.php | 13 +------------ 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/App.php b/src/App.php index 8c22a42a06..0b86e3caae 100644 --- a/src/App.php +++ b/src/App.php @@ -175,6 +175,8 @@ class App { $this->setupContainerForAddons(); + $this->registerTemplateEngine(); + (\Friendica\Core\Console::create($this->container, $argv))->execute(); } @@ -184,6 +186,8 @@ class App $this->container->setup(LogChannel::AUTH_JABBERED, false); + $this->registerTemplateEngine(); + /** @var BasePath */ $basePath = $this->container->create(BasePath::class); diff --git a/src/Core/Container.php b/src/Core/Container.php index 42ed4ae83f..44d770c644 100644 --- a/src/Core/Container.php +++ b/src/Core/Container.php @@ -22,11 +22,10 @@ interface Container * @deprecated * * @param string $logChannel The Log Channel of this call - * @param bool $withTemplateEngine true, if the template engine should be set too * * @return void */ - public function setup(string $logChannel = LogChannel::DEFAULT, bool $withTemplateEngine = true): void; + public function setup(string $logChannel = LogChannel::DEFAULT): void; /** * Returns a fully constructed object based on $name using $args and $share as constructor arguments if supplied diff --git a/src/Core/DiceContainer.php b/src/Core/DiceContainer.php index 8b7f9472d7..e5c69c4982 100644 --- a/src/Core/DiceContainer.php +++ b/src/Core/DiceContainer.php @@ -10,7 +10,6 @@ declare(strict_types=1); namespace Friendica\Core; use Dice\Dice; -use Friendica\Core\Addon\Capability\ICanLoadAddons; use Friendica\Core\Logger\Capability\LogChannel; use Friendica\Core\Logger\Handler\ErrorHandler; use Friendica\DI; @@ -43,19 +42,14 @@ final class DiceContainer implements Container * @deprecated * * @param string $logChannel The Log Channel of this call - * @param bool $withTemplateEngine true, if the template engine should be set too * * @return void */ - public function setup(string $logChannel = LogChannel::DEFAULT, bool $withTemplateEngine = true): void + public function setup(string $logChannel = LogChannel::DEFAULT): void { $this->setupContainerForLogger($logChannel); $this->setupLegacyServiceLocator(); $this->registerErrorHandler(); - - if ($withTemplateEngine) { - $this->registerTemplateEngine(); - } } /** @@ -100,9 +94,4 @@ final class DiceContainer implements Container { ErrorHandler::register($this->container->create(LoggerInterface::class)); } - - private function registerTemplateEngine(): void - { - Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); - } }