Lockfile check.php, addhit.php, BuLi-Tipp Debugging, Galerie Kommentarfunktion
This commit is contained in:
@@ -4,18 +4,35 @@ include("../rowforeach.php");
|
||||
include("inc.php");
|
||||
|
||||
$bundesliga = file_get_contents("liga.txt");
|
||||
$year = file_get_contents("saison.txt");
|
||||
$year = intval(file_get_contents("saison.txt"));
|
||||
|
||||
$reload=false;
|
||||
$lockFile = fopen(__DIR__ . '/script.lock', 'c');
|
||||
|
||||
if (!$lockFile) {
|
||||
die('Lockdatei konnte nicht geöffnet werden');
|
||||
}
|
||||
|
||||
if (flock($lockFile, LOCK_EX | LOCK_NB)) {
|
||||
// Skript läuft noch nicht
|
||||
|
||||
// Paarungen holen
|
||||
// HTTP-Request ausführen
|
||||
$spieltag=getmaxtippspieltag()+1;
|
||||
|
||||
$result=mysqli_execute_query($db_id,"SELECT COUNT(*) FROM `buli-paarungen`;",[]);
|
||||
$row=mysqli_fetch_row($result);
|
||||
if($row[0]==0){
|
||||
echo "Keine Paarungen in der Datenbank, starte mit Spieltag 1";
|
||||
$spieltag=1;
|
||||
}else{
|
||||
$spieltag=getmaxtippspieltag()+1;
|
||||
|
||||
}
|
||||
if($spieltag<=34){
|
||||
$response = file_get_contents("https://api.openligadb.de/getmatchdata/bl".$bundesliga."/".$year."/".$spieltag, false);
|
||||
|
||||
if ($response === false) {
|
||||
echo "<script>window.alert(`Fehler beim HTTP-Request(Z.41)! Bitte einen Admin kontaktieren! BuLi-Tipp Daten konnten nicht aktualisiert werden.`);</script>";
|
||||
echo "Fehler beim HTTP Request!";
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +84,6 @@ if ($responseData!=null) {
|
||||
|
||||
$spieltag=getmaxspieltag()+1;
|
||||
|
||||
if($spieltag<=3){
|
||||
|
||||
$response = file_get_contents("https://api.openligadb.de/getmatchdata/bl".$bundesliga."/".$year."/".$spieltag, false);
|
||||
|
||||
@@ -100,7 +116,6 @@ if ($responseData) {
|
||||
// echo "<script>window.alert(`JSON-Response ungültig (Z.29)! Bitte einen Admin kontaktieren! BuLi-Tipp Daten konnten nicht aktualisiert werden.`);</script>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(srowforeach("SELECT COUNT(`id`) from `buli-icons`;",[])[0][0]<9){
|
||||
mysqli_execute_query($db_id,"TRUNCATE `buli-icons`;",[]);
|
||||
@@ -114,3 +129,7 @@ if(srowforeach("SELECT COUNT(`id`) from `buli-icons`;",[])[0][0]<9){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
flock($lockFile, LOCK_UN);
|
||||
fclose($lockFile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user