ENV is taken instead of SERVER for Environment

This commit is contained in:
Joerg
2024-04-14 18:07:20 +02:00
parent 2c2787e5bb
commit 3d80d770a4
3 changed files with 10 additions and 10 deletions

View File

@@ -54,8 +54,8 @@
* NOTE: If you change these, also change the error_reporting() code below * NOTE: If you change these, also change the error_reporting() code below
*/ */
#define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development'); #define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
if (isset($_SERVER['CI_ENV'])) { if (isset($_ENV['CI_ENV'])) {
define('ENVIRONMENT', $_SERVER['CI_ENV']); define('ENVIRONMENT', $_ENV['CI_ENV']);
} else if (file_exists('.debug')) { } else if (file_exists('.debug')) {
define('ENVIRONMENT', 'development'); define('ENVIRONMENT', 'development');
} else if (file_exists('.maintenance')) { } else if (file_exists('.maintenance')) {

View File

@@ -111,9 +111,9 @@ class Core
$template_path = 'config/database.php'; $template_path = 'config/database.php';
$output_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'] . '/application/config/database.php'; $output_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'] . '/application/config/database.php';
if (isset($_SERVER['CI_ENV'])) { if (isset($_ENV['CI_ENV'])) {
$template_path = $_SERVER['CI_ENV'].'/database.php'; $template_path = $_ENV['CI_ENV'].'/database.php';
$output_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'] . '/application/'.$_SERVER['CI_ENV'].'/database.php'; $output_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'] . '/application/'.$_ENV['CI_ENV'].'/database.php';
} }
// Open the file // Open the file
@@ -153,9 +153,9 @@ class Core
$template_path = 'config/config.php'; $template_path = 'config/config.php';
$output_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'] . '/application/config/config.php'; $output_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'] . '/application/config/config.php';
if (isset($_SERVER['CI_ENV'])) { if (isset($_ENV['CI_ENV'])) {
$template_path = $_SERVER['CI_ENV'].'/config.php'; $template_path = $_ENV['CI_ENV'].'/config.php';
$output_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'] . '/application/'.$_SERVER['CI_ENV'].'/config.php'; $output_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'] . '/application/'.$_ENV['CI_ENV'].'/config.php';
} }
// Open the file // Open the file

View File

@@ -24,8 +24,8 @@ if (file_exists('config_unattended.php')) {
// Config Paths // Config Paths
$db_config_path = '../application/config/'; $db_config_path = '../application/config/';
if (isset($_SERVER['CI_ENV'])) { if (isset($_ENV['CI_ENV'])) {
$db_config_path ='../application/'.$_SERVER['CI_ENV'].'/'; $db_config_path ='../application/'.$_ENV['CI_ENV'].'/';
} }
$db_file_path = $db_config_path . "database.php"; $db_file_path = $db_config_path . "database.php";