]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Renderer.php
Replace own VoidLogger with PSR-Standard NullLogger()
[friendica.git] / src / Core / Renderer.php
index bf4cd390782babaaa28515b14b6348e11845b258..ad1717ae83f422495425179620632d673ed867b7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -48,10 +48,8 @@ class Renderer
         * beyond are used.
         */
        public static $theme = [
-               'sourcename' => '',
                'videowidth' => 425,
                'videoheight' => 350,
-               'force_max_items' => 0,
                'stylesheet' => '',
                'template_engine' => 'smarty3',
        ];
@@ -75,7 +73,7 @@ class Renderer
         */
        public static function replaceMacros(string $template, array $vars = [])
        {
-               $stamp1 = microtime(true);
+               DI::profiler()->startRecording('rendering');
 
                // pass $baseurl to all templates if it isn't set
                $vars = array_merge(['$baseurl' => DI::baseUrl()->get(), '$APP' => DI::app()], $vars);
@@ -92,7 +90,7 @@ class Renderer
                        throw new InternalServerErrorException($message);
                }
 
-               DI::profiler()->saveTimestamp($stamp1, "rendering", System::callstack());
+               DI::profiler()->stopRecording();
 
                return $output;
        }
@@ -108,7 +106,7 @@ class Renderer
         */
        public static function getMarkupTemplate($file, $subDir = '')
        {
-               $stamp1 = microtime(true);
+               DI::profiler()->startRecording('file');
                $t = self::getTemplateEngine();
 
                try {
@@ -121,7 +119,7 @@ class Renderer
                        throw new InternalServerErrorException($message);
                }
 
-               DI::profiler()->saveTimestamp($stamp1, "file", System::callstack());
+               DI::profiler()->stopRecording();
 
                return $template;
        }
@@ -168,7 +166,7 @@ class Renderer
                        } else {
                                $a = DI::app();
                                $class = self::$template_engines[$template_engine];
-                               $obj = new $class($a->getCurrentTheme(), $a->theme_info);
+                               $obj = new $class($a->getCurrentTheme(), $a->getThemeInfo());
                                self::$template_engine_instance[$template_engine] = $obj;
                                return $obj;
                        }