Warning: session_start(): open(/var/lib/php/sessions/sess_amabip46qa5s6e5f7v4kij0b2n, 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
extend RC {
transient RemoteDB db;
S getString(S field) { ret db.xS(this, field); }
}
static class RemoteDB {
DialogIO db;
// s = bot name or snippet ID
*(S s) {
if (isSnippetID(s)) s += " Concepts.";
db = findBot(s);
}
bool functional() { ret db != null; }
L list() { ret adopt((L) rpc(db, "xlist")); }
L list(S className) { ret adopt((L) rpc(db, "xlist", className)); }
L xlist() { ret list(); }
L xlist(S className) { ret list(className); }
// adopt is an internal method
L adopt(L l) {
if (l != null) for (RC rc : l) adopt(rc);
ret l;
}
RC adopt(RC rc) { if (rc != null) rc.db = this; ret rc; }
S xclass(RC o) {
ret (S) rpc(db, "xclass", o);
}
O xget(RC o, S field) {
ret rpc(db, "xget", o, field);
}
S xS(RC o, S field) {
ret (S) xget(o, field);
}
RC xgetref(RC o, S field) {
ret adopt((RC) xget(o, field));
}
void xset(RC o, S field, O value) {
rpc(db, "xset", o, field, value);
}
RC uniq(S className) {
RC ref = first(list(className));
if (ref == null)
ref = xnew(className);
ret ref;
}
RC xuniq(S className) { ret uniq(className); }
RC xnew(S className, O... values) {
ret adopt((RC) rpc(db, "xnew", className, values));
}
void xdelete(RC o) {
rpc(db, "xdelete", o);
}
void xdelete(L l) {
rpc(db, "xdelete", l);
}
void close() {
if (db != null)
db.close();
}
S fullgrab() { ret (S) rpc(db, "xfullgrab"); }
S xfullgrab() { ret fullgrab(); }
}