use apache env vars to load different config files

This commit is contained in:
Guillermo Dev
2018-10-17 20:16:00 +02:00
parent 78e67a25ec
commit be0895e91e

View File

@@ -71,7 +71,8 @@ class Configuration {
public static function getConfigFilePath() public static function getConfigFilePath()
{ {
if (null === self::$customConfigFilePath) { if (null === self::$customConfigFilePath) {
self::$customConfigFilePath = realpath(dirname(__FILE__) . '/../../../../../../config/configuration.local.php'); $envfile = apache_getenv('APPLICATION_ENV') === 'development' ? 'local' : 'global';
self::$customConfigFilePath = realpath(dirname(__FILE__) . "/../../../../../../config/configuration.$envfile.php");
} }
return self::$customConfigFilePath; return self::$customConfigFilePath;
} }