From a6385bed7118eb1ee7c39dd13a2722994861e573 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 08:27:02 +0000 Subject: [PATCH] Refactor registering template engine --- src/App.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/App.php b/src/App.php index 03300a8a11..2c4eacc300 100644 --- a/src/App.php +++ b/src/App.php @@ -17,6 +17,7 @@ use Friendica\App\Router; use Friendica\Capabilities\ICanCreateResponses; use Friendica\Content\Nav; use Friendica\Core\Config\Factory\Config; +use Friendica\Core\Renderer; use Friendica\Core\Session\Capability\IHandleUserSessions; use Friendica\Database\Definition\DbaDefinition; use Friendica\Database\Definition\ViewDefinition; @@ -200,7 +201,7 @@ class App $this->registerErrorHandler(); - Core\Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + $this->registerTemplateEngine(); (new \Friendica\Core\Console($this->container, $argv))->execute(); } @@ -230,6 +231,11 @@ class App \Friendica\Core\Logger\Handler\ErrorHandler::register($this->container->create(LoggerInterface::class)); } + private function registerTemplateEngine(): void + { + Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + } + /** * Load the whole app instance */ @@ -264,8 +270,8 @@ class App } $this->loadDefaultTimezone(); - // Register template engines - Core\Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine'); + + $this->registerTemplateEngine(); } /**