Warning: session_start(): open(/var/lib/php/sessions/sess_p3butdab9hrsg9njkd9qu4nfaa, 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
// add latest include
static S addStdFunction() {
loading {
ret addStdFunction(findLatestInclude().id, true);
}
}
static S addStdFunction(bool realEdit) {
ret addStdFunction(findLatestInclude().id, realEdit);
}
static S addStdFunction_1006654;
static S addStdFunction(S snippetID, bool realEdit) {
loading {
L names = findFunctionDefinitions(loadSnippet(snippetID));
printStructure("Functions defined in " + snippetID + ": ", names);
if (empty(names)) ret "No functions found in " + snippetID;
S name = first(names);
if (addStdFunction_1006654 == null)
addStdFunction_1006654 = loadSnippet(#1006654);
Map map = parseStdFunctionsList(addStdFunction_1006654);
S text = loadSnippet("#761");
map.putAll(parseStdFunctionsList(text));
S def = map.get(name);
S result = "";
if (def == null) {
print(result = "Defining " + name + ".");
S newText = addToStdFunctionsList(text, name, snippetID);
print();
print(unidiff(text, newText));
if (!realEdit)
print(result += " Not editing (test mode).");
else {
editSnippet("#761", newText);
print(result += " Edited #761. Now " + countLines(newText) + " lines!");
}
} else {
print(result = "Function " + name + " already defined as " + def);
if (sameSnippetID(def, snippetID))
print("Exiting.");
else
print("Will not redefine as " + snippetID + ".");
}
ret result;
}
}