Update to use the new config application
diff --git a/src/couch_plugins.erl b/src/couch_plugins.erl
index dcbd2d3..24e9a50 100644
--- a/src/couch_plugins.erl
+++ b/src/couch_plugins.erl
@@ -17,7 +17,7 @@
% couch_plugins:install({"geocouch", "http://people.apache.org/~jan/", "couchdb1.2.x_v0.3.0-11-gd83ba22", [{"R15B03", "ZetgdHj2bY2w37buulWVf3USOZs="}]}).
plugin_dir() ->
- couch_config:get("couchdb", "plugin_dir").
+ config:get("couchdb", "plugin_dir").
log(T) ->
?LOG_DEBUG("[couch_plugins] ~p ~n", [T]).
@@ -82,11 +82,11 @@
-spec register_plugin(string(), string()) -> ok.
register_plugin(Name, Version) ->
- couch_config:set("plugins", Name, Version).
+ config:set("plugins", Name, Version).
-spec unregister_plugin(string()) -> ok.
unregister_plugin(Name) ->
- couch_config:delete("plugins", Name).
+ config:delete("plugins", Name).
%% * * *
@@ -110,16 +110,16 @@
-spec load_config_file(string(), function()) -> ok.
load_config_file(File, Fun) ->
- {ok, Config} = couch_config:parse_ini_file(File),
+ {ok, Config} = config:parse_ini_file(File),
lists:foreach(Fun, Config).
-spec set_config({{string(), string()}, string()}) -> ok.
set_config({{Section, Key}, Value}) ->
- ok = couch_config:set(Section, Key, Value).
+ ok = config:set(Section, Key, Value).
-spec delete_config({{string(), string()}, _Value}) -> ok.
delete_config({{Section, Key}, _Value}) ->
- ok = couch_config:delete(Section, Key).
+ ok = config:delete(Section, Key).
-spec file_names(string(), string()) -> string().
file_names(Name, Version) ->
diff --git a/src/couch_plugins_httpd.erl b/src/couch_plugins_httpd.erl
index 4dabbb4..d4d455b 100644
--- a/src/couch_plugins_httpd.erl
+++ b/src/couch_plugins_httpd.erl
@@ -41,7 +41,7 @@
Name = ?b2l(Name0),
Path = lists:map(fun binary_to_list/1, Path0),
OTPRelease = erlang:system_info(otp_release),
- PluginVersion = couch_config:get("plugins", Name),
+ PluginVersion = config:get("plugins", Name),
CouchDBVersion = couch_server:get_version(short),
FullName = string:join([Name, PluginVersion, OTPRelease, CouchDBVersion], "-"),
FullPath = filename:join([FullName, "priv", "www", string:join(Path, "/")]) ++ "/",
@@ -51,7 +51,7 @@
couch_httpd:send_method_not_allowed(Req, "POST").
plugin_dir() ->
- couch_config:get("couchdb", "plugin_dir").
+ config:get("couchdb", "plugin_dir").
do_install(false, Plugin) ->
couch_plugins:install(Plugin);
do_install(true, Plugin) ->