Warning: session_start(): open(/var/lib/php/sessions/sess_i4la9urvl6qlhpi2od6pis0cha, 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
!7
// uses its own transpiler so it can set options
cmodule SnippetTranspiler {
switchable int refreshDelay = 1; // seconds
switchable S authModuleID;
O html(S _uri, SS params) {
// check auth module if set
if (nempty(authModuleID))
try object dm_call_assertModuleExists(authModuleID, 'webAuthCheck, _uri, params);
ret dm_evalInQ(() -> {
if (eq("1", params.get('medium))) {
veryQuickJava_mediumRefresh();
print("Medium-refreshed transpiler.");
}
if (eq("1", params.get('fresh))) {
refreshTranspiler();
print("Refreshed transpiler.");
}
S uri = dropPrefixSlash(_uri);
if (isSnippetID(uri)) params.put(snippetID := uri);
if (empty(params.get('snippetID))) ret "OK";
sendToSnippetUpdatesBot("/transpiling/" + params.get('snippetID));
final bool compile = eq("1", params.get('compile));
final new Flag ok;
print_byThread = new InheritableThreadLocal;
S text = hijackPrint_tee(r {
S snippetID = fsI(params.get('snippetID));
pcall {
bool isInclude = getSnippetType(snippetID) == snippetType_JavaXInclude();
transpileRaw_translator();
set(transpileRaw_trans, +print_byThread);
print("Set print_byThread (" + print_byThread! + ") in " + systemHashCode(transpileRaw_trans));
temp tempSetTL(transpileForServer_compile, compile);
temp tempSetTL(transpileRaw_asInclude, isInclude);
transpileForServer(snippetID);
ok.raise();
}
});
S redirect = params.get('redirect);
sendToSnippetUpdatesBot("/transpile" + (ok.isUp() ? "OK" : "Fail")
+ "/" + psI(params.get('snippetID)));
ret hhtml(hhead(htitle((ok.isUp() ? "OK" : "Failed") + " Transpilation")
+ (ok.isUp() && nempty(redirect) ? hrefresh(refreshDelay, redirect) : ""))
+ hbody(hsourcecode(text)));
});
}
}