Packages
diint_utilites_common_app
1.3.5
1.4.23
1.4.22
1.4.21
1.4.20
1.4.19
1.4.18
1.4.17
1.4.16
1.4.15
1.4.14
1.4.12
1.4.11
1.4.10
1.4.9
1.4.8
1.4.7
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.9
1.3.8
1.3.7
1.3.6
1.3.5
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0
1.2.101
1.2.11
1.2.10
1.2.9
1.2.8
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.13
1.0.12
1.0.11
1.0.10
1.0.9
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
библиотеки для работы с ребитом и протоколы
Current section
Files
Jump to
Current section
Files
src/utilites/application_settings.erl
%%%-------------------------------------------------------------------
%%% @author dn290597jan
%%% @copyright (C) 2016, <COMPANY>
%%% @doc
%%%
%%% @end
%%% Created : 27. Apr 2016 13:48
%%%-------------------------------------------------------------------
-module(application_settings).
-author("dn290597jan").
%% API
-export([get_section_settings/2]).
get_section_settings(Application,Key) ->
case os:getenv("ERLANG_ENV") of
"Prod" ->
case get_section_with_suffix(Application,Key,"_prod") of
undefined -> application:get_env(Application, list_to_atom(Key));
Ather -> Ather
end; % env var not defined
"Stage" -> case get_section_with_suffix(Application,Key,"_stage") of
undefined -> application:get_env(Application, list_to_atom(Key));
Ather -> Ather
end; % env var not defined
_ -> application:get_env(Application,list_to_atom(Key))
end.
get_section_with_suffix(Application,Key,Suffix)->
NewKey = list_to_atom(string:join([Key,Suffix],"")),
application:get_env(Application, NewKey).