summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd.erl
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2008-08-30 22:01:01 +0000
committerChristopher Lenz <cmlenz@apache.org>2008-08-30 22:01:01 +0000
commit1d006aa6d12601e7e560d220e3c3e5c4c4a06c93 (patch)
tree27f4930647bde4b974742a67d43ce6acfc894cbd /src/couchdb/couch_httpd.erl
parent796a66de5f10b219c5ed196a8c97ed4bd3a227a2 (diff)
Rename 'module' to 'section', and 'variable' to 'option' in the config code.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@690595 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd.erl')
-rw-r--r--src/couchdb/couch_httpd.erl42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 22adb7dd..cd5c6a70 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -812,51 +812,51 @@ handle_attachment_request(_Req, _Method, _DbName, _Db, _DocId, _FileName) ->
% Config request handlers
handle_config_request(_Req, Method, {config, Config}) ->
- [Module, Key] = string:tokens(Config, "/"),
- handle_config_request(_Req, Method, {[Module, Key]});
+ [Section, Option] = string:tokens(Config, "/"),
+ handle_config_request(_Req, Method, {[Section, Option]});
-% PUT /_config/Module/Key
+% PUT /_config/Section/Option
% "value"
-handle_config_request(_Req, 'PUT', {[Module, Key]}) ->
- handle_config_request(_Req, 'POST', {[Module, Key]});
+handle_config_request(_Req, 'PUT', {[Section, Option]}) ->
+ handle_config_request(_Req, 'POST', {[Section, Option]});
-% POST,PUT /_config/Module/Key
+% POST,PUT /_config/Section/Option
% "value"
-handle_config_request(Req, 'POST', {[Module, Key]}) ->
+handle_config_request(Req, 'POST', {[Section, Option]}) ->
Value = binary_to_list(Req:recv_body()),
- ok = couch_config:store({Module, Key}, Value),
+ ok = couch_config:store({Section, Option}, Value),
send_json(Req, 200, {obj, [
{ok, true},
- {module, Module},
- {key, Key},
+ {section, Section},
+ {name, Option},
{value, Value}
]});
-% GET /_config/Module/Key
-handle_config_request(Req, 'GET', {[Module, Key]}) ->
- case couch_config:get({Module, Key},null) of
+% GET /_config/Section/Option
+handle_config_request(Req, 'GET', {[Section, Option]}) ->
+ case couch_config:get({Section, Option},null) of
null ->
throw({not_found, unknown_config_value});
Value ->
send_json(Req, 200, {obj, [
{ok, true},
- {module, Module},
- {key, Key},
+ {section, Section},
+ {name, Option},
{value, Value}
]})
end;
-% DELETE /_config/Module/Key
-handle_config_request(Req, 'DELETE', {[Module, Key]}) ->
- case couch_config:get({Module, Key}, null) of
+% DELETE /_config/Section/Option
+handle_config_request(Req, 'DELETE', {[Section, Option]}) ->
+ case couch_config:get({Section, Option}, null) of
null ->
throw({not_found, unknown_config_value});
OldValue ->
- couch_config:unset({Module, Key}),
+ couch_config:unset({Section, Option}),
send_json(Req, 200, {obj, [
{ok, true},
- {module, Module},
- {key, Key},
+ {section, Section},
+ {name, Option},
{old_value, OldValue}
]})
end.