Software /
code /
prosody
Comparison
util/datamanager.lua @ 5243:07e8256efcda
util.datamanager: Remove dead code path
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 14 Dec 2012 14:21:32 +0100 |
parent | 5153:688aeac0012a |
child | 5244:775d98184acf |
comparison
equal
deleted
inserted
replaced
5238:0cc0359d8c39 | 5243:07e8256efcda |
---|---|
111 host = (host and encode(host)) or "_global"; | 111 host = (host and encode(host)) or "_global"; |
112 username = username and encode(username); | 112 username = username and encode(username); |
113 if username then | 113 if username then |
114 if create then mkdir(mkdir(mkdir(data_path).."/"..host).."/"..datastore); end | 114 if create then mkdir(mkdir(mkdir(data_path).."/"..host).."/"..datastore); end |
115 return format("%s/%s/%s/%s.%s", data_path, host, datastore, username, ext); | 115 return format("%s/%s/%s/%s.%s", data_path, host, datastore, username, ext); |
116 elseif host then | 116 else |
117 if create then mkdir(mkdir(data_path).."/"..host); end | 117 if create then mkdir(mkdir(data_path).."/"..host); end |
118 return format("%s/%s/%s.%s", data_path, host, datastore, ext); | 118 return format("%s/%s/%s.%s", data_path, host, datastore, ext); |
119 else | |
120 if create then mkdir(data_path); end | |
121 return format("%s/%s.%s", data_path, datastore, ext); | |
122 end | 119 end |
123 end | 120 end |
124 | 121 |
125 function load(username, host, datastore) | 122 function load(username, host, datastore) |
126 local data, ret = envloadfile(getpath(username, host, datastore), {}); | 123 local data, ret = envloadfile(getpath(username, host, datastore), {}); |