Files
sld-php-template/config/init.php
T
2026-08-19 17:26:06 +01:00

29 lines
995 B
PHP

<?php
include("config/functions_init.php");
$env="generic";
switch($env){
/*------ DON'T TOUCH THIS PART ------ */
case "generic":
$doc_root = !empty($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : dirname(__DIR__);
define('WEB_ROOT', $doc_root);
$host = !empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
define('DOMAIN', $host);
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https://' : 'http://';
define('FULL_DOMAIN', $protocol . DOMAIN);
define("ROOT_URL", $protocol . DOMAIN );
define("ROOT_DIR", rtrim(WEB_ROOT, '/') . "/");
break;
/* ----------------------------------- */
default:
// Showing error page by default.
$error_env_check=true;
include("pages/env-error.php");
die;
}
require_once(ROOT_DIR . "config/constants.php");
require_once(CONFIG_FOLD . "settings.php");
require_once(FUNCTIONS_FOLD . "functions.php");
?>