Support config PROJECT_PATH_CONFIG and PROJECT_PATH_SPECIFIC via environment variables (#1270)

This commit is contained in:
wrvsrx 2024-07-21 16:24:53 +08:00 committed by GitHub
parent ae0a34d324
commit cc3eca1dc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -163,11 +163,25 @@ class Framework extends \Flake\Core\Framework {
define("PROJECT_PATH_CORE", PROJECT_PATH_ROOT . "Core/");
define("PROJECT_PATH_CORERESOURCES", PROJECT_PATH_CORE . "Resources/");
define("PROJECT_PATH_SPECIFIC", PROJECT_PATH_ROOT . "Specific/");
define("PROJECT_PATH_CONFIG", PROJECT_PATH_ROOT . "config/");
define("PROJECT_PATH_FRAMEWORKS", PROJECT_PATH_CORE . "Frameworks/");
define("PROJECT_PATH_WWWROOT", PROJECT_PATH_CORE . "WWWRoot/");
// set PROJECT_PATH_CONFIG from BAIKAL_PATH_CONFIG
$baikalPathConfig = getenv('BAIKAL_PATH_CONFIG');
if ($baikalPathConfig !== false) {
define("PROJECT_PATH_CONFIG", $baikalPathConfig);
} else {
define("PROJECT_PATH_CONFIG", PROJECT_PATH_ROOT . "config/");
}
// set PROJECT_PATH_SPECIFIC from BAIKAL_PATH_CONFIG
$baikalPathConfig = getenv('BAIKAL_PATH_SPECIFIC');
if ($baikalPathConfig !== false) {
define("PROJECT_PATH_SPECIFIC", $baikalPathConfig);
} else {
define("PROJECT_PATH_SPECIFIC", PROJECT_PATH_ROOT . "Specific/");
}
require_once PROJECT_PATH_CORE . "Distrib.php";
define("PROJECT_PATH_DOCUMENTROOT", PROJECT_PATH_ROOT . "html/");