From 56340e992f571a478f92bb12cf81af8161c66545 Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 24 Aug 2018 12:12:11 +0200 Subject: [PATCH] - Added constat CI_ENVIRONMENT to config/vilesci.config-default.inc.php - Changed index.ci.php to use CI_ENVIRONMENT to set the environment variable CI_ENV --- config/vilesci.config-default.inc.php | 3 +++ index.ci.php | 13 ++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/config/vilesci.config-default.inc.php b/config/vilesci.config-default.inc.php index 049109471..7cfff8938 100644 --- a/config/vilesci.config-default.inc.php +++ b/config/vilesci.config-default.inc.php @@ -197,4 +197,7 @@ define('DVB_PORTAL', 'https://stubei-p.portal.at'); define('DVB_USERNAME','username'); // Passwort define('DVB_PASSWORD','passwort'); + +define('CI_ENVIRONMENT', 'development'); // Code igniter environment variable + ?> diff --git a/index.ci.php b/index.ci.php index 5514d9450..ad946373a 100644 --- a/index.ci.php +++ b/index.ci.php @@ -55,6 +55,14 @@ * */ +// Loads FHC config files +require_once 'config/global.config.inc.php'; +require_once 'config/vilesci.config.inc.php'; + +// Check if the CI_ENVIRONMENT constants is set and eventually use it to set the CI_ENV environment variable +if (defined('CI_ENVIRONMENT')) $_SERVER['CI_ENV'] = CI_ENVIRONMENT; + +// If the CI_ENV environment variable is not set then use "development" as default define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development'); /* @@ -65,7 +73,6 @@ define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'developm * Different environments will require different levels of error reporting. * By default development will show errors but testing and live will hide them. */ - switch (ENVIRONMENT) { case 'development': @@ -299,10 +306,6 @@ switch (ENVIRONMENT) * */ -// First load the FHC-Config-Files ... -require_once 'config/global.config.inc.php'; -require_once 'config/vilesci.config.inc.php'; - // ... and the vendor autoload include_once 'vendor/autoload.php';