diff --git a/core/constant/global.php b/core/constant/global.php index 864f314ec..23570b929 100644 --- a/core/constant/global.php +++ b/core/constant/global.php @@ -19,8 +19,24 @@ =========================================================================*/ define('CORE_CONFIGS_PATH', BASE_PATH . '/core/configs'); -define('LOCAL_CONFIGS_PATH', CORE_CONFIGS_PATH); -define('LOGS_PATH', BASE_PATH . '/log'); + +if(getenv('midas_local_configs_path') !== false) + { + define('LOCAL_CONFIGS_PATH', getenv('midas_local_configs_path')); + } +else + { + define('LOCAL_CONFIGS_PATH', CORE_CONFIGS_PATH); + } + +if(getenv('midas_logs_path') !== false) + { + define('LOGS_PATH', getenv('midas_logs_path')); + } +else + { + define('LOGS_PATH', BASE_PATH . '/log'); + } if(file_exists(LOCAL_CONFIGS_PATH . '/core.local.ini')) { diff --git a/core/controllers/components/UtilityComponent.php b/core/controllers/components/UtilityComponent.php index c699a97e4..7d3c10fda 100644 --- a/core/controllers/components/UtilityComponent.php +++ b/core/controllers/components/UtilityComponent.php @@ -406,7 +406,14 @@ public static function getDataDirectory($subdir = '') } if(!isset($dataDirectory) || empty($dataDirectory)) { - $dataDirectory = BASE_PATH.'/data'; + if(getenv('midas_data_path') !== false) + { + $dataDirectory = getenv('midas_data_path'); + } + else + { + $dataDirectory = BASE_PATH.'/data'; + } } if($subdir == '') { @@ -441,7 +448,14 @@ public static function getTempDirectory($subdir = "misc") } if(!isset($tempDirectory) || empty($tempDirectory)) { - $tempDirectory = BASE_PATH.'/tmp'; + if(getenv('midas_temp_path') !== false) + { + $tempDirectory = getenv('midas_temp_path'); + } + else + { + $tempDirectory = BASE_PATH.'/tmp'; + } } return $tempDirectory .'/'.$subdir.'/'; }