Skip to content
Permalink
Browse files Browse the repository at this point in the history
Debug Mode can now only be enabled by an environment variable
  • Loading branch information
nook24 committed Mar 17, 2020
1 parent 6c9bb1d commit 719410b
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions app/Config/Environments.php
Expand Up @@ -47,19 +47,18 @@ protected static function _detectCli() {
* @return string
*/
protected static function _detectHttp() {
$host = env('HTTP_HOST');
$environment = self::PRODUCTION;

if (substr($host, 0, 4) == 'dev.') {
$environment = self::DEVELOPMENT;
} else if (substr($host, 0, 4) == 'dev-') {
$environment = self::DEVELOPMENT;
} else if (substr($host, 0, 8) == 'staging.') {
$environment = self::STAGING;
} else {
$environment = self::PRODUCTION;
}
// To enable debug mode please add
// fastcgi_param OITC_DEBUG 1;
// to your nginx config

if (isset($_SERVER['OITC_DEBUG'])) {
if ($_SERVER['OITC_DEBUG'] === '1') {
$environment = self::DEVELOPMENT;
}
}

return $environment;

}
}

0 comments on commit 719410b

Please sign in to comment.