2 require_once("../Class/database-construction.php");
3 $database = new DatabaseConstruction("../");
4 $top_file = explode("\n", file_get_contents("../4Chan_Bans_Log-Ledger.txt"))[1];
6 $database_add_array = [];
7 $database_update_array = [];
9 $current_json_file = explode("\n", file_get_contents("../Logs/4Chan_Bans_Log-Reverse_Chrono-$top_file.json"));
11 $newest_entry_time = "" . JSON_Decode(substr($current_json_file[count($current_json_file) - 2], 0, -1), true)["time"];
12 array_push($database_add_array, ["FileNumber"=>$top_file, "NewestTime"=>$newest_entry_time]);
15 //uses duplicate checking
16 $database->massAddToTable("JSONProperties", $database_add_array);