add automatic initialization for newly installed instances
This commit is contained in:
parent
de484dcfdf
commit
fa8e75d747
@ -14,6 +14,15 @@ function get_color_from_ip($ip) {
|
||||
//header("refresh: 28");
|
||||
header("Cache-Control: no-cache, no-store, must-revalidate");
|
||||
|
||||
if (!is_dir("data")) {
|
||||
// initialize everything
|
||||
mkdir("data", 0755);
|
||||
file_put_contents("data/sentences.txt", "<!-- automatically created empty sentences file -->\n");
|
||||
file_put_contents("data/archive-links.txt", "<!-- automatically created empty archive links file -->\n");
|
||||
file_put_contents("data/config.json", "{\n\n}\n");
|
||||
print("<p>Data directory automatically initialized</p>");
|
||||
}
|
||||
|
||||
if (array_key_exists("submitted", $_REQUEST)) {
|
||||
$word = urldecode($_REQUEST["submitted"]);
|
||||
//print("Jemand schreibt ".$word."<br>");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user