codeigniter - is this approach good to define environment with dotenv - PHP -


i'm using phpdotent , defined environment in end of index.php in codeigniter. works fine , wonder if approach good? or not

require_once basepath . 'dotenv/autoloader.php'; $dotenv = new dotenv\dotenv(__dir__); $dotenv->load();  $en = getenv('app_env');      switch ($en)     {         case 'development':             define('environment', 'development');             error_reporting(e_all);         break;          case 'testing':         case 'production':             define('environment', 'production');             error_reporting(0);         break;          default:             exit('the application environment not set correctly.');     } 


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -