From b91968606ac5f1a9237fb17bed015e287a231fb6 Mon Sep 17 00:00:00 2001 From: Arsen Mirzaev Tatyano-Muradovich Date: Thu, 13 Feb 2025 08:40:08 +0300 Subject: [PATCH] resolved #28 --- mirzaev/huesos/system/controllers/core.php | 2 +- mirzaev/huesos/system/public/index.php | 1 + .../huesos/system/settings/project.php.sample | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 mirzaev/huesos/system/settings/project.php.sample diff --git a/mirzaev/huesos/system/controllers/core.php b/mirzaev/huesos/system/controllers/core.php index 143940b..44498d7 100755 --- a/mirzaev/huesos/system/controllers/core.php +++ b/mirzaev/huesos/system/controllers/core.php @@ -167,7 +167,7 @@ class core extends controller $this->account = $this->session->account($this->errors['account']); // Initializing of the settings - $this->settings = settings::active(); + $this->settings = settings::active(create: SETTINGS_PROJECT); // Initializing of the language $this->language = $this->account?->language ?? $this->session?->buffer['language'] ?? $this->settings?->language ?? language::en; diff --git a/mirzaev/huesos/system/public/index.php b/mirzaev/huesos/system/public/index.php index f207c32..ebcc98a 100755 --- a/mirzaev/huesos/system/public/index.php +++ b/mirzaev/huesos/system/public/index.php @@ -18,6 +18,7 @@ define('ROBOT_VERSION', '1.0.0'); define('VIEWS', realpath('..' . DIRECTORY_SEPARATOR . 'views')); define('STORAGE', realpath('..' . DIRECTORY_SEPARATOR . 'storage')); define('SETTINGS', realpath('..' . DIRECTORY_SEPARATOR . 'settings')); +define('SETTINGS_PROJECT', require(SETTINGS . DIRECTORY_SEPARATOR . 'project.php')); define('INDEX', __DIR__); define('ROOT', INDEX . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR); define('THEME', 'default'); diff --git a/mirzaev/huesos/system/settings/project.php.sample b/mirzaev/huesos/system/settings/project.php.sample new file mode 100644 index 0000000..2409c84 --- /dev/null +++ b/mirzaev/huesos/system/settings/project.php.sample @@ -0,0 +1,17 @@ + [ + 'name' => 'Project' + ], + 'language' => 'en', + 'currency' => 'usd', + 'company' => [ + 'identifier' => null, + 'tax' => null, + 'name' => null, + 'offer' => false, + 'sim' => null, + 'mail' => null + ] +];