aboutsummaryrefslogtreecommitdiffstats
path: root/util/datamanager.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2008-11-28 20:17:20 +0500
committerWaqas Hussain <waqas20@gmail.com>2008-11-28 20:17:20 +0500
commit47761d875a1db3f3f7415e0f137b3b0287c640e2 (patch)
tree01891ee458f65ebe21f5daa1afa446028bdb10d7 /util/datamanager.lua
parent631e249397fd7cd2a2c5a7cb4c1feba664a41b2e (diff)
downloadprosody-47761d875a1db3f3f7415e0f137b3b0287c640e2.tar.gz
prosody-47761d875a1db3f3f7415e0f137b3b0287c640e2.zip
Added option core.data_path
Diffstat (limited to 'util/datamanager.lua')
-rw-r--r--util/datamanager.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua
index 80b35733..f25fffb3 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -17,6 +17,8 @@ local indent = function(f, i)
end
end
+local data_path = "data";
+
module "datamanager"
@@ -70,14 +72,18 @@ end
------- API -------------
+function set_data_path(path)
+ data_path = path;
+end
+
function getpath(username, host, datastore, ext)
ext = ext or "dat";
if username then
- return format("data/%s/%s/%s.%s", encode(host), datastore, encode(username), ext);
+ return format("%s/%s/%s/%s.%s", data_path, encode(host), datastore, encode(username), ext);
elseif host then
- return format("data/%s/%s.%s", encode(host), datastore, ext);
+ return format("%s/%s/%s.%s", data_path, encode(host), datastore, ext);
else
- return format("data/%s.%s", datastore, ext);
+ return format("%s/%s.%s", data_path, datastore, ext);
end
end