Warning: session_start(): open(/var/lib/php/sessions/sess_gg3lsetivopf5ohhkfihs7f220, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sbool loadSnippets_verbose;
static L loadSnippets(S... ids) {
ret loadSnippets(asList(ids));
}
static L loadSnippets(L ids) ctex {
new L texts;
new StringBuilder buf;
new Map cached;
initSnippetCache();
for (S id : ids) {
long snippetID = psI(id);
S text = DiskSnippetCache_get(snippetID);
S md5 = text != null ? md5(text) : ".";
if (loadSnippets_verbose)
print(id + " => " + md5 + " - " + quote(shorten(text, 20)));
mapPut(cached, snippetID, text);
buf.append(snippetID).append(" ").append(md5).append(" ");
}
if (loadSnippets_verbose)
print("loadSnippets post data: " + buf);
Map map = jsonDecodeMap(doPost(
"ids=" + urlencode(trim(str(buf))),
tb_mainServer() + "/get-multi2.php"));
for (S id : ids) {
long snippetID = psI(id);
O result = map.get(str(snippetID));
if (loadSnippets_verbose)
print(id + " => " + className(result));
if (result instanceof S) {
texts.add((S) result);
DiskSnippetCache_put(snippetID, (S) result);
} else
texts.add(cached.get(snippetID));
}
ret texts;
}