diff --git a/index.php b/index.php index 1946d66c2..320627e22 100644 --- a/index.php +++ b/index.php @@ -54,8 +54,8 @@ * NOTE: If you change these, also change the error_reporting() code below */ #define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development'); - if (isset($_SERVER['CI_ENV'])) { - define('ENVIRONMENT', $_SERVER['CI_ENV']); + if (isset($_ENV['CI_ENV'])) { + define('ENVIRONMENT', $_ENV['CI_ENV']); } else if (file_exists('.debug')) { define('ENVIRONMENT', 'development'); } else if (file_exists('.maintenance')) { diff --git a/install/includes/core_class.php b/install/includes/core_class.php index 0c74f12f2..6b67f6f18 100644 --- a/install/includes/core_class.php +++ b/install/includes/core_class.php @@ -111,9 +111,9 @@ class Core $template_path = 'config/database.php'; $output_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'] . '/application/config/database.php'; - if (isset($_SERVER['CI_ENV'])) { - $template_path = $_SERVER['CI_ENV'].'/database.php'; - $output_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'] . '/application/'.$_SERVER['CI_ENV'].'/database.php'; + if (isset($_ENV['CI_ENV'])) { + $template_path = $_ENV['CI_ENV'].'/database.php'; + $output_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'] . '/application/'.$_ENV['CI_ENV'].'/database.php'; } // Open the file @@ -153,9 +153,9 @@ class Core $template_path = 'config/config.php'; $output_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'] . '/application/config/config.php'; - if (isset($_SERVER['CI_ENV'])) { - $template_path = $_SERVER['CI_ENV'].'/config.php'; - $output_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'] . '/application/'.$_SERVER['CI_ENV'].'/config.php'; + if (isset($_ENV['CI_ENV'])) { + $template_path = $_ENV['CI_ENV'].'/config.php'; + $output_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'] . '/application/'.$_ENV['CI_ENV'].'/config.php'; } // Open the file diff --git a/install/index.php b/install/index.php index a0b74d9a1..bf57aeebf 100644 --- a/install/index.php +++ b/install/index.php @@ -24,8 +24,8 @@ if (file_exists('config_unattended.php')) { // Config Paths $db_config_path = '../application/config/'; -if (isset($_SERVER['CI_ENV'])) { - $db_config_path ='../application/'.$_SERVER['CI_ENV'].'/'; +if (isset($_ENV['CI_ENV'])) { + $db_config_path ='../application/'.$_ENV['CI_ENV'].'/'; } $db_file_path = $db_config_path . "database.php";