Refactor registering template engine

This commit is contained in:
Art4 2024-12-26 08:27:02 +00:00
parent e9b92aea7b
commit a6385bed71

View file

@ -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();
}
/**