From da89315a10742dc928e755c51df2a62db513e559 Mon Sep 17 00:00:00 2001 From: envoyr Date: Thu, 28 Apr 2022 16:57:35 +0200 Subject: [PATCH] fix view function in init and update dirname level in install --- lib/Froxlor/Install/Install.php | 6 +++--- lib/init.php | 7 ------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/Froxlor/Install/Install.php b/lib/Froxlor/Install/Install.php index 2f59f1a0..3d769d0a 100644 --- a/lib/Froxlor/Install/Install.php +++ b/lib/Froxlor/Install/Install.php @@ -34,8 +34,8 @@ class Install public string $requiredVersion = '7.4.0'; public array $requiredExtensions = ['libxml', 'zip']; public array $suggestedExtensions = ['curl']; - public array $suggestions; - public array $criticals; + public array $suggestions = []; + public array $criticals = []; public function __construct() { @@ -76,7 +76,7 @@ class Install public function handle() { - $formfield = require dirname(__DIR__) . '/lib/formfields/install/formfield.install.php'; + $formfield = require dirname(__DIR__, 3) . '/lib/formfields/install/formfield.install.php'; // init twig UI::initTwig(true); diff --git a/lib/init.php b/lib/init.php index 4a218aea..d40f993f 100644 --- a/lib/init.php +++ b/lib/init.php @@ -26,13 +26,6 @@ // define default theme for configurehint, etc. $_deftheme = 'Froxlor'; -function view($template, $attributes) -{ - $view = file_get_contents(dirname(__DIR__) . '/templates/' . $template); - - return str_replace(array_keys($attributes), array_values($attributes), $view); -} - // validate correct php version if (version_compare("7.4.0", PHP_VERSION, ">=")) { die(view($_deftheme . '/misc/phprequirementfailed.html.twig', [