]> git.mxchange.org Git - friendica.git/blobdiff - src/Render/FriendicaSmartyEngine.php
Remove/replace killme() with *exit()
[friendica.git] / src / Render / FriendicaSmartyEngine.php
index c6e95ee068498ca0505577597057e761f5ac273e..54295684cc70c4ddc95779798d8d75f47d9a543f 100644 (file)
@@ -9,7 +9,7 @@ use Friendica\Core\Addon;
 /**
  * Smarty implementation of the Friendica template engine interface
  *
- * @author Hypolite Petovan <mrpetovan@gmail.com>
+ * @author Hypolite Petovan <hypolite@mrpetovan.com>
  */
 class FriendicaSmartyEngine implements ITemplateEngine
 {
@@ -19,7 +19,7 @@ class FriendicaSmartyEngine implements ITemplateEngine
        {
                if (!is_writable('view/smarty3/')) {
                        echo "<b>ERROR:</b> folder <tt>view/smarty3/</tt> must be writable by webserver.";
-                       killme();
+                       exit();
                }
        }
 
@@ -32,7 +32,7 @@ class FriendicaSmartyEngine implements ITemplateEngine
                        $s = new FriendicaSmarty();
                }
 
-               $r['$APP'] = get_app();
+               $r['$APP'] = \get_app();
 
                // "middleware": inject variables into templates
                $arr = [
@@ -54,7 +54,7 @@ class FriendicaSmartyEngine implements ITemplateEngine
 
        public function getTemplateFile($file, $root = '')
        {
-               $a = get_app();
+               $a = \get_app();
                $template = new FriendicaSmarty();
 
                // Make sure $root ends with a slash /
@@ -67,7 +67,7 @@ class FriendicaSmartyEngine implements ITemplateEngine
 
                if (file_exists("{$root}view/theme/$theme/$filename")) {
                        $template_file = "{$root}view/theme/$theme/$filename";
-               } elseif (x($a->theme_info, 'extends') && file_exists(sprintf('%sview/theme/%s}/%s', $root, $a->theme_info['extends'], $filename))) {
+               } elseif (!empty($a->theme_info['extends']) && file_exists(sprintf('%sview/theme/%s}/%s', $root, $a->theme_info['extends'], $filename))) {
                        $template_file = sprintf('%sview/theme/%s}/%s', $root, $a->theme_info['extends'], $filename);
                } elseif (file_exists("{$root}/$filename")) {
                        $template_file = "{$root}/$filename";