]> git.mxchange.org Git - friendica.git/commitdiff
Move registerTemplateEngine() into App class
authorArt4 <art4@wlabs.de>
Thu, 9 Jan 2025 08:36:47 +0000 (08:36 +0000)
committerArt4 <art4@wlabs.de>
Thu, 9 Jan 2025 08:36:47 +0000 (08:36 +0000)
src/App.php
src/Core/Container.php
src/Core/DiceContainer.php

index 8c22a42a0629aecba31ad9e763caaa75306f36e4..0b86e3caaeebacfe44a325fe20c3802573d25b79 100644 (file)
@@ -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);
 
index 42ed4ae83f99302896245212ba90c7e16dde667e..44d770c644f06a9f8fea02d6212e82fde9ec7b4c 100644 (file)
@@ -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
index 8b7f9472d7a9bfffbb6150319ab52f99f17af5c6..e5c69c498247e323be8884606191a7ad7e3c6336 100644 (file)
@@ -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');
-       }
 }