Skip to content

Commit

Permalink
re: #1 - Updating application environment logic check
Browse files Browse the repository at this point in the history
  • Loading branch information
morsecodemedia committed Apr 6, 2017
1 parent 3f00329 commit 4e007ec
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,15 @@
*
* NOTE: If you change these, also change the error_reporting() code below
*/
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
if( (strpos($_SERVER['HTTP_HOST'], 'localhost') !== FALSE) ||
(strpos($_SERVER['HTTP_HOST'], '127.0.0.1') !== FALSE) ) { // development
define('ENVIRONMENT', 'development');
} elseif ( strpos($_SERVER['HTTP_HOST'], 'stage') !== FALSE) { // staging
define('ENVIRONMENT', 'staging');
} else { // production
define('ENVIRONMENT', 'production');
}


/*
*---------------------------------------------------------------
Expand Down

0 comments on commit 4e007ec

Please sign in to comment.