]> 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 1ccad740bdecedcb3807cc454747413727a7256f..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,7 +48,6 @@ class Renderer
         * beyond are used.
         */
        public static $theme = [
-               'sourcename' => '',
                'videowidth' => 425,
                'videoheight' => 350,
                'stylesheet' => '',
@@ -74,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);
@@ -91,7 +90,7 @@ class Renderer
                        throw new InternalServerErrorException($message);
                }
 
-               DI::profiler()->saveTimestamp($stamp1, "rendering");
+               DI::profiler()->stopRecording();
 
                return $output;
        }
@@ -107,7 +106,7 @@ class Renderer
         */
        public static function getMarkupTemplate($file, $subDir = '')
        {
-               $stamp1 = microtime(true);
+               DI::profiler()->startRecording('file');
                $t = self::getTemplateEngine();
 
                try {
@@ -120,7 +119,7 @@ class Renderer
                        throw new InternalServerErrorException($message);
                }
 
-               DI::profiler()->saveTimestamp($stamp1, "file");
+               DI::profiler()->stopRecording();
 
                return $template;
        }
@@ -167,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;
                        }